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

8273933: [TESTBUG] Test must run without preallocated exceptions #5560

Closed

Conversation

neliasso
Copy link

@neliasso neliasso commented Sep 17, 2021

Executing vmTestbase/jit/t/t105/t105.java with the fix for (JDK-8273277) makes the test fail when run with the following arguments:

-XX:+TieredCompilation
-XX:Tier0BackedgeNotifyFreqLog=0
-XX:Tier2BackedgeNotifyFreqLog=0
-XX:Tier3BackedgeNotifyFreqLog=0
-XX:Tier2BackEdgeThreshold=1
-XX:Tier3BackEdgeThreshold=1
-XX:Tier4BackEdgeThreshold=1
-Xbatch

The problem is that the tests expects a detailed message from ArrayIndexOutOfBoundsException, but this test will trigger the optimization that reuses preallocated exceptions that have an empty detailed exceptions.

It is wrong for the test to assume exceptions messages.

Solution disable preallocated exceptions with the flag -XX:-ProfileTraps.


Progress

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

Issue

  • JDK-8273933: [TESTBUG] Test must run without preallocated exceptions

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5560

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 17, 2021

👋 Welcome back neliasso! 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
Copy link

openjdk bot commented Sep 17, 2021

@neliasso 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 hotspot-compiler-dev@openjdk.org label Sep 17, 2021
@neliasso neliasso changed the title [TESTBUG] Test must run without preallocated exceptions 8273933: [TESTBUG] Test must run without preallocated exceptions Sep 17, 2021
@neliasso neliasso marked this pull request as ready for review September 17, 2021 09:43
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 17, 2021
@mlbridge
Copy link

mlbridge bot commented Sep 17, 2021

Webrevs

Copy link
Member

@chhagedorn chhagedorn left a comment

Choose a reason for hiding this comment

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

That sounds reasonable. You should also update the copyright year.

@openjdk
Copy link

openjdk bot commented Sep 17, 2021

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

8273933: [TESTBUG] Test must run without preallocated exceptions

Reviewed-by: chagedorn, thartmann

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

  • 9aa12da: 8273934: Remove unused perfcounters
  • 4da45c4: 8270609: [TESTBUG] java/awt/print/Dialog/DialogCopies.java does not show instruction
  • 544193a: 8247980: Exclusive execution of java/util/stream tests slows down tier1
  • 1f8af52: 8273314: Add tier4 test groups
  • 699865f: 8259039: Passing different version to --release flag than javac version output warning
  • f71df14: 8273187: jtools tests fail with missing markerName check
  • 6f3e40c: 8273825: TestIRMatching.java fails after JDK-8266550
  • a561eac: 8273895: compiler/ciReplay/TestVMNoCompLevel.java fails due to wrong data size with TieredStopAtLevel=2,3
  • d2388b7: 8273959: Some metaspace diagnostic switches should be develop
  • dc7f452: 8273815: move have_special_privileges to os_posix for POSIX platforms
  • ... and 114 more: https://git.openjdk.java.net/jdk/compare/dc33bd8b6cfa9a9cd71d7065d284a807774750a2...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 Sep 17, 2021
Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

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

Just wondering, why does -XX:-OmitStackTraceInFastThrow not help?

@mlbridge
Copy link

mlbridge bot commented Sep 20, 2021

Mailing list message from Nils Eliasson on hotspot-compiler-dev:

On 2021-09-20 08:11, Tobias Hartmann wrote:

On Fri, 17 Sep 2021 14:20:07 GMT, Nils Eliasson <neliasso at openjdk.org> wrote:

Executing vmTestbase/jit/t/t105/t105.java with the fix for (JDK-8273277) makes the test fail when run with the following arguments:

-XX:+TieredCompilation
-XX:Tier0BackedgeNotifyFreqLog=0
-XX:Tier2BackedgeNotifyFreqLog=0
-XX:Tier3BackedgeNotifyFreqLog=0
-XX:Tier2BackEdgeThreshold=1
-XX:Tier3BackEdgeThreshold=1
-XX:Tier4BackEdgeThreshold=1
-Xbatch

The problem is that the tests expects a detailed message from ArrayIndexOutOfBoundsException, but this test will trigger the optimization that reuses preallocated exceptions that have an empty detailed exceptions.

It is wrong for the test to assume exceptions messages.

Solution disable preallocated exceptions with the flag -XX:-ProfileTraps.
Nils Eliasson has updated the pull request incrementally with one additional commit since the last revision:

Update copyright year
Just wondering, why does `-XX:-OmitStackTraceInFastThrow` not help?

That flag should work too - both are needed:

? if (treat_throw_as_hot
????? && (!StackTraceInThrowable || OmitStackTraceInFastThrow)) {

Where treat_throw_as_hot is dependent on the ProfileTraps flag and the
trap count.

Copy link
Member

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

@neliasso
Copy link
Author

I changed the patch to disable OmitStackTraceInFastThrow instead of ProfileTraps, after a suggestion from @TobiHartmann. Disabling ProfileTraps has more side effects - so just disabling OmitStackTraceInFastThrow should keeps the test environment closer to default.

Copy link
Member

@chhagedorn chhagedorn 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!

@neliasso
Copy link
Author

@TobiHartmann and @chhagedorn - Thanks for the review!

@neliasso
Copy link
Author

/integrate

@openjdk
Copy link

openjdk bot commented Sep 20, 2021

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

  • 9aa12da: 8273934: Remove unused perfcounters
  • 4da45c4: 8270609: [TESTBUG] java/awt/print/Dialog/DialogCopies.java does not show instruction
  • 544193a: 8247980: Exclusive execution of java/util/stream tests slows down tier1
  • 1f8af52: 8273314: Add tier4 test groups
  • 699865f: 8259039: Passing different version to --release flag than javac version output warning
  • f71df14: 8273187: jtools tests fail with missing markerName check
  • 6f3e40c: 8273825: TestIRMatching.java fails after JDK-8266550
  • a561eac: 8273895: compiler/ciReplay/TestVMNoCompLevel.java fails due to wrong data size with TieredStopAtLevel=2,3
  • d2388b7: 8273959: Some metaspace diagnostic switches should be develop
  • dc7f452: 8273815: move have_special_privileges to os_posix for POSIX platforms
  • ... and 114 more: https://git.openjdk.java.net/jdk/compare/dc33bd8b6cfa9a9cd71d7065d284a807774750a2...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Sep 20, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 20, 2021
@openjdk
Copy link

openjdk bot commented Sep 20, 2021

@neliasso Pushed as commit 4d95a5d.

💡 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 hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
3 participants