From nobody@FreeBSD.org  Fri Apr 13 21:44:39 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id B50461065672
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 Apr 2012 21:44:39 +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 879FA8FC15
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 Apr 2012 21:44:39 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DLidGV095145
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 Apr 2012 21:44:39 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q3DLidfE095144;
	Fri, 13 Apr 2012 21:44:39 GMT
	(envelope-from nobody)
Message-Id: <201204132144.q3DLidfE095144@red.freebsd.org>
Date: Fri, 13 Apr 2012 21:44:39 GMT
From: Ryan Stone <rstone@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: dtrace -c doesn't seem to like it if the subcommand doesn't call exit()
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         166929
>Category:       bin
>Synopsis:       dtrace(1): dtrace -c doesn't seem to like it if the subcommand doesn't call exit()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    markj
>State:          feedback
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 13 21:50:10 UTC 2012
>Closed-Date:    
>Last-Modified:  Mon Apr 21 17:19:41 UTC 2014
>Originator:     Ryan Stone
>Release:        8-STABLE
>Organization:
>Environment:
>Description:
I had a program that did a return 0; from main(), and the program never seemed to exit properly(dtrace and the subcommand starting spinning at a high CPU rate).

I replaced the return 0; with an exit(0); and everything worked as expected.
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->gnn 
Responsible-Changed-By: rstone 
Responsible-Changed-When: Mon Apr 16 19:28:12 UTC 2012 
Responsible-Changed-Why:  
over to gnn 

http://www.freebsd.org/cgi/query-pr.cgi?pr=166929 
State-Changed-From-To: open->feedback 
State-Changed-By: gnn 
State-Changed-When: Mon Jun 4 16:25:18 UTC 2012 
State-Changed-Why:  
I just tried this on the latest HEAD and could not reproduce the problem. 
My code is quite trivial: 

#include <stdio.h> 

int main(int argc, char **argv) 
{ 
printf("return 0n"); 
return 0; 
} 

Is this still a problem on 8.X? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=166929 

From: Ryan Stone <rysto32@gmail.com>
To: bug-followup@FreeBSD.org, rstone@FreeBSD.org
Cc:  
Subject: Re: bin/166929: dtrace(1): dtrace -c doesn&#39;t seem to like it if
 the subcommand doesn&#39;t call exit()
Date: Tue, 5 Jun 2012 23:36:00 -0400

 I was able to reproduce it with the following program:
 
 #include <stdlib.h>
 
 int main(int argc, char **argv)
 {
         int i;
 
 
         for (i = 0; i < 10; i++) {
                 void * ptr = malloc(32);
                 sleep(1);
                 free(ptr);
         }
 
 //      exit(0);
         return (0);
 }
 
 
 My dtrace invocation was:
 sudo dtrace -c ./malloc -n 'pid$target::malloc:entry { ustack(); }
Responsible-Changed-From-To: gnn->markj 
Responsible-Changed-By: gnn 
Responsible-Changed-When: Mon Apr 21 17:19:03 UTC 2014 
Responsible-Changed-Why:  
Hand over to the person doing most of the DTrace work. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=166929 
>Unformatted:
