From nobody@FreeBSD.org  Mon Jul 24 11:20:53 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2948F16A4DA
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Jul 2006 11:20:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B593643D58
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Jul 2006 11:20:52 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k6OBKqBG031180
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Jul 2006 11:20:52 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k6OBKqjT031179;
	Mon, 24 Jul 2006 11:20:52 GMT
	(envelope-from nobody)
Message-Id: <200607241120.k6OBKqjT031179@www.freebsd.org>
Date: Mon, 24 Jul 2006 11:20:52 GMT
From: Christoph Mallon <christoph.mallon@gmx.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: libthr + gdb + triggered breakpoint results in panic
X-Send-Pr-Version: www-2.3

>Number:         100774
>Category:       kern
>Synopsis:       libthr + gdb + triggered breakpoint results in panic
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 24 11:30:12 GMT 2006
>Closed-Date:    Mon Dec 25 16:27:19 GMT 2006
>Last-Modified:  Mon Dec 25 16:27:19 GMT 2006
>Originator:     Christoph Mallon
>Release:        RELENG_6
>Organization:
>Environment:
FreeBSD tron.homeunix.org 6.1-STABLE FreeBSD 6.1-STABLE #0: Tue May 16 20:05:33 CEST 2006     root@tron.homeunix.org:/usr/obj/usr/src/sys/KERNEL  i386

>Description:
I libmap'ed libpthread.so.2 to libthr.so.2, because the former gives problems in gdb when the debugged process raises SIGABRT. (gdb claims it can't find the process anymore, this seems to be same problem as reported in threads/80992)

I added a breakpoint and started the program I wanted to debug.
The breakpoint was reached - gdb showed the usual output for reaching a breakpoint. Directly after my system rebooted.
I tried this two more times with different breakpoints - same result.
This happend as non-privileged user debugging openttd. (see ports/games/openttd, though I used version from the svn repo and not the port)
It doesn't happen with libpthread. I couldn't test with libc_r, because gdb fails to fetch thread information.
I'm sorry, I have no further information about this. I don't know if it happens with other programs being debugged in gdb or what the output on /dev/console was, because the program I debugged was an X program.
>How-To-Repeat:
- use libthr
- debug (multithreaded) program in gdb
- set a breakpoint
- wait for breakpoint being reached -> system reboots
>Fix:

>Release-Note:
>Audit-Trail:

From: David Xu <davidxu@freebsd.org>
To: freebsd-bugs@freebsd.org
Cc: Christoph Mallon <christoph.mallon@gmx.de>,
 freebsd-gnats-submit@freebsd.org
Subject: Re: kern/100774: libthr + gdb + triggered breakpoint results in panic
Date: Tue, 25 Jul 2006 07:54:53 +0800

 On Monday 24 July 2006 19:20, Christoph Mallon wrote:
 > >Number:         100774
 > >Category:       kern
 > >Synopsis:       libthr + gdb + triggered breakpoint results in panic
 
 Do you have kernel backtrace ?
 
 David Xu

From: Christoph Mallon <christoph.mallon@gmx.de>
To: David Xu <davidxu@freebsd.org>
Cc: freebsd-bugs@freebsd.org,  freebsd-gnats-submit@freebsd.org
Subject: Re: kern/100774: libthr + gdb + triggered breakpoint results in panic
Date: Tue, 25 Jul 2006 08:52:37 +0200

 David Xu wrote:
 > On Monday 24 July 2006 19:20, Christoph Mallon wrote:
 >>> Number:         100774
 >>> Category:       kern
 >>> Synopsis:       libthr + gdb + triggered breakpoint results in panic
 > 
 > Do you have kernel backtrace ?
 > 
 > David Xu
 > 
 > 
 No, sorry.
 I just compiled a new kernel (sources from today, 20060725) with DDB
 support, but the problem doesn't occur there.
 
 	Christoph

From: David Xu <davidxu@freebsd.org>
To: freebsd-bugs@freebsd.org
Cc: Christoph Mallon <christoph.mallon@gmx.de>,
 freebsd-gnats-submit@freebsd.org
Subject: Re: kern/100774: libthr + gdb + triggered breakpoint results in panic
Date: Wed, 26 Jul 2006 14:56:33 +0800

 On Tuesday 25 July 2006 14:52, Christoph Mallon wrote:
 > David Xu wrote:
 > > On Monday 24 July 2006 19:20, Christoph Mallon wrote:
 > >>> Number:         100774
 > >>> Category:       kern
 > >>> Synopsis:       libthr + gdb + triggered breakpoint results in panic
 > >
 > > Do you have kernel backtrace ?
 > >
 > > David Xu
 >
 > No, sorry.
 > I just compiled a new kernel (sources from today, 20060725) with DDB
 > support, but the problem doesn't occur there.
 >
 > 	Christoph
 > _______________________________________________
 >
 This might be fixed by the change:
 http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/i386/i386/ptrace_machdep.c.diff?r1=1.3.2.1&r2=1.3.2.2&f=h
 
 But I am not sure, though I had seen kernel crashed when debugging
 applications using floating-point, I doubt gdb sometimes messed mxcsr
 register.
 
 David Xu
State-Changed-From-To: open->closed 
State-Changed-By: remko 
State-Changed-When: Mon Dec 25 16:27:18 UTC 2006 
State-Changed-Why:  
David mentioned that some revision might have solved the problem seen, 
but nobody replied, closing the PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=100774 
>Unformatted:
