(g++) program crashes when I throw an exception in a separate thread

Joshua John Bialkowski jbialk@MIT.EDU
Thu Jul 23 08:03:00 GMT 2009


Quoting Joshua John Bialkowski

>>> I'm using g++ (GCC) version 3.4.4 from the cygwin installer, and 
>>> I've run in to
>>> this very confusing problem. I'm compiling with the -mno-cygwin option
>> [...]
>>> The problem I have is that when I launch a separate thread, and 
>>> then throw an
>>> exception in that separate thread, my program will crash... even if I catch
>>> that exception.
>>
>> Are you compiling with '-mthreads'?
>>
>
> I was not, in fact. Of course the first results in Google for "MinGW
> '-mthreads'" is: "always use -mthreads when using threads under MinGW. I just
> spent hours using gdb instead of -mthreads." I will give that a try 
> and report
> back to the list for the benefit of posterity.
>

That was the problem. Both the toy code and my original now work as I expected
them to. Thank you for your help. :$.




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list