RFR: 8326615: C1/C2 don't handle allocation failure properly during initialization (RuntimeStub::new_runtime_stub fatal crash) [v7]
Damon Fenacci
dfenacci at openjdk.org
Tue Aug 27 16:29:46 UTC 2024
> # Issue
>
> The test `compiler/startup/StartupOutput.java` fails intermittently due to a crash after correctly printing the error `Initial size of CodeCache is too small` (the test limits the code cache using k-XX:InitialCodeCacheSize=1024K -XX:ReservedCodeCacheSize=1200k`).
> The appearance of the issue is very dependent on thread scheduling. The original report happens during C1 initialization but C2 initialization is affected as well.
>
> # Causes
>
> There is one occurrence during C1 initialization and one during C2 initialization where a call to `RuntimeStub::new_runtime_stub` can fail fatally if there is not enough space left.
> For C1: `Compiler::init_c1_runtime` -> `Runtime1::initialize` -> `Runtime1::generate_blob_for` -> `Runtime1::generate_blob` -> `RuntimeStub::new_runtime_stub`.
> For C2: `C2Compiler::initialize` -> `OptoRuntime::generate` -> `OptoRuntime::generate_stub` -> `Compile::Compile` -> `Compile::Code_Gen` -> `PhaseOutput::install` -> `PhaseOutput::install_stub` -> `RuntimeStub::new_runtime_stub`.
>
> # Solution
>
> https://github.com/openjdk/jdk/pull/15970 introduced an optional argument to `RuntimeStub::new_runtime_stub` to determine if it fails fatally or not. We can take advantage of it to avoid crashing and instead pass the information about the success or failure of the allocation up the (C1 and C2 initialization) call stack up to where we can set the compilations as failed.
Damon Fenacci has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 23 commits:
- Merge tag 'jdk-24+7' into JDK-8326615
Added tag jdk-24+7 for changeset 21a6cf84
- JDK-8326615: calculate minimum code cache size based on initial compiler buffer sizes
- JDK-8326615 add forgotten problemlisted configuration after revert
- JDK-8326615 add forgotten problemlisted test after revert
- Revert "JDK-8326615: compiler/startup/StartupOutput.java intermittently Internal Error (codeBlob.cpp:429) Initial size of CodeCache is too small"
This reverts commit d3a5b2fd
- Revert "JDK-8326615: update copyright year"
This reverts commit bd0e039f562eecbf8f63eeb41b29f2703b6f0f17.
- Revert "Update src/hotspot/share/c1/c1_Compiler.cpp"
This reverts commit 5bf1a5ec5b05de15d55018dabdf48449f0ccb9a1.
- Revert "Update src/hotspot/share/c1/c1_Runtime1.cpp"
This reverts commit c505aac55825a34567fc55115b4ab9eb60a2cc71.
- Revert "JDK-8326615: handle allocation failures in barrier set"
This reverts commit bd2a7adfdf0cba845565ae1ee059323daa1b40db.
- Revert "JDK-8326615: update copyright year"
This reverts commit f16d9910cd44380a3f348b96d6ec15eea937920d.
- ... and 13 more: https://git.openjdk.org/jdk/compare/21a6cf84...f79d0a31
-------------
Changes: https://git.openjdk.org/jdk/pull/19280/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19280&range=06
Stats: 29 lines in 7 files changed: 22 ins; 2 del; 5 mod
Patch: https://git.openjdk.org/jdk/pull/19280.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/19280/head:pull/19280
PR: https://git.openjdk.org/jdk/pull/19280
More information about the hotspot-compiler-dev
mailing list