[Bug libstdc++/27641] libpthread.a core dump with STL

2006-05-18 Thread philippe dot thibault at umontreal dot ca


--- Comment #2 from philippe dot thibault at umontreal dot ca  2006-05-18 
13:00 ---
(In reply to comment #1)
 This works for me with glibc 2.3.6 so closing as invalid.
 

You tried compiling static or shared? I have glibc-2.3.6-3 installed on my
workstation and it works only if I compile with shared libs. Did it worked for
you when you compiled with static libraries?

Philippe Thibault


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27641



[Bug c++/27641] New: libpthread.a core dump with STL

2006-05-17 Thread philippe dot thibault at umontreal dot ca
The following code segfaults if compiled statically using libpthread.a from
Fedora Core 4 (2.6.16-1.2107_FC4) with gcc-4.0.2, but will run ok if
dynamically linked to libpthread.so.0. Here the code:

#include list
#include pthread.h

void* tf (void* tp)
{
  pthread_exit (0);
}

int main ()
{
  std::list int  l;
  l.push_back (11);

  pthread_t tid;
  pthread_create (tid, 0, tf, 0);
  pthread_detach (tid)
}

- Fails if compiled as: c++ -static thread.cc -o thread -lpthread
- Runs ok if compiled as: c++ thread.cc -o thread -pthread

Note that this code runs ok if I remove the 'push_back' line, whether static or
shared.

thanks for your help!

Philippe Thibault


-- 
   Summary: libpthread.a core dump with STL
   Product: gcc
   Version: 4.0.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: philippe dot thibault at umontreal dot ca


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27641