Bug#212697: static linking with lpthread and system call causes crash
Description: a system function call within a pthread (when statically
linked) ends the program but leaves the processus zombified
The same problem does not occur on unstable systems (with libc6 2.3.2-4)
Here is a test program that demonstrates the problem, it consists of a
main function which calls ThreadFunction which itself calls system(const
/* test.c */
void* ThreadFunction(void* arg)
int main(int argc, char** argv)
pthread_create(&thread, NULL, ThreadFunction, NULL);
/* END test.c
example of dynamic linking:
# gcc test.c -lpthread -o test
# ldd test
libpthread.so.0 => /lib/lipthread.so (0x40017000)
libc.so.6 => /lib/libc.so.6 (0x4002b000)
/lib/ld-linux.so.2 => (0x40000000)
... (output of ls -l)
// CORRECT BEHAVIOUR
example of static linkinkg:
# gcc test.c -static -lpthread -o test
# ldd test
not a dynamic executable
# ps aux | grep test
root 20027 0.0 0.1 2548 160 pts/1 S 13:26 ./test
root 20028 0.0 0.1 2548 160 pts/1 S 13:26 ./test
// after launching ./test, Thread Started is printed out, but the
command prompt shows up immediately and ps sees the processus still running.
if i do this on a machine running 2.3.2-4 or gentoo using 2.3.2 as
well, the problem does not occur...
i used diiferent compilers with no noticeable change:
# dpkg -l gcc*
ii gcc-2.95 2.95.4-7
ii gcc-3.0 3.0.4-7
is this a bug?
is this backportable from the 2.3 series?
oh by the way, uname -a shows 2.4.18-586tsc but fails as well on 2.4.21
(homemade) and 2.4.22 (gentoo).
Severity: unknown (annoying to me)
have a nice day,