This is the mail archive of the libc-alpha@sources.redhat.com 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 in linuxthreads


Hi,

I've found a weird problem in glibc-2.2.5 linuxthreads. When I get out of a
thread one of two, the new thread get's defuct and the proccess never ends,
or it segfaults.

The most weird is that it depends on the kernel, and also when I run the
test trought gdb there is no problem.

Here is the test:

#include <pthread.h>

void *test(void *arg) {
	puts("Thread2");
	return 0;
}

int main() {
	pthread_t tt;
	puts("Before Thread2");
	pthread_create(&tt,NULL,test,NULL);
	puts("After Thread2");
	return 0;
}

The output:

1:src# ./test
Before Thread2
After Thread2
Thread2

This time it just kept waiting:

 8957 vc/1     00:00:00 test
 8958 ?        00:00:00 test <defunct>

I run it again:

1:src# ./test
Before Thread2
After Thread2

and again:

1:src# ./test
Before Thread2
Thread2
Segmentation fault

now gdb ./test:

Starting program: /usr/src/./test
(no debugging symbols found)...[New Thread 1024 (LWP 9168)]
Before Thread2
[New Thread 2049 (LWP 9169)]
[New Thread 1026 (LWP 9170)]
Thread2
After Thread2

Program exited normally.

Now, if I return with exit(0) everything works fine.

I tried to compile it with my default CFLAGS, with "-O2 march=i686",
without CFLAGS, without --enable-kernel and make check keeps failing on the
linuxthreads tests.

This is how I compile it:
../glibc-2.2.5/configure \
	--prefix=/usr \
	--enable-add-ons --libexecdir=/usr/bin \
	--enable-omitfp

I use gcc-3.0.3, but I know people that are using it too and don't have
this problem, my best guess is that a system with glibc-2.2.5 doesn't like
to compile glibc again, but I'm lost on this one.

Any ideas?			

-- 
Felipe Contreras


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