On Fri, 17 Apr 2026 15:58:59 GMT, Marc Chevalier <[email protected]> wrote:

>> This PR prevents a segmentation fault during `Compile::process_inline_types` 
>> caused by a missing check for failure.
>> 
>> This was originally spotted on our CI when running 
>> `applications/ctw/modules/java_desktop.java` with `StressBailout`, and is 
>> reproducible with replay compilation.
>> 
>> Near the end of `Compile::Optimize`, we have:
>> https://github.com/openjdk/valhalla/blob/f29dba868499db3b1369efee8ea22365efa36849/src/hotspot/share/opto/compile.cpp#L3238-L3243
>> 
>> In `Compile::process_late_inline_calls_no_inline`, we have a `if (failing()) 
>>  return;` check. When using `StressBailout`, this might trigger a 
>> compilation bailout.
>> 
>> Before valhalla this was fine because there is a failure check a few lines 
>> after the call to `process_late_inline_calls_no_inline`. Now we also have 
>> `process_inline_types(igvn)`, and this can go very wrong if `C->root()` is 
>> `nullptr`. Therefore we need a new `if failing()` check before processing 
>> the inline types.
>> 
>> I have checked other usages of `process_inline_types` and it seems there is 
>> no cause for concern there.
>> 
>> I don't think it's worth it to try to produce a regression test here as it 
>> would rely on setting a stress seed and would therefore be very sensitive.
>> 
>> ### Testing
>> - [ ] tier1-3, plus some internal testing
>> 
>> Thank you for reviewing!
>> 
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> So, if I trick the code to make it not fail elsewhere, but here with high 
> probability, it should happen very often, on many tests?

@marc-chevalier yes, most likely.

Thank for reviewing @marc-chevalier @TobiHartmann @merykitty!

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

PR Comment: https://git.openjdk.org/valhalla/pull/2332#issuecomment-4278545358

Reply via email to