Hi,

This is a known problem with Mandrake 7.2: See the message below I sent two
months ago to bug-gdb.

I don't know whether upgrading to Mandrake 8.0 is an option for you, but it
indeed fixes this problem. Note that that config will not be able to debug
a program with more than 32 threads... For that you need a recent GDB
straight from CVS...

Good luck!

Bart



Bart Durinck
03/16/2001 10:59 AM

To:   German Gomez Garcia <[EMAIL PROTECTED]>
cc:   [EMAIL PROTECTED]
Subject:  Re: Problems with glibc-2.2.2 and threads (realtime signal)
      (Document link: Database 'Bart Durinck', View '($Sent)')


Hi!

I think I found some info that might explain your problem. It could well be
that it's not GDB's fault, but some system libraries being stripped.

Mandrake Linux 7.2 is known to have this problem. Bug-report 1763 "GDB
cannot debug programs that use shared libraries or threads" explains (see
https://qa.mandrakesoft.com for more info). If /lib/libpthread.so
(belonging to the glibc package) is stripped, GDB cannot hook into thread
events, and you get spurious real-time SIG32 events. Rings a bell, doesn't
it?!

Use 'file /lib/libpthread*' to check. If it mentions 'stripped', you have
this problem.

Solving it, is probably tricky... Messing with glibc... What distro are you
using? According to the changelog of glibc-2.2.2 for  Mandrake Cooker
(which will be Mandrake 8.0 soon), these problems are fixed since Feb 21.

Good luck!

Bart





"D. R. Evans" <[EMAIL PROTECTED]>@gnu.org on 05/24/2001 09:17:26 PM

Please respond to [EMAIL PROTECTED]

Sent by:  [EMAIL PROTECTED]


To:   [EMAIL PROTECTED]
cc:

Subject:  SIG32 with Linux and pthreads


-----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                      [EMAIL PROTECTED]

Two assassins and one very manipulative businessman:
   "Reflexive Action" is now available.
See http://www.sff.net/people/N7DR/drevans.htp for details.
----------------------------------------------------------

_______________________________________________
Bug-gdb mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gdb




_______________________________________________
Bug-gdb mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gdb

Reply via email to