Pthreads, linux, gdb, oh my! (fwd)
Quoted 7 lines · Peter Berger
Quoted 1 line
tg->createdmay be out of date...
Quoted 1 line
You can create it, count it, then up
tg->createdout of orderWell, you're right, but this is picking lint. Making this change (see
http://peterb.telerama.com/thread-test.c for the corrected version) certainly doesn't make the problem go away (nor would I expect it to).
Can you tell me again (private, probably), which problem do you have?
After I fixed source to get it to compile with -W -Wall -Werror (missing includes, wrong parameters to main...), and compiling with -D_REENTRANT, I received nice ./a.out, which runs under 2.4.0-test12-pre7, glibc-2.2 both standalone and in gdb (gdb 5.0) (all tools except kernel as of today woody). In gdb I had to do
'handle SIG32 noprint nostop pass', as by default gdb stops on SIG32 arrival...
Now it runs and runs and runs... I do not see any unreaped childrens. After thread 100000 it finished.
Best regards,
Petr Vandrovec [email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
Petr,
Thanks for testing this and finding a working counterexample! I am still professionally interested to know if the difference is that you are running a 2.4 kernel, or the glibc. Anyone running a 2.2 kernel with glibc 2.2 want to drop me a line?
-Peter
(gdb) run
...
[New Thread 25452]threads_test: thread #210 created...done.
[New Thread 25453]threads_test: thread #211 created...done.
[New Thread 25454]threads_test: thread #212 created...done.
Cannot access memory at address 0xa4dffe8c
(gdb)
[3]+ Stopped gdb ./thread
[peterb@deedee src]$ ps axuw
bash: fork: Resource temporarily unavailable
[peterb@deedee src]$
[kill a process]
[peterb@deedee src]$ ps axuw
peterb 25679 0.0 0.0 0 0 ttya0 Z 17:12 0:00 [thread
<defunct>]
peterb 25680 0.0 0.0 0 0 ttya0 Z 17:12 0:00 [thread
<defunct>]
peterb 25681 0.0 0.0 0 0 ttya0 Z 17:12 0:00 [thread
<defunct>]
peterb 25682 0.0 0.0 0 0 ttya0 Z 17:12 0:00 [thread
<defunct>]
peterb 25683 0.0 0.0 0 0 ttya0 Z 17:12 0:00 [thread
<defunct>]
peterb 25684 0.0 0.0 0 0 ttya0 Z 17:12 0:00 [thread
<defunct>]
....several hundred lines later...
peterb 25889 0.0 0.0 0 0 ttya0 Z 17:12 0:00 [thread
<defunct>]
peterb 25890 0.0 0.0 0 0 ttya0 Z 17:12 0:00 [thread
<defunct>]
peterb 25891 0.0 0.0 0 0 ttya0 Z 17:12 0:00 [thread
<defunct>]
peterb 25892 0.0 0.0 0 0 ttya0 Z 17:12 0:00 [thread
<defunct>]
peterb 25893 0.0 0.2 2704 1060 ttya0 R 17:12 0:00 ps axuw
[2]- Done netscape http://www.slashdot.org (wd:/home/peterb/p4base/tests/common)
(wd now: ~/src)
[
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/