Skip to content
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

8284883: JVM crash: guarantee(sect->end() <= sect->limit()) failed: sanity on AVX512 #8457

Closed
wants to merge 6 commits into from

Conversation

dean-long
Copy link
Member

@dean-long dean-long commented Apr 28, 2022

This fix prevents overflowing the C2 scratch buffer for large ClearArray operations. I also noticed that when IdealizeClearArrayNode is turned off, the "is_large" flag on the ClearArray node was not set correctly, so I fixed that too.

I could use some help testing the x86_32 change.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8284883: JVM crash: guarantee(sect->end() <= sect->limit()) failed: sanity on AVX512

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/8457/head:pull/8457
$ git checkout pull/8457

Update a local copy of the PR:
$ git checkout pull/8457
$ git pull https://git.openjdk.java.net/jdk pull/8457/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8457

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/8457.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 28, 2022

👋 Welcome back dlong! 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 label Apr 28, 2022
@openjdk
Copy link

openjdk bot commented Apr 28, 2022

@dean-long The following label will be automatically applied to this pull request:

  • hotspot-compiler

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-compiler label Apr 28, 2022
@mlbridge
Copy link

mlbridge bot commented Apr 28, 2022

Webrevs

Copy link
Contributor

@vnkozlov vnkozlov left a comment

I think we should fix code in MacroAssembler::clear_mem() to generate loop code (4 in loop and remaining after it) instead of line of instructions if more then 8 64-bytes move instructions are generated.
Even with 256 value, you suggested, there will be 32 instructions. Originally it was assumed that !is_large() will be true for arrays with < InitArrayShortSize (64) so you will have only 8 instructions. But, as you said, InitArrayShortSize could be set to ridiculous value.
Also forcing use Mach instruction with value loaded into register may affect spilling in surrounding code.

@dean-long
Copy link
Member Author

dean-long commented Apr 28, 2022

@vnkozlov OK, good suggestion. Let me try that.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Exactly like that. Good!

@openjdk
Copy link

openjdk bot commented Apr 29, 2022

@dean-long 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:

8284883: JVM crash: guarantee(sect->end() <= sect->limit()) failed: sanity on AVX512

Reviewed-by: kvn, jbhateja

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

  • 0a4a640: 8285301: C2: assert(!requires_atomic_access) failed: can't ensure atomicity
  • 40f19c0: 8264666: Change implementation of safeAdd/safeMult in the LCMSImageLayout class
  • 1e28fcb: 8155701: The compiler fails with an AssertionError: typeSig ERROR
  • 99388ef: 8283624: Create an automated regression test for RFE-4390885
  • 94b533a: 8285699: riscv: Provide information when hitting a HaltNode
  • e2e943a: 8285688: Add links to JEPs and JSRs to SourceVersion
  • 80cf59f: 8285610: TreeInfo.pathFor and its uses appear to be dead code
  • 21b62fe: 8195589: T6587786.java failed after JDK-8189997
  • 8190217: 8285496: DocLint does not check for missing @param tags for type parameters on classes and interfaces
  • 64d98ba: 8285094: Test java/awt/Frame/InvisibleOwner/InvisibleOwner.java failing on Linux
  • ... and 1 more: https://git.openjdk.java.net/jdk/compare/bba456a8dbf9027e4b015567c17a79fc7441aa08...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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Apr 29, 2022
@jatin-bhateja
Copy link
Member

jatin-bhateja commented Apr 29, 2022

Hi @dean-long ,

We already have a loop to perform system initialization if is_large flag is set over ClearArray.
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/memnode.cpp#L3091
Code bloating will occur if user sets InitArrayShortSize to a very large value, earlier we were emitting 8 bytes store which was later improved to use vector instructions. Your fix to emit a loop for large constant sized initialization will make this flow full proof.

Best Regards,
Jatin
PS: We still may face code bloating with UseAVX=0 which still emit 8 byte stores for initialization.
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/memnode.cpp#L3111

@dean-long
Copy link
Member Author

dean-long commented Apr 29, 2022

Thanks Vladimir and Jatin!

@dean-long
Copy link
Member Author

dean-long commented Apr 29, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Apr 29, 2022

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

  • 3d07b3c: 8282227: Locale information for nb is not working properly
  • cfe67af: 8285938: ProblemList jdk/jshell/HighlightUITest.java on linux-x64
  • 67dd8a8: 8285686: Upgrade to FreeType 2.12.0
  • 64225e1: 8285919: Remove debug printout from JDK-8285093
  • df4d5cf: 8285802: AArch64: Consistently handle offsets in MacroAssembler as 64-bit quantities
  • 694556e: 8225433: Clarify behavior of PKIXParameters.setRevocationEnabled when PKIXRevocationChecker is used
  • e98ac23: 8285793: C2: optimization of mask checks in counted loops fail in the presence of cast nodes
  • 669ac61: 8274597: Some of the dnd tests time out and fail intermittently
  • 269eae6: 8285515: (dc) DatagramChannel.disconnect fails with "Invalid argument" on macOS 12.4 beta2
  • c4f7a85: 8285828: runtime/execstack/TestCheckJDK.java fails with zipped debug symbols
  • ... and 15 more: https://git.openjdk.java.net/jdk/compare/bba456a8dbf9027e4b015567c17a79fc7441aa08...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated label Apr 29, 2022
@openjdk openjdk bot closed this Apr 29, 2022
@openjdk openjdk bot removed ready rfr labels Apr 29, 2022
@openjdk
Copy link

openjdk bot commented Apr 29, 2022

@dean-long Pushed as commit cd8709e.

💡 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-compiler integrated
3 participants