From: karthik@cdotd.ernet.in
Subject: Thread IDs
Date: 1999/10/07 [thread overview]
Message-ID: <7ti733$ler$1@nnrp1.deja.com> (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.
next reply other threads:[~1999-10-07 4:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-10-07 4:00 karthik [this message]
1999-10-11 4:00 ` Thread IDs Jeff Denham
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox