Bug 66314 - gcc 2.96 compiled program crashes on SMP machine
gcc 2.96 compiled program crashes on SMP machine
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2002-06-07 11:26 EDT by Peter Klotz
Modified: 2007-04-18 12:43 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-10-02 16:52:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
program and shell script to compile it (1.46 KB, application/octet-stream)
2002-06-07 11:28 EDT, Peter Klotz
no flags Details

  None (edit)
Description Peter Klotz 2002-06-07 11:26:49 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530

Description of problem:
The attached program performs multithreading via the ZThread library
(http://zthread.sourceforge.net/). It works stable on single processor machines
but always crashes on dual processor machines. The backtrace is always the same,
it crashes in the STL streambuf class.

When I use gcc 3.1 to compile ZThread and the program, everything works stable,
even on SMP machines.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Download and compile ZThread (preferrably 2.1.x) library (i.e. ./configure, make)
2.Edit and run compile.sh
3.Run the executable


Actual Results:  The program segfaults on dual processor machines but is stable
on single processor machines.

Expected Results:  Should run stable.

Additional info:

Backtrace from segfault:

#0  0x401555dc in _IO_default_xsputn (f=0xbe1ff950, data=0x804f03c,
    n=134549856) at genops.c:466
#1  0x400a1bc3 in streambuf::xsputn () from /usr/lib/libstdc++-libc6.2-2.so.3
#2  0x4009e8dc in ostream::write () from /usr/lib/libstdc++-libc6.2-2.so.3
#3  0x0804b8cb in ostream & operator<<<char, string_char_traits<char>,
__default_alloc_template<true, 0> > ()
#4  0x0804b3b9 in Log::WriteStream ()
#5  0x0804b481 in endLog ()
#6  0x0804db95 in MyThread::run ()
#7  0x4004d7a8 in ZThread::ThreadImpl::dispatch ()
#8  0x4005681e in _dispatch ()
#9  0x40219f87 in pthread_start_thread (arg=0xbe1ffc00) at manager.c:284
Comment 1 Peter Klotz 2002-06-07 11:28:21 EDT
Created attachment 60024 [details]
program and shell script to compile it
Comment 2 Ken Snider 2003-11-26 17:01:13 EST
This problem is still happening - also in the stream and stringstream

Is gcc2.96 not thread-safe?
Comment 3 Richard Henderson 2004-10-02 16:52:53 EDT
Indeed, gcc 2.96 libstdc++ was not thread safe.  But that aside, current
thread-safe versions are tied to pthreads, and so would not have worked
with a third-party thread library.

Closing as CURRENTRELEASE, as it seems that the main complaint was vs
the non-thread-safe-ness.

Note You need to log in before you can comment on or make changes to this bug.