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]>
--- 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),