Skip to content

8300944: Test vmTestbase/gc/gctests/WeakReference/weak005/weak005.java fails with "Last weak reference has not been cleared" - #32422

Draft
shivshah-oracle wants to merge 1 commit into
openjdk:masterfrom
shivshah-oracle:JDK-8300944
Draft

8300944: Test vmTestbase/gc/gctests/WeakReference/weak005/weak005.java fails with "Last weak reference has not been cleared"#32422
shivshah-oracle wants to merge 1 commit into
openjdk:masterfrom
shivshah-oracle:JDK-8300944

Conversation

@shivshah-oracle

@shivshah-oracle shivshah-oracle commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

The test builds a chain of weak references, clears the array entries from the beginning, and expects the final reference to be cleared by a full GC. If GC runs just before the penultimate entry is cleared, that reference is still strongly reachable from the array while its referent is not. GC may clear it and place it on the pending reference list, which keeps the reference object alive until the reference handler processes it. Clearing its array entry afterward does not remove that reachability, so the final reference may legally remain uncleared.



Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8300944: Test vmTestbase/gc/gctests/WeakReference/weak005/weak005.java fails with "Last weak reference has not been cleared" (Bug - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 32422

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32422.diff

…a fails with "Last weak reference has not been cleared"
@bridgekeeper

bridgekeeper Bot commented Aug 18, 2026

Copy link
Copy Markdown

👋 Welcome back shivshah-oracle! 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 18, 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 8300944: Test vmTestbase/gc/gctests/WeakReference/weak005/weak005.java fails with "Last weak reference has not been cleared 8300944: Test vmTestbase/gc/gctests/WeakReference/weak005/weak005.java fails with "Last weak reference has not been cleared" Aug 18, 2026
@openjdk openjdk Bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Aug 18, 2026
@openjdk

openjdk Bot commented Aug 18, 2026

Copy link
Copy Markdown

@shivshah-oracle The following label will be automatically applied to this pull request:

  • hotspot-gc

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 commented Aug 18, 2026

Copy link
Copy Markdown

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot-gc. This can be overridden with the /reviewers command.

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

Labels

hotspot-gc hotspot-gc-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

1 participant