-
Notifications
You must be signed in to change notification settings - Fork 6k
8342775: [Graal] java/util/concurrent/locks/Lock/OOMEInAQS.java fails OOME thrown from the UncaughtExceptionHandler #21745
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
Conversation
… OOME thrown from the UncaughtExceptionHandler
👋 Welcome back never! A progress list of the required criteria for merging this PR into |
@tkrodriguez 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:
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 2 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
@tkrodriguez The following label will be automatically applied to this pull request:
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. |
Webrevs
|
static final int NTHREADS = 2; // intentionally not a scalable test; > 2 is very slow | ||
// Intentionaly non-final to avoid EA of the threads array in main which can cause this test to | ||
// fail in Xcomp mode. | ||
static int NTHREADS = 2; // intentionally not a scalable test; > 2 is very slow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Tom, I don't have the necessary knowledge of runtime compilers, so consider this as drive-by questions than a review.
On its own, the static final
construct appears to be the correct one for this field. Removing the final
to address an escape analysis implementation detail appears odd.
Do you know if the failure happens only in -Xcomp
mode? Looking at JDK-8342775 it wasn't clear to me that was the case. If it's happening only in -Xcomp
mode, perhaps due to additional work being done by the compiler threads (?) and the fact that this test intentional runs with a very low -Xmx
, maybe we should just skip the test from -Xcomp
mode instead of changing the field declaration? We have several such tests which we skip in -Xcomp
mode by using:
@requires (vm.compMode != "Xcomp")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to actually execute the test which is trying ensure that OOM is handled by library code in all configurations. Using final is just a stylistic choice in the harness so removing it to allow to test to run in more configurations seems like better than avoiding those configurations.
@tkrodriguez This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@tkrodriguez This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
/open |
@tkrodriguez This pull request is now open |
@AlanBateman Could you take a look at this one? |
@tkrodriguez I'm a bit hesitant about the proposed change—it sounds to me like it relies too much on implementation details. If EA is decides to treat NTHREADS as effectively final (at some point) then this test will start failing again under Xcomp. What are the alternatives here? |
I'm not sure there are a lot of great alternatives. There's no easy global solution to the problem of EA being unable to materialize values during deopt so these kinds of problems crop up in tests, particularly with Xcomp. So the choices boil down to don't run it under Xcomp with Graal or work around it. Something about the structure of this test reliably causes a unreached deopt in this code path and that seems to caused of some relatively recent random JDK change as this had been passing previously. Modifying the test in this way seem like a pragmatic way of dealing with it. The main is effectively the harness, so the change has no effect on the validity of the test itself. We can always revisit this if it crops up again. But I'm happy to make whatever change you'd prefer. |
Changing the test this way does not sit well with me either. This adjustment to the test is far too intricately entwined with the implementation details of a particular JIT. I'm much more inclined to exclude Xcomp mode for OOME tests; or perhaps just disable EA (if Graal supports that) so we get most Xcomp coverage whilst side-stepping the EA issue. |
I've disabled the test for Graal with Xcomp. Is that an acceptable solution? Testing indicates that it properly stops it for Graal without affecting other configurations. |
Yes, this should be okay. |
Hello Tom, the change to the |
At the time it was filed, OOMEInStampedLock.java didn't exist but it's a direct clone of OOMEInAQS.java and has the exact same problem in our testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix.
Thanks! /integrate |
Going to push as commit bb837d2.
Your commit was automatically rebased without conflicts. |
@tkrodriguez Pushed as commit bb837d2. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Deoptimization with escape analysis can fail when trying to rematerialize objects as described in JDK-8227309. In this test this can happen in Xcomp mode in the framework of the test resulting in a test failure. Making the number of threads non-final avoids scalar replacement and thus the OOM during deopt.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21745/head:pull/21745
$ git checkout pull/21745
Update a local copy of the PR:
$ git checkout pull/21745
$ git pull https://git.openjdk.org/jdk.git pull/21745/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 21745
View PR using the GUI difftool:
$ git pr show -t 21745
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21745.diff
Using Webrev
Link to Webrev Comment