From owner-freebsd-bugs@FreeBSD.ORG Mon Jan 28 19:20:02 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C739016A418 for ; Mon, 28 Jan 2008 19:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A7B5413C4E1 for ; Mon, 28 Jan 2008 19:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m0SJK2eU060377 for ; Mon, 28 Jan 2008 19:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m0SJK2KK060376; Mon, 28 Jan 2008 19:20:02 GMT (envelope-from gnats) Resent-Date: Mon, 28 Jan 2008 19:20:02 GMT Resent-Message-Id: <200801281920.m0SJK2KK060376@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Christoph Mallon Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA41516A418 for ; Mon, 28 Jan 2008 19:11:35 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id DA4F313C442 for ; Mon, 28 Jan 2008 19:11:35 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m0SJ9pH3006154 for ; Mon, 28 Jan 2008 19:09:51 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m0SJ9p8H006153; Mon, 28 Jan 2008 19:09:51 GMT (envelope-from nobody) Message-Id: <200801281909.m0SJ9p8H006153@www.freebsd.org> Date: Mon, 28 Jan 2008 19:09:51 GMT From: Christoph Mallon To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/120095: gdb fails to catch signals when threading is involved X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2008 19:20:02 -0000 >Number: 120095 >Category: kern >Synopsis: gdb fails to catch signals when threading is involved >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 28 19:20:02 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Christoph Mallon >Release: RELENG_6_2 (applies to newer releases, including 8.x, too) >Organization: - >Environment: FreeBSD tron.homeunix.org 6.2-STABLE FreeBSD 6.2-STABLE #1: Sun Aug 26 08:02:41 CEST 2007 root@tron.homeunix.org:/usr/obj/usr/src/sys/KERNEL i386 >Description: GDB is not able to catch signals from threaded processes, even if no extra threads get created. According to rwatson@ this is probably a kernel-side signal handling problem and he can reproduce this on 8.x, too (though instead of -pthread he used -lkse, because the standard threading implementation was changed). Building the test program below with the different thread libraries gives the following results: [WORKS] no threading: (cc -ggdb test.c) (gdb) r Starting program: /usr/home/tron/a.out Program received signal SIGABRT, Aborted. 0x2814cc47 in kill () from /lib/libc.so.6 (gdb) [BROKEN] pthread (KSE on my 6.x box): (cc -ggdb -pthread test.c) (gdb) r Starting program: /usr/home/tron/a.out warning: Unable to get location for thread creation breakpoint: generic error [New LWP 100103] Program exited normally. (gdb) [WORKS] libthr: (cc -ggdb -lthr test.c) (gdb) r Starting program: /usr/home/tron/a.out [New LWP 100118] [New Thread 0x804b000 (LWP 100118)] Program received signal SIGABRT, Aborted. [Switching to Thread 0x804b000 (LWP 100118)] 0x2815fc47 in kill () from /lib/libc.so.6 (gdb) [BROKEN] libc_r: (cc -ggdb -lc_r test.c) (gdb) r Starting program: /usr/home/tron/a.out warning: Unable to get location for thread creation breakpoint: generic error [New LWP 100185] Cannot find thread, Thread ID=1, generic error (gdb) >How-To-Repeat: #include #include #include int main(void) { kill(getpid(), SIGABRT); } >Fix: >Release-Note: >Audit-Trail: >Unformatted: