>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     [email protected]:/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:
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to