From bfb65f55ca7773f587631fff85a62ff56f01fdf4 Mon Sep 17 00:00:00 2001 From: jbachorik Date: Fri, 3 Apr 2015 15:40:35 +0200 Subject: [PATCH] 8074368: ThreadMXBean.getThreadInfo() corrupts memory when called with empty array for thread ids Reviewed-by: mchung --- src/share/vm/services/management.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/share/vm/services/management.cpp b/src/share/vm/services/management.cpp index 9875c6ee7..a8e6b0b27 100644 --- a/src/share/vm/services/management.cpp +++ b/src/share/vm/services/management.cpp @@ -1107,6 +1107,8 @@ static void do_thread_dump(ThreadDumpResult* dump_result, 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. -- GitLab