The program crashes in the debugger before anything happens

I am building a Windows XP application using the MinGW toolchain and sometimes it crashes unexpectedly. So, I'm trying to use the debugger (Gdb), but the program exits with code 03 before anything happens. In fact, all I can see from GDB is:

[New theme 3184.0x7b8]
[New theme 3184.0xef8]

The program exited with code 03.

My suspicion is that there is some unfortunate dynamic dependency binding (Qt, VTK and ITK built with MinGW). However, this does not happen when I just run the program normally. Or, if it does, it seems choppy and good after starting and running the program. NOTE. I also use Cmake for cross compilation.

What should I do? What can I try?

+2


a source to share


2 answers


Add a callback via signal(SIGABRT, <callback>)

to catch the call to be canceled before it completes the process. If this happens before you click main()

, you might need a static global traversal and compiler to catch it.



+2


a source


Code 3 usually falls back on a segfault. Try switching to Linux and debugging your program with an electric fence. This may give you additional information.



0


a source







All Articles