Skip to content

8278965: crash in SymbolTable::do_lookup#4544

Open
pengxiaolong wants to merge 1 commit into
openjdk:masterfrom
pengxiaolong:jdk17-backport-8278965
Open

8278965: crash in SymbolTable::do_lookup#4544
pengxiaolong wants to merge 1 commit into
openjdk:masterfrom
pengxiaolong:jdk17-backport-8278965

Conversation

@pengxiaolong

@pengxiaolong pengxiaolong commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Backport of 582b943 (openjdk/jdk@582b943). Keeps the superclass name alive while a parallel thread loads the superclass, preventing a refcount underflow.

Adaptation for 17u: Mainline's fix only needed to change systemDictionary.cpp because the placeholder-table supername refcounting was already correct there (introduced by JDK-8292286, Convert PlaceholderTable to ResourceHashtable, which is not in 17u). Rather than backport that structural refactor, this PR open-codes the equivalent behavior on the legacy Hashtable-based PlaceholderTable:

  • set_supername() now decrements the replaced supername before adopting the new one.
  • find_and_remove() keeps the supername alive until the whole entry is removed (released by free_entry), instead of clearing it as soon as the super-load
    queue empties.
  • new_entry() initializes _supername to NULL before the first set_supername(), since the legacy table allocates entries as raw, unconstructed memory.

The added gtest declares its symbols as raw Symbol* (not TempNewSymbol) so the TempSymbol cleanup delayer (JDK-8315559) doesn't bump their starting refcount, and releases them manually.

Testing:

  • gtest:PlaceholderTable passes; full gtest:all (908 tests) passes.
  • tier1~tier4


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8278965 needs maintainer approval

Warning

 ⚠️ Found leading lowercase letter in issue title for 8278965: crash in SymbolTable::do_lookup

Issue

  • JDK-8278965: crash in SymbolTable::do_lookup (Bug - P3)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4544

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jun 26, 2026

Copy link
Copy Markdown

👋 Welcome back xpeng! 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 Jun 26, 2026

Copy link
Copy Markdown

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

@pengxiaolong pengxiaolong changed the title Backport 582b943439488a0f43482b67c0bc0d4975bf4023. 8278965: crash in SymbolTable::do_lookup Jun 26, 2026
@pengxiaolong pengxiaolong force-pushed the jdk17-backport-8278965 branch from 62ac155 to 354b734 Compare June 26, 2026 07:16
@pengxiaolong pengxiaolong changed the title 8278965: crash in SymbolTable::do_lookup Backport 582b943439488a0f43482b67c0bc0d4975bf4023 Jun 26, 2026
@openjdk openjdk Bot changed the title Backport 582b943439488a0f43482b67c0bc0d4975bf4023 8278965: crash in SymbolTable::do_lookup Jun 26, 2026
@openjdk

openjdk Bot commented Jun 26, 2026

Copy link
Copy Markdown

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

@openjdk openjdk Bot added the backport Port of a pull request already in a different code base label Jun 26, 2026
@pengxiaolong pengxiaolong marked this pull request as ready for review June 26, 2026 07:36
@openjdk openjdk Bot added the rfr Pull request is ready for review label Jun 26, 2026
@mlbridge

mlbridge Bot commented Jun 26, 2026

Copy link
Copy Markdown

Webrevs

@pengxiaolong pengxiaolong marked this pull request as draft June 26, 2026 08:16
@openjdk openjdk Bot removed the rfr Pull request is ready for review label Jun 26, 2026
@pengxiaolong pengxiaolong force-pushed the jdk17-backport-8278965 branch from 354b734 to fa2ce5a Compare June 26, 2026 15:19
@pengxiaolong pengxiaolong force-pushed the jdk17-backport-8278965 branch from fa2ce5a to 41ced4f Compare June 26, 2026 15:47
@pengxiaolong pengxiaolong marked this pull request as ready for review June 26, 2026 16:09
@openjdk openjdk Bot added the rfr Pull request is ready for review label Jun 26, 2026
@pengxiaolong

Copy link
Copy Markdown
Contributor Author

Hi @coleenp, could you review this backport? It fixes the crash in SymbolTable::do_lookup.
It's not a clean backport: the fix landed in JDK 21 on top of JDK-8267935 (https://bugs.openjdk.org/browse/JDK-8267935), which replaced Hashtable with ResourceHashtable. Since that change isn't in JDK 17, I had to adapt both the fix and the test to the older Hashtable-based code.

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 rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant