From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,e162e642f571aa0,start X-Google-Attributes: gidfee84,public From: karthik@cdotd.ernet.in Subject: Thread IDs Date: 1999/10/07 Message-ID: <7ti733$ler$1@nnrp1.deja.com>#1/1 X-Deja-AN: 533876766 X-Http-Proxy: 1.0 x30.deja.com:80 (Squid/1.1.22) for client 196.1.110.119 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Thu Oct 07 13:27:13 1999 GMT X-MyDeja-Info: XMYDJUIDd_kk Newsgroups: comp.unix.osf.osf1 X-Http-User-Agent: Mozilla/3.02Gold (X11; I; HP-UX B.10.20 9000/715) 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.