Skip to content

8369944: Notification can be lost due to interrupt in Object.wait - #703

Open
theaoqi wants to merge 1 commit into
openjdk:masterfrom
openjdk-bots:backport-theaoqi-6e898e21-master
Open

8369944: Notification can be lost due to interrupt in Object.wait#703
theaoqi wants to merge 1 commit into
openjdk:masterfrom
openjdk-bots:backport-theaoqi-6e898e21-master

Conversation

@theaoqi

@theaoqi theaoqi commented Aug 6, 2026

Copy link
Copy Markdown
Member

This is a clean backport of JDK-8369944 from mainline. The original change removes the redundant _notified field from ObjectWaiter and uses node.TState exclusively to determine whether a thread was notified.

On LoongArch64, this fix addresses a low-probability crash: guarantee(node.TState != ObjectWaiter::TS_WAIT) failed: invariant.

The crash is possibly due to the ordering between TState and _notified not being guaranteed on weakly-ordered architectures. Applying this patch resolves the crash.



Progress

  • JDK-8369944 needs maintainer approval
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8369944: Notification can be lost due to interrupt in Object.wait (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk25u-dev.git pull/703/head:pull/703
$ git checkout pull/703

Update a local copy of the PR:
$ git checkout pull/703
$ git pull https://git.openjdk.org/jdk25u-dev.git pull/703/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 703

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk25u-dev/pull/703.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Aug 6, 2026

Copy link
Copy Markdown

👋 Welcome back aoqi! 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 commented Aug 6, 2026

Copy link
Copy Markdown

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot changed the title Backport 6e898e21130259839e8060245c70182f70d8ee12 8369944: Notification can be lost due to interrupt in Object.wait Aug 6, 2026
@openjdk

openjdk Bot commented Aug 6, 2026

Copy link
Copy Markdown

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk Bot added backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required labels Aug 6, 2026
@theaoqi
theaoqi marked this pull request as ready for review August 6, 2026 13:07
@openjdk

openjdk Bot commented Aug 6, 2026

Copy link
Copy Markdown

⚠️ @theaoqi This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Aug 6, 2026
@mlbridge

mlbridge Bot commented Aug 6, 2026

Copy link
Copy Markdown

Webrevs

@theaoqi

theaoqi commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

/approval request Clean backport of JDK-8369944. The fix removes the redundant _notified field from ObjectWaiter and uses node.TState exclusively to determine notification state, fixing a bug due to unordered reads of independent volatile fields. JDK-8369944 has been in JDK 26 since GA (~5 months) with no reported regressions. Locally tested tier1/tier2/tier3 on x86_64 (release and fastdebug), no issues found. The risk is low: the fix simplifies the code by removing a redundant state field.

@openjdk

openjdk Bot commented Aug 11, 2026

Copy link
Copy Markdown

@theaoqi
8369944: The approval request has been created successfully.

@openjdk openjdk Bot added the approval Requires approval; will be removed when approval is received label Aug 11, 2026
@GoeLin

GoeLin commented Aug 13, 2026

Copy link
Copy Markdown
Member

Hi @theaoqi
please give a reason why you want to backport this.
Also, which is the change that causes this? How long does the problem exist?

@openjdk openjdk Bot removed the approval Requires approval; will be removed when approval is received label Aug 13, 2026
@theaoqi

theaoqi commented Aug 14, 2026

Copy link
Copy Markdown
Member Author

Hi @GoeLin ,

Thanks for the reply.

The reason I am requesting this backport is as follows. It started because this backport fixes a crash on the LoongArch platform. However, note that OpenJDK does not officially support LoongArch (JIT), and this crash occurs in our self-maintained repository. Still, we think this issue may also affect other weakly-ordered architectures, which is why I am requesting this backport. I cannot confirm whether other platforms can actually reproduce this issue since I lack the testing environment.

The problem first became observable after JDK-8343840 and its corresponding LoongArch port, so it has been visible for over a year now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants