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

8296012: jshell crashes on mismatched record pattern #11363

Closed
wants to merge 1 commit into from

Conversation

biboudis
Copy link
Member

@biboudis biboudis commented Nov 25, 2022

This bug prevents a crash in Flow while evaluating a switch expression in JShell. The error is successfully reported in Attr however entering an erroneous symbols prevents the crash.


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-8296012: jshell crashes on mismatched record pattern

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 11363

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 25, 2022

👋 Welcome back abimpoudis! 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 Nov 25, 2022
@openjdk
Copy link

openjdk bot commented Nov 25, 2022

@biboudis The following labels will be automatically applied to this pull request:

  • compiler
  • kulla

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added compiler compiler-dev@openjdk.org kulla kulla-dev@openjdk.org labels Nov 25, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 25, 2022

Webrevs

Copy link
Contributor

@vicente-romero-oracle vicente-romero-oracle left a comment

Choose a reason for hiding this comment

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

looks sensible

@openjdk
Copy link

openjdk bot commented Nov 29, 2022

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

8296012: jshell crashes on mismatched record pattern

Reviewed-by: vromero

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

  • ae5b1f7: 8297685: Typo in NullPointerException description specified by Locale.lookup
  • 3ce0042: 8297780: Problem list java/awt/Frame/RestoreToOppositeScreen/RestoreToOppositeScreen.java
  • b778cd5: 8295010: Reduce if required in EC limbs operations
  • 54e6d6a: 8293488: Add EOR3 backend rule for aarch64 SHA3 extension
  • 69ede5b: 8293177: Verify version numbers in legal files
  • cd6bebb: 8247645: ChaCha20 intrinsics
  • 33587ff: 8292625: jshell crash on "var a = a"
  • 2deb318: 8297065: DerOutputStream operations should not throw IOExceptions
  • d83a07b: 8297200: java/net/httpclient/SpecialHeadersTest.java failed once in AssertionError due to selector thread remaining alive
  • 5d2772a: 8297424: java/net/httpclient/AsyncExecutorShutdown.java fails in AssertionError due to misplaced assert
  • ... and 36 more: https://git.openjdk.org/jdk/compare/fd910f77bcd205110688b2f17f26f76ce3de88d5...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 (@vicente-romero-oracle) 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 Nov 29, 2022
@biboudis
Copy link
Member Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Nov 29, 2022
@openjdk
Copy link

openjdk bot commented Nov 29, 2022

@biboudis
Your change (at version 7f96b50) is now ready to be sponsored by a Committer.

@vicente-romero-oracle
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Nov 29, 2022

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

  • ae5b1f7: 8297685: Typo in NullPointerException description specified by Locale.lookup
  • 3ce0042: 8297780: Problem list java/awt/Frame/RestoreToOppositeScreen/RestoreToOppositeScreen.java
  • b778cd5: 8295010: Reduce if required in EC limbs operations
  • 54e6d6a: 8293488: Add EOR3 backend rule for aarch64 SHA3 extension
  • 69ede5b: 8293177: Verify version numbers in legal files
  • cd6bebb: 8247645: ChaCha20 intrinsics
  • 33587ff: 8292625: jshell crash on "var a = a"
  • 2deb318: 8297065: DerOutputStream operations should not throw IOExceptions
  • d83a07b: 8297200: java/net/httpclient/SpecialHeadersTest.java failed once in AssertionError due to selector thread remaining alive
  • 5d2772a: 8297424: java/net/httpclient/AsyncExecutorShutdown.java fails in AssertionError due to misplaced assert
  • ... and 36 more: https://git.openjdk.org/jdk/compare/fd910f77bcd205110688b2f17f26f76ce3de88d5...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 29, 2022
@openjdk openjdk bot closed this Nov 29, 2022
@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 Nov 29, 2022
@openjdk
Copy link

openjdk bot commented Nov 29, 2022

@vicente-romero-oracle @biboudis Pushed as commit 7af6b4b.

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

@TheShermanTanker
Copy link
Contributor

Just a heads up, this change seems to be responsible for the test failure on linux-x86 that's recently been persisting for quite a while

STDOUT:
config Test8296012.setUp(): failure
java.lang.IllegalStateException: Launching JShell execution engine threw: FailOverExecutionControlProvider: FAILED: 0:jdi:hostname(127.0.0.1) --
  Exception: java.lang.IllegalArgumentException: ERROR: JDWP unable to access JVMTI Version 1 (0x30010000), is your J2SE a 1.5 or newer version? JNIEnv's GetEnv() returned -3

Some closer examination suggests that something about the way this test is configured is not agreeing with the JVMTI implementation inside HotSpot:
src/hotspot/share/prims/jni.cpp GetEnv()

// No JVM TI with --enable-preview and no continuations support.
if (!VMContinuations && Arguments::enable_preview() && JvmtiExport::is_jvmti_version(version)) {
  *penv = NULL;
  ret = JNI_EVERSION;
  return ret;
}

(JNI_EVERSION is -3, which is the same error code the test failure produces)

I'm unfortunately not in the position to set up a Linux x86 environment and figure out what exactly is going wrong at the moment

@TheShermanTanker
Copy link
Contributor

Nevermind, the cause was simpler than I expected, -XX:-VMContinuations is not on by default for every platform. I've just created a quick fix for this

@biboudis
Copy link
Member Author

biboudis commented Dec 4, 2022

Thanks for the quick fix. However, why this commit triggered this failure? I assume --enable-preview is responsible for this. I wonder, no other JShell tests were passing --enable-preview before?

@lahodaj
Copy link
Contributor

lahodaj commented Dec 5, 2022

Hasn't the x86 failure been already resolved as #11428 ?

@TheShermanTanker
Copy link
Contributor

Hasn't the x86 failure been already resolved as #11428 ?

Not entirely, the test this change added also needed @requires vm.continuations as well. I've already pushed a fix for it, so it should be good now

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