Catch seg fault from DLL linked to EXE
-
Hello everybody,
I have my main Qt application and we have another application that is built and linked to the main application as a dynamic library.This other application sometimes produces seg faults and I would like to be able to catch these (at least to stop the main program from crashing), since this causes the main program to lose data.
I know the best course of action is solving the bugs in the dll, and we do that, but I also don't want any unsolved seg faults to crash our main application.
What would be the best way of doing this?
-
Hello everybody,
I have my main Qt application and we have another application that is built and linked to the main application as a dynamic library.This other application sometimes produces seg faults and I would like to be able to catch these (at least to stop the main program from crashing), since this causes the main program to lose data.
I know the best course of action is solving the bugs in the dll, and we do that, but I also don't want any unsolved seg faults to crash our main application.
What would be the best way of doing this?
@Ali-Goodarz said in Catch seg fault from DLL linked to EXE:
I know the best course of action is solving the bugs in the dll, and we do that, but I also don't want any unsolved seg faults to crash our main application.
I do not think you can safely do this. Whatever failed in the DLL has left your program in an unknown state. It is hard to recover and keep running if you do not know where you are starting from. I suspect that the best you could hope for is that data already written to disk is flushed before you let the main program die.
What would be the best way of doing this?
Structured Exception Handling might provide some options, including SetUnhandledExceptionFilter().
-
A Ali.Goodarz has marked this topic as solved on