-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8347406: [REDO] C1/C2 don't handle allocation failure properly during initialization (RuntimeStub::new_runtime_stub fatal crash) #23630
base: master
Are you sure you want to change the base?
Conversation
…nal Error (codeBlob.cpp:429) Initial size of CodeCache is too small
Co-authored-by: Tobias Hartmann <[email protected]>
Co-authored-by: Tobias Hartmann <[email protected]>
Co-authored-by: Tobias Hartmann <[email protected]>
Co-authored-by: Tobias Hartmann <[email protected]>
👋 Welcome back dfenacci! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@dafedafe this pull request can not be integrated into git checkout JDK-8347406
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
Issue
The test
src/hotspot/share/opto/c2compiler.cpp
fails intermittently due to a crash that happens when trying to allocate code cache space for C1 and C2 inRuntimeStub::new_runtime_stub
andSingletonBlob::operator new
.Causes
There are a few call paths during the initialization of C1 and C2 that can lead to the code cache allocations in
RuntimeStub::new_runtime_stub
(throughRuntimeStub::operator new
) andSingletonBlob::operator new
triggering a fatal error if there is no more space. The paths in question are:Compiler::init_c1_runtime
->Runtime1::initialize
->Runtime1::generate_blob_for
->Runtime1::generate_blob
->RuntimeStub::new_runtime_stub
C2Compiler::initialize
->C2Compiler::init_c2_runtime
->OptoRuntime::generate
->OptoRuntime::generate_stub
->Compile::Compile
->Compile::Code_Gen
->PhaseOutput::install
->PhaseOutput::install_stub
->RuntimeStub::new_runtime_stub
C2Compiler::initialize
->C2Compiler::init_c2_runtime
->OptoRuntime::generate
->OptoRuntime::generate_uncommon_trap_blob
->UncommonTrapBlob::create
->new UncommonTrapBlob
C2Compiler::initialize
->C2Compiler::init_c2_runtime
->OptoRuntime::generate
->OptoRuntime::generate_exception_blob
->ExceptionBlob::create
->new ExceptionBlob
Solution
Instead of fatally crashing the we can use the
alloc_fail_is_fatal
flag ofRuntimeStub::new_runtime_stub
to avoid crashing in cases 1 and 2 and add a similar flag toSingletonBlob::operator new
for cases 3 and 4. In the latter case we need to adjust all calls accordingly.Note: In JDK-8326615 it was argued that increasing the minimum code cache size would solve the issue but that wasn't entirely accurate: doing so possibly decreases the chances of a failed allocation in these 4 places but doesn't totally avoid it.
Testing
The original failing regression test in
test/hotspot/jtreg/compiler/startup/StartupOutput.java
has been modified to run multiple times with randomized values (within the original failing range) to increase the chances of hitting the fatal assertion.Tests: Tier 1-4 (windows-x64, linux-x64, linux-aarch64, and macosx-x64; release and debug mode)
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23630/head:pull/23630
$ git checkout pull/23630
Update a local copy of the PR:
$ git checkout pull/23630
$ git pull https://git.openjdk.org/jdk.git pull/23630/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23630
View PR using the GUI difftool:
$ git pr show -t 23630
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23630.diff