On Fri, 17 Apr 2026 15:02:44 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). > > That looks nice, but why is it so rare? Shouldn't it happen a bit all the > time with this flag? I think there are a lot of places where we call `Compile::failing` (there are 31 references in `Compile::Optimize`), and since we randomly fail at each call, that's quite the sequence of events. The probability is _quite low_ @marc-chevalier. ------------- PR Comment: https://git.openjdk.org/valhalla/pull/2332#issuecomment-4269278117
