From owner-freebsd-ports-bugs@freebsd.org Mon Sep 12 13:55:59 2016 Return-Path: Delivered-To: freebsd-ports-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46C98BD8019 for ; Mon, 12 Sep 2016 13:55:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B82B197 for ; Mon, 12 Sep 2016 13:55:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CDtwYt024839 for ; Mon, 12 Sep 2016 13:55:58 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 212607] devel/gdb: debugging threaded process broken Date: Mon, 12 Sep 2016 13:55:58 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: tijl@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-ports-bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 13:55:59 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212607 Bug ID: 212607 Summary: devel/gdb: debugging threaded process broken Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: freebsd-ports-bugs@FreeBSD.org Reporter: tijl@FreeBSD.org CC: luca.pizzamiglio@gmail.com Flags: maintainer-feedback?(luca.pizzamiglio@gmail.com) CC: luca.pizzamiglio@gmail.com I'm running into a problem debugging threaded programs on FreeBSD head amd64 r304294 and i386 r305230. The following program reproduces it, but not always: % cat test.c #include void * thr( void *arg ) { return( arg ); } int main( void ) { pthread_t pthr[ 4 ]; pthread_create( &pthr[ 0 ], NULL, thr, NULL ); pthread_create( &pthr[ 1 ], NULL, thr, NULL ); pthread_create( &pthr[ 2 ], NULL, thr, NULL ); pthread_create( &pthr[ 3 ], NULL, thr, NULL ); pthread_join( pthr[ 0 ], NULL ); pthread_join( pthr[ 1 ], NULL ); pthread_join( pthr[ 2 ], NULL ); pthread_join( pthr[ 3 ], NULL ); return( 0 ); } % cc -ggdb -o test test.c -lpthread % gdb ./test Reading symbols from ./test...done. (gdb) b thr Breakpoint 1 at 0x4007d8: file test.c, line 5. (gdb) r Starting program: /usr/home/tijl/test=20 [New LWP 100221 of process 974] [New LWP 100222 of process 974] [Switching to LWP 100221 of process 974] Thread 2 hit Breakpoint 1, thr (arg=3D0x0) at test.c:5 5 return( arg ); (gdb) c Continuing. [Switching to LWP 100222 of process 974] Thread 3 hit Breakpoint 1, thr (arg=3D0x0) at test.c:5 5 return( arg ); (gdb) c Continuing. [LWP 100221 of process 974 exited] [LWP 100222 of process 974 exited] [New LWP 100223 of process 974] [Switching to LWP 100223 of process 974] 0x0000000800828990 in ?? () from /lib/libthr.so.3 ptrace: No such process. At this point gdb seems to be in an inconsistent state. (gdb) bt #0 0x0000000800828990 in ?? () from /lib/libthr.so.3 #1 0x0000000000000000 in ?? () Backtrace stopped: Cannot access memory at address 0x7fffdfbfc000 (gdb) q A debugging session is active. Inferior 1 [process 974] will be killed. Quit anyway? (y or n) y Here gdb locks up and has to be killed with SIGKILL. ports r411099 is the first commit that gives this behaviour. --=20 You are receiving this mail because: You are the assignee for the bug.=