Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Mar 2013 17:37:13 +0000 (UTC)
From:      "Justin T. Gibbs" <gibbs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r248249 - stable/9/cddl/contrib/opensolaris/cmd/dtrace
Message-ID:  <201303131737.r2DHbDVC012907@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gibbs
Date: Wed Mar 13 17:37:13 2013
New Revision: 248249
URL: http://svnweb.freebsd.org/changeset/base/248249

Log:
  MFC r247048.
  
  Orphaned processes that are being traced are killed by the
  kernel.  Properly restore, continue, and detach from processes
  being DTraced when DTrace exits with an error so the program
  being inspected is not terminated.
  
  cddl/contrib/opensolaris/cmd/dtrace/dtrace.c:
  	In fatal(), the generic error handler, close the DTrace
  	handle as is done in the "probe/script" error handler
  	dfatal().  fatal() can be invoked after DTrace attaches
  	to processes (e.g. a script specified by command line
  	argument can't be found) and closing the handle will
  	release them.
  
  Submitted by:	Spectra Logic Corporation
  Reviewed by:	rpaulo, gnn

Modified:
  stable/9/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
Directory Properties:
  stable/9/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
==============================================================================
--- stable/9/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c	Wed Mar 13 17:34:42 2013	(r248248)
+++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c	Wed Mar 13 17:37:13 2013	(r248249)
@@ -195,6 +195,13 @@ fatal(const char *fmt, ...)
 	verror(fmt, ap);
 	va_end(ap);
 
+	/*
+	 * Close the DTrace handle to ensure that any controlled processes are
+	 * correctly restored and continued.
+	 */
+	if (g_dtp)
+		dtrace_close(g_dtp);
+
 	exit(E_ERROR);
 }
 



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