Integrated: 8352131: [REDO] C2: Print compilation bailouts with PrintCompilation compile command

Christian Hagedorn chagedorn at openjdk.org
Thu Mar 20 12:35:24 UTC 2025


On Wed, 19 Mar 2025 15:08:56 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

> We currently only print a compilation bailout with `-XX:+PrintCompilation`:
> 
> 7782 90 b 4 Test::main (19 bytes)
> 7792 90 b 4 Test::main (19 bytes) COMPILE SKIPPED: StressBailout
> 
> But not when using `-XX:CompileCommand=printcompilation,*::*`. This patch enables this.
> 
> The original fix with https://github.com/openjdk/jdk/pull/24031 missed the following: We release the memory for the directives here:
> https://github.com/openjdk/jdk/blob/fed34e46b89bc9b0462d9b5f5e5ab5516fe18c6e/src/hotspot/share/compiler/compileBroker.cpp#L2343
> 
> and then wrongly accessed the memory again to fetch `PrintCompilationOption` on this line:
> https://github.com/openjdk/jdk/blob/fed34e46b89bc9b0462d9b5f5e5ab5516fe18c6e/src/hotspot/share/compiler/compileBroker.cpp#L2377
> 
> This worked most of the time because the memory was not overridden, yet, but of course is a wrong use after free case. We only noticed this in some intermittent test failures where we suddenly dumped `COMPILE SKIPPED` where it was unexpected for tests.
> 
> I now moved the memory release down after we access it for `PrintCompilationOption`.
> 
> Thanks,
> Christian

This pull request has now been integrated.

Changeset: 2560a637
Author:    Christian Hagedorn <chagedorn at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/2560a63773ad8223e42d3ecf5bdcaaec30b001ee
Stats:     4 lines in 1 file changed: 2 ins; 1 del; 1 mod

8352131: [REDO] C2: Print compilation bailouts with PrintCompilation compile command

Reviewed-by: thartmann, kvn, epeter

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

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


More information about the hotspot-compiler-dev mailing list