changeset 7552:eba0866f9379

8074368: ThreadMXBean.getThreadInfo() corrupts memory when called with empty array for thread ids Reviewed-by: mchung
author jbachorik
date Fri, 03 Apr 2015 15:40:35 +0200
parents bf95d7ddba60
children 7c72f397718a
files src/share/vm/services/management.cpp
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/services/management.cpp	Mon Oct 12 19:31:16 2015 +0200
+++ b/src/share/vm/services/management.cpp	Fri Apr 03 15:40:35 2015 +0200
@@ -1107,6 +1107,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.