Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Thread IDs
@ 1999-10-07  4:00 karthik
  1999-10-11  4:00 ` Jeff Denham
  0 siblings, 1 reply; 2+ messages in thread
From: karthik @ 1999-10-07  4:00 UTC (permalink / raw)


Hi,

  I've written a C++ program which contains 5 threads. I am using g++
(version 2.95.1). When I execute the program I got 'Memory fault(core
dumped). Since gdb does not support multithreaded program debuggingI am
not able to debug it. Then I saw that in the header of the core file
there is member variable called 'tid' which denotes the 'Thread causing
fault'. This can be found in /usr/include/sys/core.h in the structure
'core_filehdr'. Then I used

     pthread_getsequence_np(pthread_self())

in all my threads to print their identities. The identities printed by
this statement was always between 1 and 5 (both inclusive). But the
value in the structure member 'tid' in the header of the core file was
not consistent. It was either 11, or 9 or 3. I used 'od -x' to dump the
contents of the core file. When I tried using 'odump' I got something
like

      Bad object file core

There is another member in the structure 'core_filehdr' called
'nthreads' which had the correct number of threads always. The member
'signo' (Signal) always contained 11. (must be SIGSEGV)

I need to know the following

  1. Why is the value in 'tid' different from the value returned by
pthread_getsequence_np()? Is there any diff between the two?

  2. Is there any way to interpret the core file and find out the
location where it dumps core. In HP-UX, I start the debugger and pass
the name of the core file as a extra parameter. It automatically reaches
the location when the core dump occured. I tried the same ploy using
dxladebug. It did a $load and stopped. Didn't proceed ahead.

Can anybody help?



Sent via Deja.com http://www.deja.com/
Before you buy.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-10-11  4:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-10-07  4:00 Thread IDs karthik
1999-10-11  4:00 ` Jeff Denham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox