GCC 4.6.2 C++ thread cancellation issue
Mike Dalpee
mikedalpee@enginsol.com
Fri May 11 20:20:00 GMT 2012
Not sure what happened there, but here is the corrected first program.
And your second command example is actually how our make system would have built it. Just wasn't thinking that much about it when I threw the bug examples together :)
________________________________________
From: Jonathan Wakely [jwakely.gcc@gmail.com]
Sent: Friday, May 11, 2012 3:13 PM
To: Mike Dalpee
Cc: Ian Lance Taylor; gcc-help@gcc.gnu.org
Subject: Re: GCC 4.6.2 C++ thread cancellation issue
On 11 May 2012 19:41, Mike Dalpee wrote:
> Ok, I have provided the two examples as attachments. I had to transcribe these from printouts, so I apologize if there are any typos that prevent them from immediately compiling.
Both files need
s/pthread tid;/pthread_t tid;/
For the first program I get no abort:
Thread created
In ThreadRun
In Some3rdPartyFunction
Cancelling Thread
Joining cancelled thread
Rethrowing abi::_forced_unwind
Returning from main
Did you mean to put an empty exception specification on the
Some3rdPartyFunction?
For the second I see an abort
Thread created
In ThreadRun
Handling int exception
In Some3rdPartyFunction
Cancelling Thread
Joining cancelled thread
terminate called after throwing an instance of 'int'
Aborted
> I used the following commands to build these:
>
> gcc -g bug1.cpp -o bug1 -lstdc++ -lpthread
> gcc -g bug2.cpp -o bug2 -lstdc++ -lpthread
It won't change the behaviour, but any reason you don't use these
commands instead?
g++ -g bug1.cpp -o bug1 -pthread
g++ -g bug2.cpp -o bug2 -pthread
i.e. compile with the g++ driver so libstdc++ is linked in
automatically, and use -pthread so _REENTRANT is defined, as well as
linking to libpthread.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bug1.cpp
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20120511/0603e7b2/attachment-0001.ksh>
More information about the Gcc-help
mailing list