8074368: ThreadMXBean.getThreadInfo() corrupts memory when called with empty array for thread ids
Reviewed-by: mchung
--- 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.