Bug 22274

Summary: /usr/lib/libgcc.a is not thread safe
Product: Base System Reporter: lampa <lampa>
Component: gnuAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description lampa 2000-10-24 18:50:00 UTC
Installed gcc library /usr/lib/libgcc.a is not compiled using
--enable-threads. The description of this configure argument
in gcc-2.95.2 is wrong, it should be on not only for Objective C,
but also for C++ to enable thread safe stack unwinding during exception
processing.

From Orbacus C++ JTC-1.0.13 (www.ooc.com):
IMPORTANT: You must ensure that the version of gcc that you are using
was configured with --enable-threads. Without this exception handling
is not thread safe. To determine if this is the case, run nm on
libgcc.a and verify that pthread symbols are present.

Fix: 

Ship /usr/lib/libgcc.a compiled with --enable-threads!
How-To-Repeat: In my case regular arithmetic exception resulted in segmentation fault.
If the program was linked with the proper library, exception is correctly catched and reported.
Comment 1 Jason Evans 2000-10-24 22:05:56 UTC
On Tue, Oct 24, 2000 at 10:48:59AM -0700, lampa@fee.vutbr.cz wrote:
> >Description:
> Installed gcc library /usr/lib/libgcc.a is not compiled using
> --enable-threads. The description of this configure argument
> in gcc-2.95.2 is wrong, it should be on not only for Objective C,
> but also for C++ to enable thread safe stack unwinding during exception
> processing.
> 
> >Fix:
> Ship /usr/lib/libgcc.a compiled with --enable-threads!

The correct solution is to use the -pthread gcc flag so that libgcc_r.a is
used.  If that still doesn't work, then please open a new PR.

Jason
Comment 2 Jason Evans freebsd_committer freebsd_triage 2000-10-24 22:06:00 UTC
State Changed
From-To: open->closed

Very likely user error rather than a bug.