Skip to content

JDK-8302102: Disable ASan for SafeFetch and os::print_hex_dump #12477

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

Closed
wants to merge 3 commits into from

Conversation

jcking
Copy link
Contributor

@jcking jcking commented Feb 8, 2023

Disable ASan instrumentation for non-assembly versions of SafeFetch and os::print_hex_dump.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8302102: Disable ASan for SafeFetch and os::print_hex_dump

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12477/head:pull/12477
$ git checkout pull/12477

Update a local copy of the PR:
$ git checkout pull/12477
$ git pull https://git.openjdk.org/jdk pull/12477/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12477

View PR using the GUI difftool:
$ git pr show -t 12477

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12477.diff

Signed-off-by: Justin King <jcking@google.com>
@bridgekeeper
Copy link

bridgekeeper bot commented Feb 8, 2023

👋 Welcome back jcking! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 8, 2023
@openjdk
Copy link

openjdk bot commented Feb 8, 2023

@jcking The following label will be automatically applied to this pull request:

  • hotspot-runtime

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.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Feb 8, 2023
@mlbridge
Copy link

mlbridge bot commented Feb 8, 2023

Webrevs

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine. Thanks.

@openjdk
Copy link

openjdk bot commented Feb 9, 2023

@jcking 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:

8302102: Disable ASan for SafeFetch and os::print_hex_dump

Reviewed-by: dholmes, stuefe

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 91 new commits pushed to the master branch:

  • 94e7cc8: 8301226: Add clamp() methods to java.lang.Math and to StrictMath
  • 13b1ebb: 8298853: JvmtiVTMSTransitionDisabler should support disabling one virtual thread transitions
  • abbeb7e: 8302108: Clean up placeholder supername code
  • d503c66: 8302155: [AIX] NUM_LCPU is not required variable
  • c37e9d1: 8298293: NMT: os::realloc() should verify that flags do not change between reallocations
  • 101db26: 8301697: [s390] Optimized-build is broken
  • f4d4fa5: 8300255: Introduce interface for GC oop verification in the assembler
  • 99b6c0e: 8302289: RISC-V: Use bgez instruction in arraycopy_simple_check when possible
  • 57aef85: 8301838: PPC: continuation yield intrinsic: exception check not needed if yield succeeded
  • df93880: 8301942: java/net/httpclient/DigestEchoClientSSL.java fail with -Xcomp
  • ... and 81 more: https://git.openjdk.org/jdk/compare/09b8a1959771213cb982d062f0a913285e4a0c6e...master

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 (@dholmes-ora, @tstuefe) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 9, 2023
Copy link
Member

@tstuefe tstuefe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine.

Please build and test zero before pushing (gtests are fine).

@jcking
Copy link
Contributor Author

jcking commented Feb 9, 2023

Seems fine.

Please build and test zero before pushing (gtests are fine).

If we are talking about without ASan, it works fine. With ASan is a different story...

So, Zero does a bunch of things that are not acceptable and fails to finish the build while optimizing the image. It triggers stack-use-after-scope and global-buffer-overflow. The first is in ZeroInterpreter::native_entry(Method*, long, JavaThread*) src/hotspot/cpu/zero/zeroInterpreter_zero.cpp:435 because it looks like it takes the address of env above in a block and then leaves the block, leaving the address of env undefined. The second is related to Atomics unsigned int Atomic::PlatformLoad<4ul>::operator()<unsigned int>(unsigned int const volatile*) const src/hotspot/share/runtime/atomic.hpp:432 because Zero performs a 4-byte load for a variable with 1-byte storage.

I am not super interested in fixing Zero, though these issues should definitely be reported and fixed. They are all undefined behavior and likely corruption in the first case. Shall I report them and proceed with integration?

@tstuefe
Copy link
Member

tstuefe commented Feb 10, 2023

I am not super interested in fixing Zero, though these issues should definitely be reported and fixed. They are all undefined behavior and likely corruption in the first case. Shall I report them and proceed with integration?

I was assuming you were concerned with zero because you changed the sigjmp variant of SafeFetch, which is only used on zero.

Signed-off-by: Justin King <jcking@google.com>
@jcking
Copy link
Contributor Author

jcking commented Feb 10, 2023

I am not super interested in fixing Zero, though these issues should definitely be reported and fixed. They are all undefined behavior and likely corruption in the first case. Shall I report them and proceed with integration?

I was assuming you were concerned with zero because you changed the sigjmp variant of SafeFetch, which is only used on zero.

I was mostly just going for completeness in case somebody wanted to use ASan with Zero, since I knew it wouldn't work just like the Windows one. I'll file bugs for the Zero bugs to be looked into.

Signed-off-by: Justin King <jcking@google.com>
@jcking
Copy link
Contributor Author

jcking commented Feb 13, 2023

Filed JDK-8302347 and JDK-8302348 for Zero. Not sure which component, so just placed in Hotspot for now.

I'll wait for GHA to finish before integrating.

@jcking
Copy link
Contributor Author

jcking commented Feb 13, 2023

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Feb 13, 2023
@openjdk
Copy link

openjdk bot commented Feb 13, 2023

@jcking
Your change (at version df9076e) is now ready to be sponsored by a Committer.

@tstuefe
Copy link
Member

tstuefe commented Feb 15, 2023

/sponsor

@openjdk
Copy link

openjdk bot commented Feb 15, 2023

Going to push as commit 98a392c.
Since your change was applied there have been 111 commits pushed to the master branch:

  • 9ccf8ad: 8302129: Make MetaspaceReclaimPolicy a diagnostic switch
  • bdcbafb: 8296344: Remove dependency on G1 for writing the CDS archive heap
  • f1d76fa: 8302262: Remove -XX:SuppressErrorAt develop option
  • 9c202a5: 8302260: VarHandle.describeConstable() fails to return a nominal descriptor for static public fields
  • ca73f7e: 8301374: NullPointerException in MemberEnter.checkReceiver
  • 5b2d430: 8297632: InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE
  • f7dee77: 8301274: update for deprecated sprintf for security components
  • ec901f2: 8301279: update for deprecated sprintf for management components
  • 8933c2d: 8298278: JFR: Turn MEMFLAGS into a type for use with the NativeMemoryUsage events
  • 77519e5: 8302354: InstanceKlass init state/thread should be atomic
  • ... and 101 more: https://git.openjdk.org/jdk/compare/09b8a1959771213cb982d062f0a913285e4a0c6e...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 15, 2023
@openjdk openjdk bot closed this Feb 15, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Feb 15, 2023
@openjdk
Copy link

openjdk bot commented Feb 15, 2023

@tstuefe @jcking Pushed as commit 98a392c.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants