[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SIG32 with Linux and pthreads
From: |
D. R. Evans |
Subject: |
SIG32 with Linux and pthreads |
Date: |
Thu, 24 May 2001 13:17:26 -0600 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This is the kind of question that looks like it should be a FAQ, but a
review of the archives didn't help find an answer :-( This probably means
I'm doing something fundamentally wrong, I suppose
Running Mandrake 7.2, gdb 5.0.
The big question is: am I supposed to be able to debug multi-threaded
programs with the above system?
The archives sort-of indicate that I should be fine, but I am finding it to
be impossible. A program that runs properly when merely executed is
undebugable under gdb because I get a couple of SIG32 messages the first
couple of times through a thread-creation loop, and then the program aborts
the third time through :-(
Paring everything down I get to the following tiny program:
... header includes removed
void* dummy(void* vp)
{ cout << "Inside dummy" << endl;
}
void main(void)
for (int n = 0; n < 10; n++)
{ pthread_t d;
const int status = pthread_create(&d, NULL, dummy, NULL);
cout << "status: " << status << endl;
}
- -----
When I execute this under GDB I see:
Starting program: /home/n7dr/test
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
Program received signal SIG32, Real-time event 32.
0x400c017e in sigsuspend () from /lib/libc.so.6
(gdb) Inside dummy
Nothing else appears on the screen, and gdb seems to be waiting for input.
The executable seems to be stopped somewhere inside a signal handler.
How do I force the program to continue without stopping because of a signal
every time I execute pthread_create()?
For reasons that I don't yet understand, the actual code (which of course
is more complicated than the above) only gets a SIG32 the first two times
through pthread_create(); the third time an ABORT signal is sent, so the
program dies. The above program seems to generate the SIG32 only (i.e., it
never generates an ABORT signal). But I figured that I'd start out with
asking only the easier question. Then I'll move on to trying to figure out
why the third time is different in the real code :-)
Doc Evans
PS "info threads" produces no output. Ever.
-----BEGIN PGP SIGNATURE-----
Version: PGP 6.0.2 -- QDPGP 2.60
Comment: Key obtainable from servers: ID 0x362912B8
iQA/AwUBOw1eRWnXrLw2KRK4EQIQLQCg8nLBDeTrMZ0qp37PKgF5REJKzrAAoIzU
+FSGJUwy6FRleKsT6KPQbwsI
=i9HD
-----END PGP SIGNATURE-----
----------------------------------------------------------
D.R. Evans N7DR / G4AMJ address@hidden
Two assassins and one very manipulative businessman:
"Reflexive Action" is now available.
See http://www.sff.net/people/N7DR/drevans.htp for details.
----------------------------------------------------------
- SIG32 with Linux and pthreads,
D. R. Evans <=