8074368: ThreadMXBean.getThreadInfo() corrupts memory when called with empty array for thread ids
authorjbachorik
Fri, 03 Apr 2015 15:40:35 +0200
changeset 30232 dc351997b749
parent 30229 2d8a6a2ee279
child 30233 526072aec162
8074368: ThreadMXBean.getThreadInfo() corrupts memory when called with empty array for thread ids Reviewed-by: mchung
hotspot/src/share/vm/services/management.cpp
--- a/hotspot/src/share/vm/services/management.cpp	Tue Apr 07 20:18:28 2015 -0700
+++ b/hotspot/src/share/vm/services/management.cpp	Fri Apr 03 15:40:35 2015 +0200
@@ -1109,6 +1109,8 @@
                            bool with_locked_monitors,
                            bool with_locked_synchronizers,
                            TRAPS) {
+  // no need to actually perform thread dump if no TIDs are specified
+  if (num_threads == 0) return;
 
   // First get an array of threadObj handles.
   // A JavaThread may terminate before we get the stack trace.