Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Jan 2013 19:52:31 GMT
From:      Garrett Cooper <yanegomi@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/175269: truss -ff doesn't detach from processes properly
Message-ID:  <201301131952.r0DJqVSi013604@red.freebsd.org>
Resent-Message-ID: <201301132000.r0DK018B005509@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301131952.r0DJqVSi013604>