public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: buhr@stat.wisc.edu (Kevin Buhr)
To: Peter Berger <peterb@telerama.com>
Cc: linux-kernel@vger.kernel.org, "Petr Vandrovec" <VANDROVE@vc.cvut.cz>
Subject: Re: Pthreads, linux, gdb, oh my! (fwd)
Date: 09 Dec 2000 00:34:06 -0600	[thread overview]
Message-ID: <vbasnny3xy9.fsf@mozart.stat.wisc.edu> (raw)
In-Reply-To: <Pine.BSI.4.02.10012081150130.17198-100000@frogger.telerama.com>
In-Reply-To: Peter Berger's message of "Fri, 8 Dec 2000 11:53:07 -0500 (EST)"

Peter Berger <peterb@telerama.com> writes:
> 
> Hi.  I have the following tiny test program which fails dramatically,
> using pthreads, in a number of fascinating ways on various version of
> linux, using various versions of glibc, under various (current) versions
> of GDB.

It looks like a GDB bug.  GDB contains code to recognize when the
"pthreads" shared library has been loaded.  When this happens, it sets
itself up to properly handle threads (including setting up correct
SIG32 signal handling).  If you trick GDB into thinking "pthreads"
hasn't been loaded and set the SIG32 stuff up yourself, like so:

   buhr@saurus:~/src$ gdb thread-test
   GNU gdb 19990928
   Copyright 1998 Free Software Foundation, Inc.
   GDB is free software, covered by the GNU General Public License, and you are
   welcome to change it and/or distribute copies of it under certain conditions.
   Type "show copying" to see the conditions.
   There is absolutely no warranty for GDB.  Type "show warranty" for details.
   This GDB was configured as "i686-pc-linux-gnu"...
   (gdb) set auto-solib-add 0
   (gdb) handle SIG32 nostop noprint pass
   Signal        Stop      Print   Pass to program Description
   SIG32         No        No      Yes             Real-time event 32
   (gdb) run

then your program works fine.  Ergo, this is strong evidence that
GDB's thread handling is broken.  Presumably, it's simply not reaping
threads when they exit.

I don't know if Petr just happened to run his GDB 5.0 with "set
auto-solib-add 0" in his ".gdbinit" (a rather necessary precaution if
you're hacking on, say, Mozilla) and didn't see any problem for that
reason, or if some aspect of his configuration has fixed the problem.
Alternatively, maybe Petr is using a GDB that doesn't actually support
threads---if so, he'd *have* to set the SIG32 stuff up manually, and
he wouldn't notice any problem.

Kevin <buhr@stat.wisc.edu>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  parent reply	other threads:[~2000-12-09  7:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-08 16:53 Pthreads, linux, gdb, oh my! (fwd) Peter Berger
2000-12-08 17:18 ` Alan Cox
2000-12-08 19:43   ` Peter Berger
2000-12-09  0:02     ` Alan Cox
2000-12-09  6:34 ` Kevin Buhr [this message]
2000-12-09 15:15   ` Peter Berger
     [not found] <Pine.BSI.4.02.10012081708350.130-100000@frogger.telerama.c om>
2000-12-08 21:21 ` Petr Vandrovec
2000-12-08 22:15   ` Peter Berger
2000-12-08 22:31   ` David Relson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vbasnny3xy9.fsf@mozart.stat.wisc.edu \
    --to=buhr@stat.wisc.edu \
    --cc=VANDROVE@vc.cvut.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterb@telerama.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox