-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
8334763: --enable-asan: assert(_thread->is_in_live_stack((address)this)) failed: not on stack? #19843
Changes from all commits
4226e7a
7e08982
0fa0102
1ec6942
effd880
08153d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -438,12 +438,23 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER], | |
| # It's harmless to be suppressed in clang as well. | ||
| ASAN_CFLAGS="-fsanitize=address -Wno-stringop-truncation -fno-omit-frame-pointer -fno-common -DADDRESS_SANITIZER" | ||
| ASAN_LDFLAGS="-fsanitize=address" | ||
| # 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. | ||
| if test "x$TOOLCHAIN_TYPE" = "xgcc"; then | ||
| ASAN_CFLAGS="$ASAN_CFLAGS --param asan-use-after-return=0" | ||
| fi | ||
| if test "x$TOOLCHAIN_TYPE" = "xclang"; then | ||
| ASAN_CFLAGS="$ASAN_CFLAGS -fsanitize-address-use-after-return=never" | ||
| fi | ||
jankratochvil marked this conversation as resolved.
Show resolved
Hide resolved
jankratochvil marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| elif test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then | ||
| # -Oy- is equivalent to -fno-omit-frame-pointer in GCC/Clang. | ||
| ASAN_CFLAGS="-fsanitize=address -Oy- -DADDRESS_SANITIZER" | ||
| # MSVC produces a warning if you pass -fsanitize=address to the linker. It also complains | ||
| $ if -DEBUG is not passed to the linker when building with ASan. | ||
| ASAN_LDFLAGS="-debug" | ||
| # -fsanitize-address-use-after-return is off by default in MS Visual Studio 22 (19.37.32824). | ||
| # cl : Command line warning D9002 : ignoring unknown option '-fno-sanitize-address-use-after-return' | ||
| fi | ||
| JVM_CFLAGS="$JVM_CFLAGS $ASAN_CFLAGS" | ||
| JVM_LDFLAGS="$JVM_LDFLAGS $ASAN_LDFLAGS" | ||
|
|
||
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!