Integrated: 8326615: C1/C2 don't handle allocation failure properly during initialization (RuntimeStub::new_runtime_stub fatal crash)
Damon Fenacci
dfenacci at openjdk.org
Tue Sep 3 09:48:25 UTC 2024
On Fri, 17 May 2024 09:37:01 GMT, Damon Fenacci <dfenacci at openjdk.org> wrote:
> # 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 `-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
>
> Instead of avoiding the crash it makes more sense to increase the minimum code cache size by adding the size of the minimal code cache needed for C1 and C2 to `CodeCacheMinimumUseSpace`.
This pull request has now been integrated.
Changeset: 633fad8e
Author: Damon Fenacci <dfenacci at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/633fad8e53109bef52190494a8b171035229d2ac
Stats: 36 lines in 7 files changed: 26 ins; 3 del; 7 mod
8326615: C1/C2 don't handle allocation failure properly during initialization (RuntimeStub::new_runtime_stub fatal crash)
Reviewed-by: thartmann, kvn
-------------
PR: https://git.openjdk.org/jdk/pull/19280
More information about the hotspot-compiler-dev
mailing list