From owner-freebsd-bugs@FreeBSD.ORG Sun Jan 13 20:00:01 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5947F1D9 for ; Sun, 13 Jan 2013 20:00:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 3D0E28AB for ; Sun, 13 Jan 2013 20:00:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r0DK011r005510 for ; Sun, 13 Jan 2013 20:00:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r0DK018B005509; Sun, 13 Jan 2013 20:00:01 GMT (envelope-from gnats) Resent-Date: Sun, 13 Jan 2013 20:00:01 GMT Resent-Message-Id: <201301132000.r0DK018B005509@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, Garrett Cooper Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6F297138 for ; Sun, 13 Jan 2013 19:52:31 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 3106D871 for ; Sun, 13 Jan 2013 19:52:31 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DJqVNX013605 for ; Sun, 13 Jan 2013 19:52:31 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id r0DJqVSi013604; Sun, 13 Jan 2013 19:52:31 GMT (envelope-from nobody) Message-Id: <201301131952.r0DJqVSi013604@red.freebsd.org> Date: Sun, 13 Jan 2013 19:52:31 GMT From: Garrett Cooper To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: kern/175269: truss -ff doesn't detach from processes properly X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jan 2013 20:00:01 -0000 >Number: 175269 >Category: kern >Synopsis: truss -ff doesn't detach from processes properly >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jan 13 20:00:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: 10-CURRENT >Organization: EMC Isilon >Environment: FreeBSD fallout.local 10.0-CURRENT FreeBSD 10.0-CURRENT #2 r+96bb463: Tue Jan 8 00:39:55 PST 2013 root@fallout.local:/usr/obj/usr/src/sys/FALLOUT amd64 >Description: Things have gotten steadily better over time, but if I do something like exec a program with truss like: truss -ff startx It still gets stuck when detaching from processes when I hit ^C for instance. This has been present for several releases, so it's not a new thing, but it would be nice if this worked because it makes debugging easier in some respects compared to working with ktrace, which requires root privileges in order to function (and introduces other issues in the diagnosing process because it's running as root). >How-To-Repeat: $ cat rsleeper.sh #!/bin/sh trap "kill -9 -$$" EXIT INT rsleeper() { if [ -z "$RECURSIVE" ] then echo going recursive export RECURSIVE=1 rsleeper & else echo going non-recursive while : do sleep 1 done fi } rsleeper wait $ ./rsleeper.sh going recursive going non-recursive ^CKilled $ ps auxww | grep sleeper gcooper 41020 0.0 0.1 18468 10040 0 R+ 11:50AM 0:00.01 grep sleeper $ truss -ff -o log ./rsleeper.sh going recursive going non-recursive ^Ckill: -41022: No such process kill: -41022: No such process ^C^C^C^C^C^Z [1]+ Stopped truss -ff -o log ./rsleeper.sh $ kill %1 $ kill %1 bash: kill: (41021) - No such process [1]+ Done truss -ff -o log ./rsleeper.sh $ ps auxww | grep sleeper gcooper 41038 0.0 0.1 18468 10040 0 RL+ 11:51AM 0:00.02 grep sleeper >Fix: I need to do more investigation, but my guess is that the problem lies in either the ptrace code or truss itself. >Release-Note: >Audit-Trail: >Unformatted: