bin/133700: [truss] If traced process is killed by signal, truss enters infinite loop

Mateusz Guzik mjguzik at gmail.com
Mon Apr 13 03:50:01 PDT 2009


>Number:         133700
>Category:       bin
>Synopsis:       [truss] If traced process is killed by signal, truss enters infinite loop
>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 Apr 13 10:50:00 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Mateusz Guzik
>Release:        8.0-CURRENT
>Organization:
>Environment:
FreeBSD eternal 8.0-CURRENT FreeBSD 8.0-CURRENT #2: Sat Mar 28 00:24:50 CET 2009     f at eternal:/usr/obj/usr/src/sys/ETERNAL  i386

>Description:
If traced process is killed by signal, truss enters infinite loop.
>How-To-Repeat:
Run the following program under truss: int main() {raise(11);}


>Fix:
The problem lies in setup.c:waitevent():
if (WIFSIGNALED(waitval)) {
        info->pr_why = S_EXIT;
        info->pr_why = 0;
        return;
}

pr_why is zeroed just after its set to S_EXIT.

Patch attached with submission follows:

--- usr.bin/truss/setup.c.orig	2007-06-27 00:42:37.000000000 +0200
+++ usr.bin/truss/setup.c	2009-04-13 00:06:45.000000000 +0200
@@ -215,7 +215,7 @@
 	}
 	if (WIFSIGNALED(waitval)) {
 	        info->pr_why = S_EXIT;
-		info->pr_why = 0;
+		info->pr_data = 0;
                 return;
 	}
 }


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list