changeset 13666:ab986bc53f59

2551 jstack may deal in stale ustack helper frames Reviewed by: Joshua M. Clulow <josh@sysmgr.org> Reviewed by: Adam Leventhal <ahl@delphix.com> Approved by: Gordon Ross <gwr@nexenta.com>
author Richard Lowe <richlowe@richlowe.net>
date Wed, 28 Mar 2012 05:42:57 +0100
parents d9114464c195
children 042db6341598
files usr/src/uts/common/dtrace/dtrace.c
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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),