[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#40828: program using pthreads never reaches main()



Package: libc6
Version: 2.1.1-12
Severity: important

I have a program I wrote, called tplay (available at
http://www.pyro.net/~crayc/), which uses pthreads for I/O
concurrency.

It worked fine on glibc 2.0, but after I upgraded to 2.1, it always exited
with the message 'pthread_create() failed'. After trying to use it 2 or 3
times I immediately tried recompiling the program, figuring that would fix
it, so I don't have a binary of the program compiled for glibc 2.0 anymore
(and therefore I cannot figure out why pthread_create() failed without
reverting to 2.0).

After recompiling, when I run the program, it just sits there without
doing anything. I put printf("got here\n"); as the first line in main()
and it never got printed. I used gdb on it, put a breakpoint on main(),
and it apparently never reaches main because it just sits there when I run
it.

I tried a simple hello world program:

#include <stdio.h>
int main() { printf("Hello, world\n"); }

compiled it with gcc -D_REENTRANT test.c -o test -lpthread and it worked
fine.

I can only wonder what is wrong here.. I can't understand why main() would
not even be reached, depending on what the rest of the program contains.


Reply to: