Hi all,
Does someone work for adapting SA to the 8150689?
8150689 fixed not to show incorrect lock information in thread dump.
jstack code in SA implements which refer to HotSpot implementation.
So it should be fixed as below:
----------------------
diff -r 157c1130b46e
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopUtilities.java
---
a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopUtilities.java
Thu Nov 29 07:40:45 2018 +0800
+++
b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopUtilities.java
Thu Nov 29 22:52:34 2018 +0900
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All
rights
reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All
rights
reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or
modify it
@@ -65,14 +65,14 @@
// possible values of java_lang_Thread::ThreadStatus
private static int THREAD_STATUS_NEW;
- private static int THREAD_STATUS_RUNNABLE;
- private static int THREAD_STATUS_SLEEPING;
- private static int THREAD_STATUS_IN_OBJECT_WAIT;
- private static int THREAD_STATUS_IN_OBJECT_WAIT_TIMED;
- private static int THREAD_STATUS_PARKED;
- private static int THREAD_STATUS_PARKED_TIMED;
- private static int THREAD_STATUS_BLOCKED_ON_MONITOR_ENTER;
- private static int THREAD_STATUS_TERMINATED;
+ public static int THREAD_STATUS_RUNNABLE;
+ public static int THREAD_STATUS_SLEEPING;
+ public static int THREAD_STATUS_IN_OBJECT_WAIT;
+ public static int THREAD_STATUS_IN_OBJECT_WAIT_TIMED;
+ public static int THREAD_STATUS_PARKED;
+ public static int THREAD_STATUS_PARKED_TIMED;
+ public static int THREAD_STATUS_BLOCKED_ON_MONITOR_ENTER;
+ public static int THREAD_STATUS_TERMINATED;
// java.util.concurrent.locks.AbstractOwnableSynchronizer fields
private static OopField absOwnSyncOwnerThreadField;
diff -r 157c1130b46e
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaVFrame.java
---
a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaVFrame.java
Thu Nov 29 07:40:45 2018 +0800
+++
b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaVFrame.java
Thu Nov 29 22:52:34 2018 +0900
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All
rights
reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All
rights
reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or
modify it
@@ -106,6 +106,9 @@
StackValue sv = locs.get(0);
if (sv.getType() == BasicType.getTObject()) {
OopHandle o = sv.getObject();
+ if
(OopUtilities.threadOopGetThreadStatus(thread.getThreadObj()) ==
OopUtilities.THREAD_STATUS_BLOCKED_ON_MONITOR_ENTER) {
+ waitState = "waiting to re-lock in wait()";
+ }
printLockedObjectClassName(tty, o, waitState);
}
} else {
@@ -146,13 +149,6 @@
// an inflated monitor that is first on the monitor
re-lock in wait()");
}
printLockedObjectClassName(tty, monitor.owner(),
lockState);
foundFirstMonitor = true;
----------------------
Please tell me if I should file it to JBS and send review request.
Thanks,
Yasumasa