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

8312573: Failure during CompileOnly parsing leads to ShouldNotReachHere #19

Closed
wants to merge 2 commits into from

Conversation

TobiHartmann
Copy link
Member

@TobiHartmann TobiHartmann commented Jul 27, 2023

Parsing of -XX:CompileOnly= hits a ShouldNotReachHere for , and arguments. The fix is to remove the assumption that className can only be null for method_sep because the parsing loop also exits on , and :

for (i = 0;
i < 1024 && *line != '\0' && *line != method_sep && *line != ',' && !isspace(*line);
line++, i++) {
name[i] = *line;
if (name[i] == '.') name[i] = '/'; // package prefix uses '/'
}

Instead, a missing class name is handled as "Any" class match in all the cases.

I'm fixing this in JDK 21u because the issue was fixed in in JDK 22 as a side effect of JDK-8027711. The VM now prints an error:

CompileOnly: An error occurred during parsing
Line: ','
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Thanks,
Tobias


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-8312573: Failure during CompileOnly parsing leads to ShouldNotReachHere (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk21u/pull/19.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 27, 2023

👋 Welcome back thartmann! 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 Jul 27, 2023
@mlbridge
Copy link

mlbridge bot commented Jul 27, 2023

Webrevs

Copy link

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Good.

@openjdk
Copy link

openjdk bot commented Jul 27, 2023

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

8312573: Failure during CompileOnly parsing leads to ShouldNotReachHere

Reviewed-by: kvn, tholenstein

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

  • 5c6cd06: Merge
  • 731b2e9: 8313316: Disable runtime/ErrorHandling/MachCodeFramesInErrorFile.java on ppc64le
  • 0439d58: 8300937: Update nroff pages in JDK 21 before RC
  • bb63b79: 8313260: JDK21: ProblemList java/lang/ScopedValue/StressStackOverflow.java on linux-x86
  • f242c3b: 8313241: Temporarily disable "malformed control flow" assert to reduce noise
  • 1c875fd: 8313250: Exclude java/foreign/TestByteBuffer.java on AIX
  • 3e9344a: 8312293: SIGSEGV in jfr.internal.event.EventWriter.putUncheckedByte after JDK-8312086
  • a10dbce: 8313208: ProblemList java/util/concurrent/tck/JSR166TestCase.java on select platforms
  • f666e60: 8313193: ProblemList java/util/concurrent/SynchronousQueue/Fairness.java on X64
  • d65f1c8: 8312395: Improve assertions in growableArray
  • ... and 8 more: https://git.openjdk.org/jdk21u/compare/e04b3061fc146203730929364e22f08930eb378d...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 Pull request is ready to be integrated label Jul 27, 2023
@TobiHartmann
Copy link
Member Author

Thanks, Vladimir!

Copy link

@tobiasholenstein tobiasholenstein left a comment

Choose a reason for hiding this comment

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

Looks good to me

c_match = MethodMatcher::Any;
}
}
if (className == NULL || className[0] == '\0') {

Choose a reason for hiding this comment

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

Suggested change
if (className == NULL || className[0] == '\0') {
if (className == nullptr || className[0] == '\0') {

Choose a reason for hiding this comment

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

I think it should be nullptr

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! Fixed.

@TobiHartmann
Copy link
Member Author

Thanks for the review, Toby.

@TobiHartmann
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Aug 2, 2023

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

  • 5c6cd06: Merge
  • 731b2e9: 8313316: Disable runtime/ErrorHandling/MachCodeFramesInErrorFile.java on ppc64le
  • 0439d58: 8300937: Update nroff pages in JDK 21 before RC
  • bb63b79: 8313260: JDK21: ProblemList java/lang/ScopedValue/StressStackOverflow.java on linux-x86
  • f242c3b: 8313241: Temporarily disable "malformed control flow" assert to reduce noise
  • 1c875fd: 8313250: Exclude java/foreign/TestByteBuffer.java on AIX
  • 3e9344a: 8312293: SIGSEGV in jfr.internal.event.EventWriter.putUncheckedByte after JDK-8312086
  • a10dbce: 8313208: ProblemList java/util/concurrent/tck/JSR166TestCase.java on select platforms
  • f666e60: 8313193: ProblemList java/util/concurrent/SynchronousQueue/Fairness.java on X64
  • d65f1c8: 8312395: Improve assertions in growableArray
  • ... and 8 more: https://git.openjdk.org/jdk21u/compare/e04b3061fc146203730929364e22f08930eb378d...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Aug 2, 2023

@TobiHartmann Pushed as commit 6f76b65.

💡 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
integrated Pull request has been integrated
3 participants