-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8369505: jhsdb jstack cannot handle continuation stub #27728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Welcome back ysuenaga! A progress list of the required criteria for merging this PR into |
@YaSuenag This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 112 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@YaSuenag The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
I can reproduce it with your attached test too. The issue happens when the return pc of the sender frame is the return barrier, which will be the case if the virtual thread was unmounted at some earlier point and there are still frames freezed in the stackChunk (see |
I'm seeing a similar exception on macosx-aarch64 with your test, however, I don't see all the frames that you are seeing. The stack dump stops at Also, on threads that are fully dumped, the output is different than you working dump above. I'm not sure if this is expected:
|
I can see if your changes are applicable to aarch64. If they work, then great, if not, I'll probably need some help getting it right. |
Can you convert your test to JTREG? It would make it a lot easier to test fixes on all platforms. Also, the fix is a bit fragile and it would be nice to quickly detect if it breaks again in the future. |
I applied the changes to AARCH64Frame.java and they seem to fix the issue with the exception. I'm seeing two different stack traces (see below), and neither is identical to your fixed stack trace. I don't see "ForkJoinPool-1-worker-5" #34 daemon prio=5 tid=0x0000000159051c10 nid=34819 runnable [0x0000000172761000]
"ForkJoinPool-1-worker-6" #36 daemon prio=5 tid=0x0000000159052610 nid=42243 runnable [0x000000017296d000]
|
These two different stack traces are expected and depend on whether the vthread was unmounted or not. With the current test this is timing dependent. You can run the test commenting out the |
@plummercj Did you run Thanks @pchilano for explaining the problem, I understood it relates to unmount, it is triggered by |
I saw same issue in JDK 25 on Fedora Rawhide on Raspberry Pi 4.
|
I did not, and unfortunately --mixed is not support on OSX. |
I fixed for AArch64, and it works fine (in below) on Raspberry Pi 4.
|
@pchilano I reproduce the problem with |
@YaSuenag :
|
@RealFYang Thanks a lot! I applied your change to this PR! |
test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedWithVirtualThread.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedWithVirtualThread.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackWithVirtualThread.java
Show resolved
Hide resolved
test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedWithVirtualThread.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedWithVirtualThread.java
Outdated
Show resolved
Hide resolved
@plummercj Thanks for your comment! I revised testcase in the latest commit. Could you review again? |
Ok, that’s why I wasn’t seeing
When setting
I would have expected that Anyways, I was just curious about the difference in output with [1] Line 56 in d6537c6
[2]
|
I guess I ran
In addition, I saw following error when I added both
This is a problem in restoring Java frame, not native frame - native frame unwinding depends on DWARF in Linux x86_64, on FP ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good. Thanks for taking care of this.
test/hotspot/jtreg/serviceability/sa/LingeredAppWithVirtualThread.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/serviceability/sa/LingeredAppWithVirtualThread.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me too, thanks for fixing this.
Thanks everyone for involving this PR! /integrate |
Going to push as commit 1653999.
Your commit was automatically rebased without conflicts. |
I tried to get mixed thread dump of the application which runs virtual threads (see Test.java on JBS) via
jhsdb jstack --mixed
, then I got following message:And also I got following (strange) stacks which causes
AssersionFailure
in above:According to stack layout described in continuationFreezeThaw.cpp and stub implementation in
StubGenerator::generate_cont_thaw()
in stubGenerator_x86_64.cpp, we cannot calculate caller SP fromCodeBlob
for continuation stub. We need to restore SP from_cont_entry
inJavaThread
.After this fix, we can see following stacks:
I saw this issue on Linux AMD64. I'm not sure but it might happen on another platforms.
I haven't yet created a complete reproducer, but Test.java on JBS can be reproduced with high probability.
Progress
Warning
8369505: jhsdb jstack cannot handle continuation stub
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27728/head:pull/27728
$ git checkout pull/27728
Update a local copy of the PR:
$ git checkout pull/27728
$ git pull https://git.openjdk.org/jdk.git pull/27728/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27728
View PR using the GUI difftool:
$ git pr show -t 27728
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27728.diff
Using Webrev
Link to Webrev Comment