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

Christian Hagedorn chagedorn at openjdk.org
Thu Mar 20 12:35:23 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

Thanks Emanuel for your review!

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

PR Comment: https://git.openjdk.org/jdk/pull/24117#issuecomment-2740305151


More information about the hotspot-compiler-dev mailing list