Skip to content
This repository has been archived by the owner. It is now read-only.

8266854: LibraryCallKit::inline_preconditions_checkIndex modifies control flow even if the intrinsic bailed out #114

Closed
wants to merge 2 commits into from

Conversation

@sviswa7
Copy link
Contributor

@sviswa7 sviswa7 commented Jun 22, 2021

LibraryCallKit::inline_preconditions_checkIndex can result in the following assert sometimes:
"# assert(ctrl == kit.control()) failed: Control flow was added although the intrinsic bailed out"

Consider the following code snippet:
...
set_control(_gvn.transform(new IfTrueNode(rc)));
{
PreserveJVMState pjvms(this);
set_control(_gvn.transform(new IfFalseNode(rc)));
uncommon_trap(Deoptimization::Reason_range_check,
Deoptimization::Action_make_not_entrant);
}
..
Here the control is being modified by set_control and afterwards a bailout happens.

The fix is as per discussion on openjdk/jdk#3958.

Best Regards,
Sandhya


Progress

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

Issue

  • JDK-8266854: LibraryCallKit::inline_preconditions_checkIndex modifies control flow even if the intrinsic bailed out

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 114

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jun 22, 2021

👋 Welcome back sviswanathan! 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.

Loading

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Good.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Jun 22, 2021

@sviswa7 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.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Jun 22, 2021

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

8266854: LibraryCallKit::inline_preconditions_checkIndex modifies control flow even if the intrinsic bailed out

Reviewed-by: kvn, jbhateja, vlivanov

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

  • 1b2147a: 8269125: Klass enqueue element size calculation wrong when traceid value cross compress limit
  • bf70620: 8268961: Parenthesized pattern with guards does not work
  • 8128ca1: 8269066: assert(ZAddress::is_marked(addr)) failed: Should be marked
  • 1323be5: 8269064: Dropped messages of AsyncLogWriter cause memleak
  • ce917b2: 8269148: Update minor GCC version in GitHub Actions pipeline
  • ab7ff1e: 8266885: [aarch64] Crash with 'Field too big for insn' for some tests under compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/
  • 35e4c27: 8268404: [TESTBUG] tools/jpackage/windows/WinInstallerIconTest.java failed "AssertionError: Failed: Check icon"
  • dc12cb7: 8267652: c2 loop unrolling by 8 results in reading memory past array
  • 578c55b: 8267399: C2: java/text/Normalizer/ConformanceTest.java test failed with assertion
  • 8fa2520: 8268888: Upstream 8268230: Foreign Linker API & Windows user32/kernel32: String conversion seems broken
  • ... and 6 more: https://git.openjdk.java.net/jdk17/compare/d3ad8cd344681fe8442f821f97f05996bb972abe...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.

Loading

@openjdk openjdk bot added the ready label Jun 22, 2021
@sviswa7 sviswa7 marked this pull request as ready for review Jun 22, 2021
@openjdk openjdk bot added the rfr label Jun 22, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jun 22, 2021

Webrevs

Loading

@sviswa7
Copy link
Contributor Author

@sviswa7 sviswa7 commented Jun 22, 2021

Created a separate RFE for test case https://bugs.openjdk.java.net/browse/JDK-8269107.

Loading

@@ -1032,17 +1032,17 @@ bool LibraryCallKit::inline_preconditions_checkIndex(BasicType bt) {
Deoptimization::Action_make_not_entrant);
}

if (stopped()) {
Copy link
Member

@jatin-bhateja jatin-bhateja Jun 22, 2021

Choose a reason for hiding this comment

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

Hi @sviswa7, comments over both the short-circuiting exits will help in better code readability.

Loading

Copy link
Contributor Author

@sviswa7 sviswa7 Jun 23, 2021

Choose a reason for hiding this comment

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

@jatin-bhateja Added comments, please take a look.

Loading

Copy link
Member

@jatin-bhateja jatin-bhateja left a comment

Thanks @sviswa7

Loading

@sviswa7
Copy link
Contributor Author

@sviswa7 sviswa7 commented Jun 23, 2021

@vnkozlov Can I go ahead and integrate this into JDK 17?

Loading

Copy link

@iwanowww iwanowww left a comment

Looks good.

Loading

@sviswa7
Copy link
Contributor Author

@sviswa7 sviswa7 commented Jun 23, 2021

/integrate

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Jun 23, 2021

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

  • 7e96318: 8254571: Erroneous generic type inference in a lambda expression with a checked exception
  • 1b2147a: 8269125: Klass enqueue element size calculation wrong when traceid value cross compress limit
  • bf70620: 8268961: Parenthesized pattern with guards does not work
  • 8128ca1: 8269066: assert(ZAddress::is_marked(addr)) failed: Should be marked
  • 1323be5: 8269064: Dropped messages of AsyncLogWriter cause memleak
  • ce917b2: 8269148: Update minor GCC version in GitHub Actions pipeline
  • ab7ff1e: 8266885: [aarch64] Crash with 'Field too big for insn' for some tests under compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/
  • 35e4c27: 8268404: [TESTBUG] tools/jpackage/windows/WinInstallerIconTest.java failed "AssertionError: Failed: Check icon"
  • dc12cb7: 8267652: c2 loop unrolling by 8 results in reading memory past array
  • 578c55b: 8267399: C2: java/text/Normalizer/ConformanceTest.java test failed with assertion
  • ... and 7 more: https://git.openjdk.java.net/jdk17/compare/d3ad8cd344681fe8442f821f97f05996bb972abe...master

Your commit was automatically rebased without conflicts.

Loading

@openjdk openjdk bot closed this Jun 23, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Jun 23, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jun 23, 2021

@sviswa7 Pushed as commit b474314.

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

Loading

@vnkozlov
Copy link
Contributor

@vnkozlov vnkozlov commented Jun 23, 2021

Yes, you can and you did already 👍

Loading

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants