This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/12310] New: pthread_exit() in main thread segfaults when statically-linked


http://sourceware.org/bugzilla/show_bug.cgi?id=12310

           Summary: pthread_exit() in main thread segfaults when
                    statically-linked
           Product: glibc
           Version: 2.11
            Status: NEW
          Severity: minor
          Priority: P2
         Component: nptl
        AssignedTo: drepper.fsp@gmail.com
        ReportedBy: mrs@mythic-beasts.com


Calling pthread_exit() in the main thread segfaults in a
statically-linked executable.

$ cat pthread-exit-main.c 
#include <pthread.h>
int main() {
  pthread_exit(NULL);
  return 1;
}

$ gcc -Wall pthread-exit-main.c -o pthread-exit-main
$ ./pthread-exit-main 
$ echo $?
0
$ gcc -Wall pthread-exit-main.c -o pthread-exit-main -static -lpthread
$ ./pthread-exit-main 
Segmentation fault

$ gdb ./pthread-exit-main 
(gdb) run
Starting program: /home/mseaborn/test/pthread-exit-main 

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()

This was with glibc 2.11.1 on Ubuntu Lucid.  I have also seen this
with glibc 2.9.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]