> Date: Wed, 26 Dec 2012 17:23:59 +0100
> From: Wim Delvaux <wrl.delvaux@...>
> When my program returns from main it crashes with the message
> "This program has requested the runtime to terminate it in an unusual way ..."
> When I set a breakpoint at 'exit' using gdb, and do a backtrace when
> the crash occurs I see this
> Breakpoint 1, 0x75b5b2e5 in msvcrt!_exit ()
> from C:\Windows\syswow64\msvcrt.dll
> (gdb) bt
> #0 0x75b5b2e5 in msvcrt!_exit () from C:\Windows\syswow64\msvcrt.dll
> #1 0x75b58f7b in msvcrt!abort () from C:\Windows\syswow64\msvcrt.dll
> #2 0x6e9565ae in libgcc_s_dw2-1!__deregister_frame_info_bases ()
> from c:\users\u19809\Development\Tools\mingw-4-5-2\bin\libgcc_s_dw2-1.dll
> #3 0x004013c0 in __gcc_deregister_frame ()
> #4 0x75afc3e9 in msvcrt!isspace () from C:\Windows\syswow64\msvcrt.dll
> #5 0x75b037df in msvcrt!_cexit () from C:\Windows\syswow64\msvcrt.dll
> #6 0x00000000 in ?? ()
> What can be wrong here ??? How can I debug this if the problem is in
> my application ?
(gdb) thread apply all bt
IOW, there could be more than one thread in your program (since a
crash is known to start additional threads), and you are looking at a
backtrace for a wrong thread.