-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8373110: jstack --mixed frames are broken on macOS after JDK-8371194 #28686
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 157 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 |
Webrevs
|
shipilev
left a comment
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.
Drive-by comment:
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/aarch64/BsdAARCH64CFrame.java
Outdated
Show resolved
Hide resolved
|
macosx-aarch64 looks fine, but it looks like there is still an issue on macosx-x64. Stack traces are empty: Before this change you at least got a partial stack followed by the UnsupportedPlatformException. |
…sd/aarch64/BsdAARCH64CFrame.java Co-authored-by: Aleksey Shipilëv <shipilev@amazon.de>
Does it happen always? or intermittently?
I'm not sure, but I guess jstack could not unwind frame at some point(s) due to unwind info like DWARF on Linux - jstack might not handle call frame because the symbol could not be resolved. |
Always. Every thread and with every run. All of the thread stack traces just have the one empty frame. |
|
@plummercj Maybe it was fixed in the latest commit on this PR. Could you check again? |
That seems to have fixed it. Thanks! |
| if ((fp == null) || fp.lessThan(rsp)) { | ||
| return null; | ||
| @Override | ||
| public CFrame sender(ThreadProxy thread, Address nextSP, Address nextFP, Address nextPC) { |
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.
Why is it that for aarch64 these are all "next" arguments, but for AMD64 they are not?
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.
I want to declare like sender(ThreadProxy th, Address sp, Address fp, Address pc) as defined in CFrame, however name of parameters (sp, fp, pc) have already declared as class members in BsdAARCH64CFrame. Thus I added next as a prefix of parameter name.
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.
Ok. Looks like that was also the case with LunuxAARCH64CFrame.
|
PING: Can I get second reviewer(s)? Thanks! |
| CodeCache cc = VM.getVM().getCodeCache(); | ||
| CodeBlob currentBlob = cc.findBlobUnsafe(pc()); | ||
|
|
||
| // This case is different from HotSpot. See JDK-8371194 for details. |
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 overall I think.
What does "different from HotSpot" mean?
I see we used that phrase in 8371194 also in LinuxAARCH64CFrame.java
Maybe it is saying that these codeBlobs are handled differently from other code?
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.
Yes. We were trying to implement similar code with NativeStackPrinter used in generating hs_err log in HotSpot, but this condition is different with it.
Comments in 8371195 says:
The special case for currentBlob.isContinuationStub() || currentBlob.isNativeMethod()) is needed compared to os::get_sender_for_C_frame because, unlike in the VM, here we are walking those frames as native C frames. Without the special case we depend on nextFP which might not be valid unless -XX:+PreserveFramePointer is used.
In os_bsd_aarch64.cpp, comment of get_sender_for_C_frame() says JVM compiled with -fno-omit-frame-pointer, but we can override CFLAGS with configure options. Thus I think it is better to align with Linux AArch64. Actually I heard this code works fine on Mac AArch64 - mixed jstack unwinded native methods successfully like java.lang.ref.Reference.waitForReferencePendingList().
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.
OK, so this is different to the HotSpot NativeStackPrinter and the frame::next_frame() method.
As we already have the comment in a similar method maybe no need to change it here.
Thanks.
|
Thanks a lot for your review! /integrate |
|
Going to push as commit b848ddf.
Your commit was automatically rebased without conflicts. |
JDK-8371194 (PR #28284) has broken PStack (jstack --mixed) behavior on macOS. It affects both AMD64 and AArch64. See JBS for details.
This PR fixes it to implement
CFrame::toFrame.Progress
Warning
8373110: jstack --mixed frames are broken on macOS after JDK-8371194Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28686/head:pull/28686$ git checkout pull/28686Update a local copy of the PR:
$ git checkout pull/28686$ git pull https://git.openjdk.org/jdk.git pull/28686/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28686View PR using the GUI difftool:
$ git pr show -t 28686Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28686.diff
Using Webrev
Link to Webrev Comment