Skip to content

8376286: VM asserts with "assert(false) failed: Possible safepoint reached by thread that does not allow it" when running with -XX:+ExitOnFullCodeCache#31667

Open
0zzy0sbourne wants to merge 1 commit into
openjdk:masterfrom
0zzy0sbourne:JDK-8376286-exit-on-full-codecache

Conversation

@0zzy0sbourne

@0zzy0sbourne 0zzy0sbourne commented Jun 24, 2026

Copy link
Copy Markdown

With -XX:+ExitOnFullCodeCache, handle_full_code_cache() calls before_exit() directly from a compiler thread. This triggers an assertion failure because compiler threads are not allowed to reach a safepoint, and before_exit() acquires the BeforeExit_lock which may safepoint.

Replace the manual before_exit() + exit_globals() + vm_direct_exit() sequence with vm_exit(), which transitions the thread state to _thread_in_vm before initiating shutdown, making safepoint-reaching operations legal.

Reproducible with

java -XX:+ExitOnFullCodeCache -XX:NonNMethodCodeHeapSize=500M -XX:ReservedCodeCacheSize=512008K -version

Testing

Built hotspot (linux-x86_64-server-release) successfully.



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-8376286: VM asserts with "assert(false) failed: Possible safepoint reached by thread that does not allow it" when running with -XX:+ExitOnFullCodeCache (Bug - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31667

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

Using diff file

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

Using Webrev

Link to Webrev Comment

…es not allow it when running with -XX:+ExitOnFullCodeCache

Replace the manual before_exit() + exit_globals() + vm_direct_exit()
sequence with vm_exit() which correctly transitions the compiler
thread state to _thread_in_vm before initiating shutdown, allowing
it to safely acquire locks that may reach a safepoint.
@bridgekeeper

bridgekeeper Bot commented Jun 24, 2026

Copy link
Copy Markdown

👋 Welcome back 0zzy0sbourne! 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 24, 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 added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Jun 24, 2026
@openjdk

openjdk Bot commented Jun 24, 2026

Copy link
Copy Markdown

@0zzy0sbourne The following label will be automatically applied to this pull request:

  • hotspot-compiler

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 Jun 24, 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-compiler. This can be overridden with the /reviewers command.

@0zzy0sbourne 0zzy0sbourne marked this pull request as ready for review June 25, 2026 08:04
@openjdk openjdk Bot added the rfr Pull request is ready for review label Jun 25, 2026
@mlbridge

mlbridge Bot commented Jun 25, 2026

Copy link
Copy Markdown

Webrevs

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

Labels

hotspot-compiler hotspot-compiler-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant