8066859: java/lang/ref/OOMEInReferenceHandler.java failed with java.lang.Exception: Reference Handler thread died#9427
8066859: java/lang/ref/OOMEInReferenceHandler.java failed with java.lang.Exception: Reference Handler thread died#9427DougLea wants to merge 11 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back dl! A progress list of the required criteria for merging this PR into |
|
@DougLea this pull request can not be integrated into git checkout JDK-8066859
git fetch https://git.openjdk.org/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
|
Thanks to @AlanBateman for suggesting to disable possibly misleading stack traces in pre-allocated exceptions; now updated |
|
I keep trying but failing to change commit message to something jcheck likes? |
There should be an "Edit" button in the top right that allows you to edit the title and change it to "8066859 : java/lang/ref/OOMEInReferenceHandler.java failed ...". There are two Skara commands that may be useful here. |
|
/issue JDK-8066859 |
|
@DougLea The primary solved issue for a PR is set through the PR title. Since the current title does not contain an issue reference, it will now be updated. |
| byte spins = 0, postSpins = 0; // retries upon unpark of first thread | ||
| boolean interrupted = false, first = false; | ||
| Node pred = null; // predecessor of node when enqueued | ||
| Node pred = null, t; // predecessor of node when enqueued |
There was a problem hiding this comment.
Nit: please don't use this style of multi-variable declaration as they are very easy to mis-read. Also the comment only applies to one of the variables.
| } | ||
| } | ||
| if (!isHeldExclusively() || !release(savedState = getState())) | ||
| throw LockSupport.staticIllegalMonitorStateException; // OOM |
There was a problem hiding this comment.
How is it possible to get IMSE this deep into the code? And the comment is confusing - OOM?
There was a problem hiding this comment.
Clarified to:
// fall through if encountered OutOfMemoryError
if (!isHeldExclusively() || !release(savedState = getState()))
throw LockSupport.staticIllegalMonitorStateException;
| /** | ||
| * Preallocated exceptions thrown if acquiring or releasing locks | ||
| * when OutOfMemory. | ||
| */ |
There was a problem hiding this comment.
I don't see why this should be necessary. IMSE is thrown before any state changes occur and so it is is fine if the IMSE is replaced by OOME.
Even IE should be safe at the points it is thrown.
Also in both cases you want to see a full and proper stacktrace.
There was a problem hiding this comment.
Consider this another way, any place you have a throw x it must be safe to propagate that exception. It doesn't matter if that is actually x or an OOME caused by creating x.
There was a problem hiding this comment.
On further consideration, I agree. The very low probability that an IE or IMSE would enable further handling is not worth the extra startup cost of establishing static exceptions. Updated.
|
The idea here is that a non-OOME-throwing condition wait might be required for (some) memory to be reclaimed. This is not too farfetched for InterruptedException (if serving as a cancellation), so we allow it to be thrown (instead of OOME) in hopes that a catch of IE will free memory. It IS farfetched to think this might be the case for IllegalMonitorStateException, but I did it the same way for consistency. |
Webrevs
|
test/jdk/ProblemList.txt
Outdated
| java/lang/invoke/lambda/LambdaFileEncodingSerialization.java 8249079 linux-x64 | ||
| java/lang/invoke/RicochetTest.java 8251969 generic-all | ||
| java/lang/ref/OOMEInReferenceHandler.java 8066859 generic-all | ||
| java/lang/CompressExpandTest.java 8287851 generic-all |
There was a problem hiding this comment.
There may be merge issue here. JDK-8287851 was fixed last week and the CompressExpandTest.java removed from the exclude list at the same time.
| @@ -0,0 +1,107 @@ | |||
| //package concurrent; | |||
There was a problem hiding this comment.
Do you mind adding a copyright header to the test?
|
@DougLea 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 43 new commits pushed to the
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 |
|
/integrate |
|
Going to push as commit 5358045.
Your commit was automatically rebased without conflicts. |
| // fall through if encountered OutOfMemoryError | ||
| if (!isHeldExclusively() || !release(savedState = getState())) | ||
| throw new IllegalMonitorStateException(); |
There was a problem hiding this comment.
I still don't see how an OOME can possibly indicate we might somehow be in a state where we need to throw IMSE!
8066859 : java/lang/ref/OOMEInReferenceHandler.java failed with java.lang.Exception: Reference Handler thread died
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9427/head:pull/9427$ git checkout pull/9427Update a local copy of the PR:
$ git checkout pull/9427$ git pull https://git.openjdk.org/jdk pull/9427/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9427View PR using the GUI difftool:
$ git pr show -t 9427Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9427.diff