2551 jstack may deal in stale ustack helper frames
authorRichard Lowe <richlowe@richlowe.net>
Wed, 28 Mar 2012 05:42:57 +0100
changeset 13666 ab986bc53f59
parent 13665 d9114464c195
child 13667 042db6341598
2551 jstack may deal in stale ustack helper frames Reviewed by: Joshua M. Clulow <[email protected]> Reviewed by: Adam Leventhal <[email protected]> Approved by: Gordon Ross <[email protected]>
usr/src/uts/common/dtrace/dtrace.c
--- a/usr/src/uts/common/dtrace/dtrace.c	Wed Apr 04 21:58:47 2012 +0100
+++ b/usr/src/uts/common/dtrace/dtrace.c	Wed Mar 28 05:42:57 2012 +0100
@@ -6107,6 +6107,23 @@
 					continue;
 				}
 
+				/*
+				 * Clear the string space, since there's no
+				 * helper to do it for us.
+				 */
+				if (DTRACE_USTACK_STRSIZE(rec->dtrd_arg) != 0) {
+					int depth = DTRACE_USTACK_NFRAMES(
+					    rec->dtrd_arg);
+					size_t strsize = DTRACE_USTACK_STRSIZE(
+					    rec->dtrd_arg);
+					uint64_t *buf = (uint64_t *)(tomax +
+					    valoffs);
+					void *strspace = &buf[depth + 1];
+
+					dtrace_bzero(strspace,
+					    MIN(depth, strsize));
+				}
+
 				DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
 				dtrace_getupcstack((uint64_t *)
 				    (tomax + valoffs),