-
Notifications
You must be signed in to change notification settings - Fork 238
8315380: AsyncGetCallTrace crash in frame::safe_for_sender #3003
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
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back jbachorik! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
Webrevs
|
/label add hotspot,serviceability |
@jbachorik |
/label hotspot-runtime |
@jbachorik |
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.
Should not the new check be of unextended_sp rather than sp? That would match the check in JDK 17.
Indeed. I feel a bit stupid now. Fixed. |
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 now.
|
/approval I would like to ask for approval to integrate this JDK 11 specific bug fix. The change is very limited and improves the profiling experience for users of this Java version. |
@jbachorik usage: |
/approval request I would like to ask for approval to integrate this JDK 11 specific bug fix. The change is very limited and improves the profiling experience for users of this Java version. |
@jbachorik |
@jbachorik This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@jerboaa @gnu-andrew I have created the approval request and tagged the JBS ticket. Would it be possible to review the request? |
@jbachorik This is in a delicate area of the JVM and is a JDK 11u specific fix. Please get a second review for this. Thanks! It would also be good to explain why this isn't an issue in later JDKs on the issue. |
/help |
@jbachorik Available commands:
|
@jbachorik Usage: |
/reviewer @dholmes-ora @shipilev |
@jbachorik Syntax:
|
/reviewers 2 reviewer |
@jbachorik |
Ok, I bumped up the number of required reviewers. So, if someone is reading this in the email thread and has a few moments to review this rather trivial change, please, have a look. |
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 think @apangin would be good to look at it.
bool unextended_sp_safe = (unextended_sp < thread->stack_base() && \ | ||
unextended_sp >= thread->stack_base() - thread->stack_size()); |
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.
- What's the meaning of trailing
\
here? - I think you can do
unextended_sp >= thread->stack_end()
to better capture the intent and match 8238988 better.
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.
What's the meaning of trailing \ here?
No particular meaning, removed.
I think you can do unextended_sp >= thread->stack_end() to better capture the intent and match 8238988 better.
Yes. Done.
Also, I noticed that the check for unextended_sp is not done very consistently across archs. This is also changed in 8238988 but I opted for the simplicity and added the change only for the arch for which the original issue was reported. I hope it's ok but if a more extensive change is preferred I can apply similar logic to other archs as well.
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 see this for other arches:
- AArch64: Checks (stack_base, *)
- ARM: Checks [stack_base, sp]
- PPC: Checks (stack_base, *)
- S390: Checks (stack_base, *)
- SPARC: Checks [stack_base, sp]
- x86: Checks (stack_base, sp]
So I think only AArch64, PPC and S390 are affected by this bug? Checking against sp
on other arches looks more conservative than checking for stack_end()
, so I think we are "fine" there. Given that profiling on PPC and S390 is likely not happening all that often -- I think async-profiler started supporting PPC profiling only not that long ago -- I don't think there is a need to fix those.
@TheRealMDoerr might disagree, though :)
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.
No, I'm not interested in asprof with jdk11. One remark: I wouldn't allow Copyright additions if I was lead maintainer.
@jerboaa AFAICS, it is already mentioned in this comment, along with the JBS ticket that made it safe in JDK 15+ |
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.
Fine by me, thanks.
Thanks everyone for helping me to review this! @jerboaa I think we are ok now? |
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.
Still fine.
This change is fixing the problem in
frame_aarch64.cpp
, functionsafe_for_sender
, where we have this codeWhile this captures one possibility of not being safe, it omits the check for
unextended_sp
falling within the stack space.The proposed change then is
This is actually just making sure the behaviour is the same as in JDK 15+ (since JDK-8238988) where the
unextended_sp
is checked for being within the stack limits.The change is not accompanied by a JTReg test because I was not able to craft one triggering the issue reliably.
Existing tests from tier1-tier4 were run on a linux-aarch64 system with no new failures observed.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u-dev.git pull/3003/head:pull/3003
$ git checkout pull/3003
Update a local copy of the PR:
$ git checkout pull/3003
$ git pull https://git.openjdk.org/jdk11u-dev.git pull/3003/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3003
View PR using the GUI difftool:
$ git pr show -t 3003
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk11u-dev/pull/3003.diff
Using Webrev
Link to Webrev Comment