Subj : Re: pthreads (linux) questions To : comp.programming.threads From : jacob navia Date : Fri Aug 19 2005 03:14 pm Joe Seigh wrote: > jacob navia wrote: > >> Joe Seigh wrote: >> >> > Threads don't have pids any more. What non standard non portable >> >>> thing are you trying to do? >>> >> >> I want to print the stack of an application when it crashes. >> >> I do not care about portability I just want it to run >> under linux 64 bit. This programs are never portable anyway. >> >> Apparently there is no documentation isn't it? >> >> Again: >> Under 32 bits I used those symbols in the pthread library >> to get info about the running threads. >> I would attach to each thread in turn, and using ptrace I would read >> their descriptors, what allowed me to print the state of each >> thread at the moment of the crash. >> >> How do I do that under 64 bits? >> > gdb on the core file should work. PLeeeeeeeeeeze. I do NOT WANT GDB. Imagine: My program crashes, then in the signal handler I call gdb. Then... I wait till my customer calls: YOUR #!@@@@ PROGRAM DOESN'T ANSWER ANY MORE! I answer him: Yes of course. Just keep cool. You should use gdb to debug it Just type "backtrace", and mail me the output. :-) Or you could look into the > /proc//tasks/ > directory to get the kernel thread ids. Ahh, VERY interesting. Actually the first piece of useful info I get. Maybe you would be so kind to tell me if there is any documentation for /proc//tasks? (What should be in there, format of the info, etc) Thanks for that piece of info, and thanks in advance for any documentation. If there was a document that would explain this stuff it would spare me the time of asking and you the time of answering... jacob .