NetBSD Problem Report #30756

From wiz@dmath5.geometrie.tuwien.ac.at  Fri Jul 15 22:21:35 2005
Return-Path: <wiz@dmath5.geometrie.tuwien.ac.at>
Received: from dmath5.geometrie.tuwien.ac.at (dmath5.geometrie.tuwien.ac.at [128.130.42.105])
	by narn.netbsd.org (Postfix) with ESMTP id 19E1463B11A
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 15 Jul 2005 22:21:35 +0000 (UTC)
Message-Id: <20050715222133.1C8B22951C@dmath5.geometrie.tuwien.ac.at>
Date: Sat, 16 Jul 2005 00:21:33 +0200 (CEST)
From: Thomas Klausner <wiz@NetBSD.org>
Reply-To: Thomas Klausner <wiz@NetBSD.org>
To: gnats-bugs@netbsd.org
Subject: gdb not usable for live debugging of threaded programs
X-Send-Pr-Version: 3.95

>Number:         30756
>Category:       bin
>Synopsis:       gdb not usable for live debugging of threaded programs
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    skrll
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 15 22:22:00 +0000 2005
>Closed-Date:    
>Last-Modified:  Fri Oct 05 08:59:33 +0000 2012
>Originator:     Thomas Klausner
>Release:        NetBSD 3.99.7
>Organization:

>Environment:


Architecture: i386
Machine: i386
>Description:
Debugging threaded programs currently looks like this:
 # gdb /usr/pkg/bin/amarokapp
 GNU gdb 5.3nb1
 Copyright 2002 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 "i386--netbsdelf"...(no debugging symbols found)...
 (gdb) r
 Starting program: /usr/pkg/bin/amarokapp
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...(no debugging symbols found)...
 (no debugging symbols found)...thread_resume_suspend_cb: td_thr_suspend(0xa3bc2c0): generic error.
 [Switching to LWP 1]
 Stopped due to shared library event
 (gdb) c
 Continuing.
 thread_resume_suspend_cb: td_thr_suspend(0xa3bc2c0): generic error.
 0xbdbf7444 in _rtld_debug_state () from /usr/libexec/ld.elf_so
 (gdb) c
 Continuing.
 thread_resume_suspend_cb: td_thr_suspend(0xa3bc2c0): generic error.
 0xbdbf7444 in _rtld_debug_state () from /usr/libexec/ld.elf_so
 (gdb)

In the thread starting at
	http://mail-index.netbsd.org/current-users/2005/06/23/0017.html
Nathan J. Williams suggests reverting 1.15 of
src/gnu/dist/gdb/gdb/nbsd-thread.c
which fixes this particular problem.

However, 1.15 was a fix for another real problem, and reverting it
is not a good solution. So we need another one :)
>How-To-Repeat:
See above.
>Fix:
Sorry, above my head.

>Release-Note:

>Audit-Trail:
From: Rui Paulo <rpaulo@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/30756
Date: Sat, 13 Aug 2005 16:37:22 +0100

 BTW, you can attach to a running threadead application and it works fine.
 The same applies for core files.

 Related discussion on tech-userlevel@:
 http://mail-index.netbsd.org/tech-userlevel/2005/07/25/0000.html
 http://mail-index.netbsd.org/tech-userlevel/2005/07/25/0001.html
 http://mail-index.netbsd.org/tech-userlevel/2005/07/25/0002.html
 http://mail-index.netbsd.org/tech-userlevel/2005/07/25/0003.html

 		-- Rui Paulo

From: Matthias Drochner <M.Drochner@fz-juelich.de>
To: gnats-bugs@netbsd.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: bin/30756 
Date: Mon, 15 Aug 2005 19:11:04 +0200

 This is a multipart MIME message.

 --==_Exmh_53492548679310
 Content-Type: text/plain; charset=us-ascii


 rpaulo@NetBSD.org said:
 > thread_resume_suspend_cb: td_thr_suspend(0xa3bc2c0): generic error

 The appended patch helps for this problem.
 It seems that the thread debugging stuff needs some cleanup...

 best regards
 Matthias



 --==_Exmh_53492548679310
 Content-Type: text/plain ; name="pthgdb.txt"; charset=us-ascii
 Content-Description: pthgdb.txt
 Content-Disposition: attachment; filename="pthgdb.txt"

 --- nbsd-thread.c.~1.15.~	Wed Oct 13 14:37:17 2004
 +++ nbsd-thread.c	Mon Aug 15 19:00:32 2005
 @@ -222,7 +222,7 @@ thread_resume_suspend_cb (td_thread_t *t
    if (td_thr_info (th, &ti) != 0)
        return -1;

 -  if ((ti.thread_id != GET_THREAD (*pt)) &&
 +  if ((ti.thread_id != GET_THREAD (*pt) + 1) &&
        (ti.thread_type == TD_TYPE_USER) &&
        (ti.thread_state != TD_STATE_SUSPENDED) &&
        (ti.thread_state != TD_STATE_ZOMBIE))

 --==_Exmh_53492548679310--


From: "Nathan J. Williams" <nathanw@wasabisystems.com>
To: M.Drochner@fz-juelich.de
Cc: gnats-bugs@NetBSD.org, gnats-admin@NetBSD.org,
	netbsd-bugs@NetBSD.org
Subject: Re: bin/30756
Date: 16 Aug 2005 18:07:15 -0400

 Matthias Drochner <M.Drochner@fz-juelich.de> writes:

 > rpaulo@NetBSD.org said:
 > > thread_resume_suspend_cb: td_thr_suspend(0xa3bc2c0): generic error
 > 
 > The appended patch helps for this problem.
 > It seems that the thread debugging stuff needs some cleanup...

 That happens to work but it's not right at all. nbsd_thread_resume()
 is being called with a ptid argument of {<pid>, 1, 0}; that is, the
 upper levels are trying to single-step an LWP rather than a thread (we
 don't currently have a mechanism for that in the ptrace
 interface). This causes thread_resume_suspend_cb() to try to suspend
 the only thread in the program... which is a bad enough idea, but it
 happens early enough that the idle queue isn't even set up, and so
 there's no thread to replace the suspended thread in the register
 set. This causes td_thr_suspend() to bail out with the error seen
 above.

 However, this does point out a partial solution, which I've gone ahead
 and committed:

 Index: nbsd-thread.c
 ===================================================================
 RCS file: /cvsroot/src/gnu/dist/gdb/gdb/nbsd-thread.c,v
 retrieving revision 1.15
 diff -p -u -r1.15 nbsd-thread.c
 --- nbsd-thread.c	12 Oct 2004 22:16:34 -0000	1.15
 +++ nbsd-thread.c	16 Aug 2005 22:02:38 -0000
 @@ -262,11 +262,14 @@ static void
  nbsd_thread_resume (ptid_t ptid, int step, enum target_signal signo)
  {

 -  /* If a particular ptid is specified, then gdb wants to resume or
 +  /* If a particular thread is specified, then gdb wants to resume or
       step just that thread. If it isn't on a processor, then it needs
 -     to be put on one, and nothing else can be on the runnable
 -     list. */
 -  if (GET_PID (ptid) != -1)
 +     to be put on one, and nothing else can be on the runnable list.
 +     XXX If GDB asks us to step a LWP rather than a thread, there
 +     isn't anything we can do but pass it down to the ptrace call;
 +     given the flexibility of the LWP-to-thread mapping, this might or
 +     might not accomplish what the user wanted. */
 +  if (GET_PID (ptid) != -1 && IS_THREAD (ptid))
      {
        int val;



 This seems to get things limping along again.

         - Nathan

From: Rui Paulo <rpaulo@NetBSD.org>
To: "Nathan J. Williams" <nathanw@wasabisystems.com>
Cc: M.Drochner@fz-juelich.de, gnats-bugs@NetBSD.org,
	gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org
Subject: Re: bin/30756
Date: Wed, 17 Aug 2005 01:55:10 +0100

 --+QahgC5+KEYLbs62
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable

 On 2005.08.16 18:07:15 +0000, Nathan J. Williams wrote:
 | That happens to work but it's not right at all. nbsd_thread_resume()
 | is being called with a ptid argument of {<pid>, 1, 0}; that is, the
 | upper levels are trying to single-step an LWP rather than a thread (we
 | don't currently have a mechanism for that in the ptrace
 | interface). This causes thread_resume_suspend_cb() to try to suspend
 | the only thread in the program... which is a bad enough idea, but it
 | happens early enough that the idle queue isn't even set up, and so
 | there's no thread to replace the suspended thread in the register
 | set. This causes td_thr_suspend() to bail out with the error seen
 | above.
 |=20
 | However, this does point out a partial solution, which I've gone ahead
 | and committed:

 I've tested it and while it works for simple cases, it doesn't work for
 debugging large programs, like jvm.

 proton> ./gdb -q ~/java/jdk/bin/java_g                      [usr.bin/gdb53/=
 gdb]
 (gdb) run -jar ~/java/jdk/demo/jfc/Java2D/Java2Demo.jar
 Starting program: /home/rpaulo/java/jdk-1_5_0/control/build/bsd-i586/bin/ja=
 va_g -jar ~/java/jdk/demo/jfc/Java2D/Java2Demo.jar

 Program received signal SIGTRAP, Trace/breakpoint trap.
 [Switching to LWP 1]
 0xbdbf5530 in .rtld_start () from /usr/libexec/ld.elf_so
 (gdb)=20

 If you need more information, please tell me.
 I don't know if you are already aware of this since you pointed out that
 it is a "partial solution".

 		-- Rui Paulo

 --+QahgC5+KEYLbs62
 Content-Type: application/pgp-signature
 Content-Disposition: inline

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.1 (NetBSD)

 iD8DBQFDAoruZPqyxs9FH4QRAoumAJ9oGuJHLtqSYuKWtFcuRHaWxsJa/gCfQ53p
 EJJNUeA/PvH+fh+0+ycMtHI=
 =iz5l
 -----END PGP SIGNATURE-----

 --+QahgC5+KEYLbs62--

From: "Paul Koning" <Paul_Koning@Dell.com>
To: <gnats-bugs@NetBSD.org>
Cc: <tech-kern@NetBSD.org>
Subject: RE: bin/30756: gdb not usable for live debugging of threaded programs
Date: Mon, 19 Apr 2010 15:02:03 -0400

 This is a multi-part message in MIME format.

 ------_=_NextPart_001_01CADFF2.CC0C5CAC
 Content-Type: text/plain;
 	charset="us-ascii"
 Content-Transfer-Encoding: quoted-printable

 The fix for kern/43128 adds the missing kernel bits for GDB to support
 threaded program debugging.  The other part needed is changes to GDB
 itself.

 Attached is a patch that does this, tested on i386 against the GDB 6.5
 sources that are in NetBSD 5.0.  I intend to submit this to the GDB
 project as well but was asked to provide a patch against the GDB rev
 that is currently in NetBSD.

 There is a patched mipsnbsd-nat.c as well as common and i386 specific
 files, but I did not make the build file changes for that so that file
 is untested.  I also did not look at any other platforms.  The changes
 should be straightforward using the mips and i386 examples as the
 starting point, but since I have no way to test them I did not want to
 attempt changes for any other targets.

 Comments appreciated.

 	paul


 ------_=_NextPart_001_01CADFF2.CC0C5CAC
 Content-Type: application/octet-stream;
 	name="gdbthreads-650.diff"
 Content-Transfer-Encoding: base64
 Content-Description: gdbthreads-650.diff
 Content-Disposition: attachment;
 	filename="gdbthreads-650.diff"

 LS0tIC4vZ251L2Rpc3QvZ2RiNi9nZGIvY29uZmlnL2kzODYvbmJzZGVsZi5taC5vcmlnCTIwMDYt
 MTEtMjUgMTE6Mzg6NTEuMDAwMDAwMDAwIC0wNTAwCisrKyAuL2dudS9kaXN0L2dkYjYvZ2RiL2Nv
 bmZpZy9pMzg2L25ic2RlbGYubWgJMjAxMC0wNC0xOSAxMjowNzoyMC4wMDAwMDAwMDAgLTA0MDAK
 QEAgLTEsNiArMSw2IEBACiAjIEhvc3Q6IE5ldEJTRC9pMzg2IEVMRgogTkFUREVQRklMRVM9IGZv
 cmstY2hpbGQubyBpbmYtcHRyYWNlLm8gXAotCW5ic2QtbmF0Lm8gaTM4NmJzZC1uYXQubyBpMzg2
 bmJzZC1uYXQubyBic2Qta3ZtLm8KKwluYnNkLW5hdC5vIGkzODZic2QtbmF0Lm8gaTM4Nm5ic2Qt
 bmF0Lm8gYnNkLWt2bS5vIG5ic2QtdGhyZWFkLm8KIE5BVF9GSUxFPSBzb2xpYi5oCiAKIExPQURM
 SUJFUz0gLWxrdm0KLS0tIC4vZ251L2Rpc3QvZ2RiNi9nZGIvY29uZmlnL21pcHMvbmJzZC5taC5v
 c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By
 aW50Lm8gYy10eXBlcHJpbnQubyBmLXR5cGVwcmludC5vIG0yLXR5cGVwcmludC5vICBhZGEtdmFs
 cHJpbnQubyBjLXZhbHByaW50Lm8gY3AtdmFscHJpbnQubyBmLXZhbHByaW50Lm8gbTItdmFscHJp
 bnQubyAgbmxtcmVhZC5vIHNlcmlhbC5vIG1kZWJ1Z3JlYWQubyB0b3AubyB1dGlscy5vICB1aS1m
 aWxlLm8gIHVzZXItcmVncy5vICBmcmFtZS5vIGZyYW1lLXVud2luZC5vIGRvdWJsZXN0Lm8gIGZy
 YW1lLWJhc2UubyAgZ251LXYyLWFiaS5vIGdudS12My1hYmkubyBocGFjYy1hYmkubyBjcC1hYmku
 byBjcC1zdXBwb3J0Lm8gIGNwLW5hbWVzcGFjZS5vICByZWdncm91cHMubyByZWdzZXQubyAgdHJh
 ZC1mcmFtZS5vICB0cmFtcC1mcmFtZS5vICBzb2xpYi5vIHNvbGliLW51bGwubyAgcHJvbG9ndWUt
 dmFsdWUubyBpbmZsb3cubyAgICBpbml0Lm8KIEdfU0lNX09CUz0K

 ------_=_NextPart_001_01CADFF2.CC0C5CAC--

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, 
	Thomas Klausner <wiz@NetBSD.org>
Cc: 
Subject: RE: bin/30756: gdb not usable for live debugging of threaded programs
Date: Mon, 19 Apr 2010 15:24:09 -0400

 On Apr 19,  7:05pm, Paul_Koning@Dell.com ("Paul Koning") wrote:
 -- Subject: RE: bin/30756: gdb not usable for live debugging of threaded prog

 |  The fix for kern/43128 adds the missing kernel bits for GDB to support
 |  threaded program debugging.  The other part needed is changes to GDB
 |  itself.
 |  
 |  Attached is a patch that does this, tested on i386 against the GDB 6.5
 |  sources that are in NetBSD 5.0.  I intend to submit this to the GDB
 |  project as well but was asked to provide a patch against the GDB rev
 |  that is currently in NetBSD.
 |  
 |  There is a patched mipsnbsd-nat.c as well as common and i386 specific
 |  files, but I did not make the build file changes for that so that file
 |  is untested.  I also did not look at any other platforms.  The changes
 |  should be straightforward using the mips and i386 examples as the
 |  starting point, but since I have no way to test them I did not want to
 |  attempt changes for any other targets.
 |  
 |  Comments appreciated.

 Looks good to me.

 christos

From: "Paul Koning" <Paul_Koning@Dell.com>
To: <gnats-bugs@NetBSD.org>
Cc: <tech-kern@NetBSD.org>,
	"Antti Kantee" <pooka@cs.hut.fi>
Subject: RE: bin/30756: gdb not usable for live debugging of threaded programs
Date: Thu, 22 Apr 2010 11:18:14 -0400

 This is a multi-part message in MIME format.

 ------_=_NextPart_001_01CAE22F.094CA314
 Content-Type: text/plain;
 	charset="us-ascii"
 Content-Transfer-Encoding: quoted-printable

 Antti pointed out a problem in the patch I originally submitted which
 causes gdb to go into a loop if the child process exits.  The attached
 updated patch corrects that problem.

 	paul


 ------_=_NextPart_001_01CAE22F.094CA314
 Content-Type: application/octet-stream;
 	name="gdbthreads-650a.diff"
 Content-Transfer-Encoding: base64
 Content-Description: gdbthreads-650a.diff
 Content-Disposition: attachment;
 	filename="gdbthreads-650a.diff"

 LS0tIC4vZ251L2Rpc3QvZ2RiNi9nZGIvY29uZmlnL2kzODYvbmJzZGVsZi5taC5vcmlnCTIwMDYt
 MTEtMjUgMTE6Mzg6NTEuMDAwMDAwMDAwIC0wNTAwCisrKyAuL2dudS9kaXN0L2dkYjYvZ2RiL2Nv
 bmZpZy9pMzg2L25ic2RlbGYubWgJMjAxMC0wNC0xOSAxMjowNzoyMC4wMDAwMDAwMDAgLTA0MDAK
 QEAgLTEsNiArMSw2IEBACiAjIEhvc3Q6IE5ldEJTRC9pMzg2IEVMRgogTkFUREVQRklMRVM9IGZv
 cmstY2hpbGQubyBpbmYtcHRyYWNlLm8gXAotCW5ic2QtbmF0Lm8gaTM4NmJzZC1uYXQubyBpMzg2
 bmJzZC1uYXQubyBic2Qta3ZtLm8KKwluYnNkLW5hdC5vIGkzODZic2QtbmF0Lm8gaTM4Nm5ic2Qt
 b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Jsb2MubyBkd2FyZjItZnJhbWUubyAgYWRhLWxhbmcubyBjLWxhbmcu
 byBmLWxhbmcubyBvYmpjLWxhbmcubyAgdWktb3V0Lm8gY2xpLW91dC5vICB2YXJvYmoubyB3cmFw
 cGVyLm8gIGp2LWxhbmcubyBqdi12YWxwcmludC5vIGp2LXR5cGVwcmludC5vICBtMi1sYW5nLm8g
 cC1sYW5nLm8gcC10eXBlcHJpbnQubyBwLXZhbHByaW50Lm8gIHNjbS1leHAubyBzY20tbGFuZy5v
 IHNjbS12YWxwcmludC5vICBzZW50aW5lbC1mcmFtZS5vICBjb21wbGFpbnRzLm8gdHlwZXByaW50
 Lm8gIGFkYS10eXBlcHJpbnQubyBjLXR5cGVwcmludC5vIGYtdHlwZXByaW50Lm8gbTItdHlwZXBy
 aW50Lm8gIGFkYS12YWxwcmludC5vIGMtdmFscHJpbnQubyBjcC12YWxwcmludC5vIGYtdmFscHJp
 bnQubyBtMi12YWxwcmludC5vICBubG1yZWFkLm8gc2VyaWFsLm8gbWRlYnVncmVhZC5vIHRvcC5v
 IHV0aWxzLm8gIHVpLWZpbGUubyAgdXNlci1yZWdzLm8gIGZyYW1lLm8gZnJhbWUtdW53aW5kLm8g
 ZG91Ymxlc3QubyAgZnJhbWUtYmFzZS5vICBnbnUtdjItYWJpLm8gZ251LXYzLWFiaS5vIGhwYWNj
 LWFiaS5vIGNwLWFiaS5vIGNwLXN1cHBvcnQubyAgY3AtbmFtZXNwYWNlLm8gIHJlZ2dyb3Vwcy5v
 IHJlZ3NldC5vICB0cmFkLWZyYW1lLm8gIHRyYW1wLWZyYW1lLm8gIHNvbGliLm8gc29saWItbnVs
 bC5vICBwcm9sb2d1ZS12YWx1ZS5vIGluZmxvdy5vICAgIGluaXQubwogR19TSU1fT0JTPQo=

 ------_=_NextPart_001_01CAE22F.094CA314--

Responsible-Changed-From-To: bin-bug-people->skrll
Responsible-Changed-By: skrll@NetBSD.org
Responsible-Changed-When: Thu, 22 Apr 2010 19:56:02 +0000
Responsible-Changed-Why:
I'll look to commit Paul's work


From: Antti Kantee <pooka@cs.hut.fi>
To: Paul Koning <Paul_Koning@Dell.com>
Cc: gnats-bugs@NetBSD.org, tech-kern@NetBSD.org
Subject: Re: bin/30756: gdb not usable for live debugging of threaded programs
Date: Fri, 23 Apr 2010 22:04:35 +0300

 On Thu Apr 22 2010 at 11:18:14 -0400, Paul Koning wrote:
 > Antti pointed out a problem in the patch I originally submitted which
 > causes gdb to go into a loop if the child process exits.  The attached
 > updated patch corrects that problem.

 Yup, your new patch seems to fix that.  Thanks again.

 Just one cosmetic issue now.  After finishing, gdb always says:
 Couldn't get registers: Operation not permitted.

From: Nick Hudson <nick.hudson@gmx.co.uk>
To: gnats-bugs@netbsd.org,
 pkoning@netbsd.org
Cc: gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org,
 Thomas Klausner <wiz@netbsd.org>
Subject: Re: bin/30756: gdb not usable for live debugging of threaded programs
Date: Fri, 4 Jun 2010 11:49:20 +0100

 --Boundary-00=_woNCMfd6ODsW23f
 Content-Type: text/plain;
   charset="iso-8859-1"
 Content-Transfer-Encoding: 7bit

 On Thursday 22 April 2010 16:20:04 Paul Koning wrote:
 >  Antti pointed out a problem in the patch I originally submitted which
 >  causes gdb to go into a loop if the child process exits.  The attached
 >  updated patch corrects that problem.

 This, unfortunately, still has cosmetic issues. See the attached log and the 
 "Couldn't get registers: Operation not permitted." at the end of the session

 Nick

 --Boundary-00=_woNCMfd6ODsW23f
 Content-Type: text/x-log;
   charset="iso-8859-1";
   name="gdb-attach.log"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="gdb-attach.log"

 (gdb) set debug nbsd-thread 1
 (gdb) attach 1049
 Attaching to process 1049
 NTW2: waiting for ptid -1,0, opt 0
 NTW2: waitpid errno is 0, pid 1049, status 117f
 NTUP: lwpinfo on 0 returns lwp 1, pl_event 0
 NTUP: adding first thread ptid 1049,1
 NTUP: lwpinfo on 1 returns lwp 0, pl_event 0
 NTUP: signalled thread lwpid is 0
 NTW2: waiting for ptid 1049,0, opt 1
 NTW2: waitpid errno is 0, pid 0, status 0
 NTW: no signalled thread
 NTW: returning ptid 1049,1
 NFIR: ptid 1049,1, regnum 8: 804865a
 Reading symbols from /home/nick/gdb/obj/gdb/testsuite/gdb.base/attach...done.
 NFIR: ptid 1049,1, regnum 8: 804865a
 Reading symbols from /usr/lib/libm.so.0...done.
 Loaded symbols for /usr/lib/libm.so.0
 Reading symbols from /usr/lib/libc.so.12...done.
 Loaded symbols for /usr/lib/libc.so.12
 Reading symbols from /usr/libexec/ld.elf_so...done.
 Loaded symbols for /usr/libexec/ld.elf_so
 [Switching to Thread 1]
 main () at ../../../src/gdb/testsuite/gdb.base/attach.c:17
 17            local_i++;
 (gdb) print should_exit
 $1 = 0
 (gdb) detach
 Detaching from program: /home/nick/gdb/obj/gdb/testsuite/gdb.base/attach, process 1049
 (gdb) attach 1049
 Attaching to program: /home/nick/gdb/obj/gdb/testsuite/gdb.base/attach, process 1049
 NTW2: waiting for ptid -1,0, opt 0
 NTW2: waitpid errno is 0, pid 1049, status 117f
 NTUP: lwpinfo on 0 returns lwp 1, pl_event 0
 NTUP: lwpinfo on 1 returns lwp 0, pl_event 0
 NTUP: signalled thread lwpid is 0
 NTW2: waiting for ptid 1049,0, opt 1
 NTW2: waitpid errno is 0, pid 0, status 117f
 NTW: no signalled thread
 NTW: returning ptid 1049,0
 NFIR: ptid 1049,0, regnum 8: 804865d
 Loaded symbols for /usr/lib/libm.so.0
 Loaded symbols for /usr/lib/libc.so.12
 Loaded symbols for /usr/libexec/ld.elf_so
 main () at ../../../src/gdb/testsuite/gdb.base/attach.c:15
 15        while (! should_exit)
 (gdb) set should_exit=1
 (gdb) tbreak 19
 Breakpoint 1 at 0x8048666: file ../../../src/gdb/testsuite/gdb.base/attach.c, line 19.
 (gdb) c
 Continuing.
 NTR: resuming ptid 1049,0, all threads, signal 0
 NTW2: waiting for ptid -1,0, opt 0
 NTW2: waitpid errno is 0, pid 1049, status 57f
 NTUP: lwpinfo on 0 returns lwp 1, pl_event 1
 NTUP: lwpinfo on 1 returns lwp 0, pl_event 0
 NTUP: signalled thread lwpid is 1
 NTW2: waiting for ptid 1049,0, opt 1
 NTW2: waitpid errno is 0, pid 0, status 57f
 NTW: Picking ptid 1049,1 out of 1
 NTW: returning ptid 1049,1
 NFIR: ptid 1049,1, regnum 8: 8048667
 NSIR: ptid 1049,1, regnum 8: 8048666
 [Switching to Thread 1]
 main () at ../../../src/gdb/testsuite/gdb.base/attach.c:19
 19        return 0;
 (gdb) c
 Continuing.
 NTR: resuming ptid 1049,1, all threads, signal 0
 NTW2: waiting for ptid -1,0, opt 0
 NTW2: waitpid errno is 0, pid 1049, status 0
 NTUP: signalled thread lwpid is 0
 NTW2: waiting for ptid 1049,0, opt 1
 NTW2: waitpid errno is 10, pid -1, status 0
 NTW: no signalled thread
 NTW: returning ptid 1049,1

 Program exited normally.
 Couldn't get registers: Operation not permitted.
 (gdb)

 --Boundary-00=_woNCMfd6ODsW23f--

From: "Paul Koning" <Paul_Koning@Dell.com>
To: "Nick Hudson" <nick.hudson@gmx.co.uk>,
	<gnats-bugs@netbsd.org>,
	<pkoning@netbsd.org>
Cc: <gnats-admin@netbsd.org>,
	<netbsd-bugs@netbsd.org>,
	"Thomas Klausner" <wiz@netbsd.org>
Subject: RE: bin/30756: gdb not usable for live debugging of threaded programs
Date: Fri, 4 Jun 2010 06:51:50 -0400

 Sorry for the delay, I'll take a look shortly.

 	paul

 > -----Original Message-----
 > From: Nick Hudson [mailto:nick.hudson@gmx.co.uk]
 > Sent: Friday, June 04, 2010 6:49 AM
 > To: gnats-bugs@netbsd.org; pkoning@netbsd.org
 > Cc: gnats-admin@netbsd.org; netbsd-bugs@netbsd.org; Thomas Klausner
 > Subject: Re: bin/30756: gdb not usable for live debugging of threaded
 > programs
 >=20
 > On Thursday 22 April 2010 16:20:04 Paul Koning wrote:
 > >  Antti pointed out a problem in the patch I originally submitted
 > which
 > >  causes gdb to go into a loop if the child process exits.  The
 > attached
 > >  updated patch corrects that problem.
 >=20
 > This, unfortunately, still has cosmetic issues. See the attached log
 > and the
 > "Couldn't get registers: Operation not permitted." at the end of the
 > session
 >=20
 > Nick

State-Changed-From-To: open->feedback
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Thu, 20 Sep 2012 11:46:19 +0000
State-Changed-Why:
Is this still a problem?


From: Thomas Klausner <wiz@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/30756 (gdb not usable for live debugging of threaded
 programs)
Date: Thu, 20 Sep 2012 13:58:26 +0200

 I tried a simple example, firefox ;)
 It was already started with two open tabs.

 # gdb /usr/pkg/lib/xulrunner/xulrunner 27334
 ...
 Reading symbols from /usr/libexec/ld.elf_so...done.
 Loaded symbols for /usr/libexec/ld.elf_so
 /archive/cvs/src/external/gpl3/gdb/dist/gdb/thread.c:81: internal-error: inferior_thread: Assertion `tp' failed.
 A problem internal to GDB has been detected,
 further debugging may prove unreliable.
 Quit this debugging session? (y or n) y
 /archive/cvs/src/external/gpl3/gdb/dist/gdb/thread.c:81: internal-error: inferior_thread: Assertion `tp' failed.
 A problem internal to GDB has been detected,
 further debugging may prove unreliable.
 Create a core file of GDB? (y or n) y
 sorry, pid 27334 was killed: orphaned traced process
 zsh: abort (core dumped)  gdb /usr/pkg/lib/xulrunner/xulrunner 27334

 So, probably a different problem, but Subject is still correct :(
  Thomas

From: Thomas Klausner <wiz@NetBSD.org>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: bin/30756 (gdb not usable for live debugging of threaded
 programs)
Date: Thu, 20 Sep 2012 14:02:55 +0200

 Oh, here's the backtrace:
 # gdb gdb gdb.core
 ...
 [New process 1]
 Core was generated by `gdb'.
 Program terminated with signal 6, Aborted.
 #0  0x00007f7ff590657a in _lwp_kill () from /usr/lib/libc.so.12
 (gdb) bt
 #0  0x00007f7ff590657a in _lwp_kill () from /usr/lib/libc.so.12
 #1  0x00007f7ff59061e2 in abort () at /archive/cvs/src/lib/libc/stdlib/abort.c:74
 #2  0x00000000004995db in dump_core () at /archive/cvs/src/external/gpl3/gdb/dist/gdb/utils.c:1053
 #3  0x000000000049a3d2 in internal_vproblem (problem=0x9dc980, file=<optimized out>, line=<optimized out>, fmt=<optimized out>, ap=<optimized out>)
     at /archive/cvs/src/external/gpl3/gdb/dist/gdb/utils.c:1221
 #4  0x000000000049a5de in internal_verror (file=<optimized out>, line=<optimized out>, fmt=<optimized out>, ap=<optimized out>)
     at /archive/cvs/src/external/gpl3/gdb/dist/gdb/utils.c:1236
 #5  0x000000000049a669 in internal_error (file=0x1 <Address 0x1 out of bounds>, line=6, string=0x0) at /archive/cvs/src/external/gpl3/gdb/dist/gdb/utils.c:1246
 #6  0x0000000000407edf in inferior_thread () at /archive/cvs/src/external/gpl3/gdb/dist/gdb/thread.c:81
 #7  0x00000000004103a1 in normal_stop () at /archive/cvs/src/external/gpl3/gdb/dist/gdb/infrun.c:5647
 #8  0x0000000000418bab in attach_command_post_wait (from_tty=1, async_exec=0, args=<optimized out>) at /archive/cvs/src/external/gpl3/gdb/dist/gdb/infcmd.c:2399
 #9  0x0000000000418dce in attach_command (args=0x7f7ffffff885 "27334", from_tty=1) at /archive/cvs/src/external/gpl3/gdb/dist/gdb/infcmd.c:2532
 #10 0x0000000000407966 in catch_command_errors (command=0x418cb7 <attach_command>, arg=0x7f7ffffff885 "27334", from_tty=1, mask=<optimized out>)
     at /archive/cvs/src/external/gpl3/gdb/dist/gdb/exceptions.c:537
 #11 0x0000000000406628 in captured_main (data=<optimized out>) at /archive/cvs/src/external/gpl3/gdb/dist/gdb/main.c:875
 #12 0x00000000004078db in catch_errors (func=0x40593d <captured_main>, func_args=0x7f7fffffd590, errstring=0x657fd2 "", mask=<optimized out>)
     at /archive/cvs/src/external/gpl3/gdb/dist/gdb/exceptions.c:521
 #13 0x0000000000406700 in gdb_main (args=<optimized out>) at /archive/cvs/src/external/gpl3/gdb/dist/gdb/main.c:945
 #14 0x000000000040576a in main (argc=<optimized out>, argv=<optimized out>) at /archive/cvs/src/external/gpl3/gdb/dist/gdb/gdb.c:35

  Thomas

State-Changed-From-To: feedback->open
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Fri, 05 Oct 2012 08:59:33 +0000
State-Changed-Why:
Feedback supplied.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.