From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.6) Gecko/20050405 Firefox/1.0 (Ubuntu package 1.0.2) Description of problem: in NPTL, pthread_self may be incorrect after two forks Version-Release number of selected component (if applicable): glibc-2.3.5-10 How reproducible: Always Steps to Reproduce: 1. get a C file which I'll attach 2. compile it and run 3. find that pthread_kill(pthread_self(), SIGPIPE) returns ESRCH Actual Results: I see following output of the program: 1st thread b7e8ebb0, second b7e8ebb0 kill returned 3 pthread_join returned 0 (Note that kill returned 3!) Expected Results: I expect the same output as it is with only one fork(): 1st thread b7e8ebb0, second b7e8ebb0 kill returned 0 pthread_join returned 0 Additional info:
Created attachment 119583 [details] test case mentioned in the bug description
This testcase is invalid. http://www.opengroup.org/onlinepubs/009695399/functions/fork.html "If a multi-threaded process calls fork()," ... "the child process may only execute async-signal-safe operations until such time as one of the exec functions is called." http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03 None of pthread_create, pthread_self, printf, pthread_join or exit (implicit after return 0 from main) are async-signal-safe.