Bug 66314 - gcc 2.96 compiled program crashes on SMP machine
Summary: gcc 2.96 compiled program crashes on SMP machine
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-06-07 15:26 UTC by Peter Klotz
Modified: 2007-04-18 16:43 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-02 20:52:53 UTC
Embargoed:


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

Description Peter Klotz 2002-06-07 15:26:49 UTC
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:
Always

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 ()
   from
/home/pklotz/devel/build/zthread/ZThread-2.1.6-gcc296/src/.libs/libZThread-2.1.so.6
#8  0x4005681e in _dispatch ()
   from
/home/pklotz/devel/build/zthread/ZThread-2.1.6-gcc296/src/.libs/libZThread-2.1.so.6
#9  0x40219f87 in pthread_start_thread (arg=0xbe1ffc00) at manager.c:284

Comment 1 Peter Klotz 2002-06-07 15:28:21 UTC
Created attachment 60024 [details]
program and shell script to compile it

Comment 2 Ken Snider 2003-11-26 22:01:13 UTC
This problem is still happening - also in the stream and stringstream
classes.

Is gcc2.96 not thread-safe?

Comment 3 Richard Henderson 2004-10-02 20:52:53 UTC
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.