Revision
23043
Author
zarzycki@apple.com
Date
2007-02-08 07:34:54 -0800 (Thu, 08 Feb 2007)

Log Message

<rdar://problem/4983556> Shutdown sampling is holding up system shutdown

Modified Paths

Diff

Modified: trunk/launchd/src/shutdown_debugger.c (23042 => 23043)


--- trunk/launchd/src/shutdown_debugger.c	2007-02-08 15:21:26 UTC (rev 23042)
+++ trunk/launchd/src/shutdown_debugger.c	2007-02-08 15:34:54 UTC (rev 23043)
@@ -33,6 +33,7 @@
 static void populate_proc_list(void);
 static void debug_machports(pid_t pid, const char *pname);
 static void debug_machports2(pid_t pid, FILE *where);
+static void do_stackshot(void);
 
 static int kq;
 
@@ -70,6 +71,8 @@
 
 	closedir(thedir);
 
+	do_stackshot();
+
 	assert((kq = kqueue()) != -1);
 
 	debug_machports(1, "launchd");
@@ -524,3 +527,11 @@
 	fprintf(where, "Finished.\n");
 	return;
 }
+
+void
+do_stackshot(void)
+{
+	/* yes, we really mean to exec without fork at this point in time */
+	execl("/usr/libexec/stackshot", "/usr/libexec/stackshot", "-i", "-f", "./shutdown-stackshot.log", NULL);
+	_exit(EXIT_FAILURE);
+}