JDK-8259397 : ThreadsSMRSupport::print_info_on() should use try_lock_without_rank_check()
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2021-01-07
  • Updated: 2021-01-14
  • Resolved: 2021-01-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b05Fixed
Related Reports
Relates :  
Description
The following bug fix changed ThreadsSMRSupport::print_info_on()
to use try_lock():

    JDK-8231627 ThreadsListHandleInErrorHandlingTest.java fails in printing all threads

However, it should have skipped the rank check:

$ git diff
diff --git a/src/hotspot/share/runtime/threadSMR.cpp b/src/hotspot/share/runtime/threadSMR.cpp
index 9b70bdf753c..1ed8ac04246 100644
--- a/src/hotspot/share/runtime/threadSMR.cpp
+++ b/src/hotspot/share/runtime/threadSMR.cpp
@@ -1107,7 +1107,7 @@ void ThreadsSMRSupport::print_info_on(const Thread* thread, outputStream* st) {
 // Print Threads class SMR info.
 void ThreadsSMRSupport::print_info_on(outputStream* st) {
   bool needs_unlock = false;
-  if (Threads_lock->try_lock()) {
+  if (Threads_lock->try_lock_without_rank_check()) {
     // We were able to grab the Threads_lock which makes things safe for
     // this call, but if we are error reporting, then a nested error
     // could happen with the Threads_lock held.



Comments
Changeset: 090bd3af Author: Daniel D. Daugherty <dcubed@openjdk.org> Date: 2021-01-08 15:30:33 +0000 URL: https://git.openjdk.java.net/jdk/commit/090bd3af
08-01-2021