JDK-8232592 : is shown in jstack mixed mode
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 11,12,13,14
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-10-18
  • Updated: 2020-07-14
  • Resolved: 2019-10-23
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 11 JDK 13 JDK 14
11.0.6Fixed 13.0.4Fixed 14 b20Fixed
Description
I run `jhsdb jstack --mixed` to JShellToolProvider process, then I saw <Unknown compiled code> in the stack as below:

```
----------------- 4741 -----------------
"process reaper" #13 daemon prio=10 tid=0x00007f959c328000 nid=0x1285 runnable [0x00007f9578025000]
   java.lang.Thread.State: RUNNABLE
   JavaThread state: _thread_in_native
0x00007f95a27c5596      __waitpid + 0x56
0x00007f958c601d79      <Unknown compiled code>
0x00007f9585c5b4ac      * java.lang.ProcessHandleImpl$1.run() bci:8 line:138 (Compiled frame)
* java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) bci:92 line:1128 (Compiled frame)
* java.util.concurrent.ThreadPoolExecutor$Worker.run() bci:5 line:628 (Compiled frame)
* java.lang.Thread.run() bci:11 line:834 (Compiled frame)
0x00007f95a17ce7e9      _ZN9JavaCalls11call_helperEP9JavaValueRK12methodHandleP17JavaCallArgumentsP6Thread + 0x3b9
0x00007f95a17cc79d      _ZN9JavaCalls12call_virtualEP9JavaValue6HandleP5KlassP6SymbolS6_P6Thread + 0x1ed
0x00007f95a187685c      _ZL12thread_entryP10JavaThreadP6Thread + 0x6c
0x00007f95a1d0cb0d      _ZN10JavaThread17thread_main_innerEv + 0x21d
0x00007f95a1d0ceb7      _ZN10JavaThread3runEv + 0x377
0x00007f95a1b516a0      _ZL19thread_native_entryP6Thread + 0xf0
```

0x7f958c601d79 is native method. jstack mixed mode should handle it.
Comments
Fix request (13u): The change applies cleanly, sanity check with tier1 tests.
28-05-2020

Fix Request for 11u: This patch fixes to show native method call in `jhsdb jstack --mixed`. It can work on tier 1 tests on submit repo, and can be applied straightly to 11u-dev.
23-10-2019

URL: https://hg.openjdk.java.net/jdk/jdk/rev/083bbca50d2d User: ysuenaga Date: 2019-10-23 01:02:58 +0000
23-10-2019

After this change, we can see JNI call as below: ``` ----------------- 22179 ----------------- "process reaper" #14 daemon prio=10 tid=0x00007f12ec4b6000 nid=0x56a3 runnable [0x00007f12d009c000] java.lang.Thread.State: RUNNABLE JavaThread state: _thread_in_native 0x00007f12f43f5596 __waitpid + 0x56 0x00007f12dc5c134d java.lang.ProcessHandleImpl.waitForProcessExit0(long, boolean) + 0xed (Native method) 0x00007f12d579730c * java.lang.ProcessHandleImpl$1.run() bci:8 line:138 (Compiled frame) * java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) bci:92 line:1130 (Compiled frame) * java.util.concurrent.ThreadPoolExecutor$Worker.run() bci:5 line:630 (Compiled frame) * java.lang.Thread.run() bci:11 line:830 (Compiled frame) 0x00007f12f2f01bdc _ZN9JavaCalls11call_helperEP9JavaValueRK12methodHandleP17JavaCallArgumentsP6Thread + 0x6ac 0x00007f12f2efedad _ZN9JavaCalls12call_virtualEP9JavaValueP5KlassP6SymbolS5_P17JavaCallArgumentsP6Thread + 0x33d 0x00007f12f2efefce _ZN9JavaCalls12call_virtualEP9JavaValue6HandleP5KlassP6SymbolS6_P6Thread + 0xbe 0x00007f12f306216e _ZL12thread_entryP10JavaThreadP6Thread + 0x12e 0x00007f12f39fe512 _ZN10JavaThread17thread_main_innerEv + 0x312 0x00007f12f3a08f0f _ZN10JavaThread3runEv + 0x29f 0x00007f12f3a046c0 _ZN6Thread8call_runEv + 0x100 0x00007f12f35c2506 _ZL19thread_native_entryP6Thread + 0x116 ```
18-10-2019

Suggested fix: http://hg.openjdk.java.net/jdk/submit/rev/520cac81b9c9
18-10-2019