RFR: 8320302: compiler/arguments/TestC1Globals.java hits SIGSEGV in ContinuationEntry::set_enter_code [v3]

Patricio Chilano Mateo pchilanomate at openjdk.org
Mon Feb 5 23:52:11 UTC 2024


> When creating Continuation.enterSpecial/doYield special native nmethods we currently assume the call to nmethod::new_native_nmethod() always succeeds. If the CodeCache happens to be full though, creating the nmethod will fail and we'll hit a SIGSEGV when trying to dereference the return value. 
> 
> Since this happens the first time those methods are resolved, throwing an exception at that point implying that we cannot run virtual threads looks odd from a user perspective. So instead I added a step to initialize the Continuation class at startup so that failure to create those nmethods is treated early as a fatal error as we do with any other critical resource needed by the VM. I measured the added step to the startup sequence to be ~90us, or about 0.3% of the total startup time.
> 
> I verified the fix by running the test mentioned in the bug plus I also run tiers1-5 in mach5.
> 
> Thanks,
> Patricio

Patricio Chilano Mateo has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:

 - Merge branch 'master' into JDK-8320302
 - use vm_exit_during_initialization instead of fatal
 - inline call to initialize cont class
 - v1

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/17455/files
  - new: https://git.openjdk.org/jdk/pull/17455/files/be77c877..3c96d8ae

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=17455&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17455&range=01-02

  Stats: 34174 lines in 1737 files changed: 16155 ins; 5201 del; 12818 mod
  Patch: https://git.openjdk.org/jdk/pull/17455.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17455/head:pull/17455

PR: https://git.openjdk.org/jdk/pull/17455


More information about the hotspot-dev mailing list