-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8334763: --enable-asan: assert(_thread->is_in_live_stack((address)this)) failed: not on stack? #19843
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 jkratochvil! A progress list of the required criteria for merging this PR into |
|
@jankratochvil 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 77 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@kimbarrett, @dholmes-ora, @tstuefe, @erikj79) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
@jankratochvil The following label 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 list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
|
Note that JDK-8323732 is a duplicate of JDK-8330047 (and is now marked as such), which was fixed in JDK 23. |
|
I ran into this too (though, strangely, not for asan but for ubsan) and am happy to see this addressed. I agree with @kimbarrett though that globally disabling use after return seems too big a hammer. @jankratochvil could you please add a bit of analysis to the JBS issue? Which other uses of is_in_live_thread are affected? |
|
I haven't run a testsuite locally with ASAN for it and ASAN is not enabled for GHA. But |
dholmes-ora
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.
Sorry but can someone explain to me exactly what bit of code ASAN is complaining about and why? Thanks
|
JDK is sometimes verifying |
|
It looks like __builtin_frame_address is just incompatible with ASAN. With With And for both, instead it sometimes crashes with I also tried the "portable" version of of I also tried sprinkling around The "fake stack" mechanism used by the use-after-return sanitizer is just We could apply the technique from the 2nd commit (using I'm approaching the conclusion that the original proposal of globally |
That's somewhat of an understatement. :) I'm still unclear how anything ASAN does gets examined by our assertion, but it sounds to me like ASAN is just broken in this area. So I support Kim's conclusion - lets just turn this check off. |
+1 |
This reverts commit 7e08982.
- bugreported by Thomas Stuefe
tstuefe
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.
LGTM. I made a proposal for a bit clearer comment. Up to you if you take it. Thanks for fixing this.
- suggested by Thomas Stuefe
|
/integrate |
|
@jankratochvil |
In general, hotspot changes require two reviewers (one being an Reviewer). /reviewers 2 |
|
@kimbarrett |
| fi | ||
| if test "x$TOOLCHAIN_TYPE" = "xclang"; then | ||
| ASAN_CFLAGS="$ASAN_CFLAGS -fsanitize-address-use-after-return=never" | ||
| fi |
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.
This is JDK-wide configuration. Do we need that? Or would it be sufficient to limit this to the JVM?
I'm not sure what would happen with fake stacks at the JVM boundary (in either direction). I also don't
know what happens at the boundary with non-JDK native 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.
Thinking about it some more, global disable seems like the only safe thing to do. So never mind my musings
about whether the disable could be limited to the JVM.
| fi | ||
| if test "x$TOOLCHAIN_TYPE" = "xclang"; then | ||
| ASAN_CFLAGS="$ASAN_CFLAGS -fsanitize-address-use-after-return=never" | ||
| fi |
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.
There's no change being made for the microsoft toolchain. It seems like the same issues with the fake stack
should arise there.
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.
So I have tried it in AWS and added the new comment about it as MSVC has it off by default.
Microsoft documentation even implies it is off by default.
But I have filed JDK-8335228 as the MS-Windows OpenJDK build crashes if one explicitly enables -fsanitize-address-use-after-return there.
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 guess we'll have to monitor this in future VS updates, which might start enabling it. But this seems okay for now.
| # detect_stack_use_after_return causes ASAN to offload stack-local | ||
| # variables to c-heap and therefore breaks assumptions in hotspot | ||
| # that rely on data (e.g. Marks) living in thread stacks. |
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.
Ah! Now I understand what it is doing. Ouch!
kimbarrett
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.
Looks good.
| fi | ||
| if test "x$TOOLCHAIN_TYPE" = "xclang"; then | ||
| ASAN_CFLAGS="$ASAN_CFLAGS -fsanitize-address-use-after-return=never" | ||
| fi |
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 guess we'll have to monitor this in future VS updates, which might start enabling it. But this seems okay for now.
|
/sponsor |
|
@kimbarrett The PR has been updated since the change author (@jankratochvil) issued the |
|
/integrate |
|
@jankratochvil |
|
/sponsor |
|
Going to push as commit b4df380.
Your commit was automatically rebased without conflicts. |
|
@kimbarrett @jankratochvil Pushed as commit b4df380. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
fastdebug:
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19843/head:pull/19843$ git checkout pull/19843Update a local copy of the PR:
$ git checkout pull/19843$ git pull https://git.openjdk.org/jdk.git pull/19843/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 19843View PR using the GUI difftool:
$ git pr show -t 19843Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19843.diff
Webrev
Link to Webrev Comment