JDK-8318900 : Add more bailouts to fatal paths in C2
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8u341,11,17,21,22
  • Priority: P2
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2023-10-26
  • Updated: 2024-06-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
Similar to JDK-8318889, we should evaluate if we have other fatal asserts in C2 that detect situations we can't recover from, i.e. that (could) lead to a crash in product, and that we (often) hit in the past. If their detection is feasible and not too expensive in release builds, we should add compilation bailouts.

Examples:
- loopnode.cpp:155: assert(false) failed: Bad graph detected in get_early_ctrl_for_expensive JDK-8229994
- loopnode.hpp:1140: assert(n != nullptr) failed: Bad immediate dominator info JDK-8314024, JDK-8319372
- matcher.cpp:1591: assert(false) failed: bad AD file JDK-8289043 (I think we've never seen this with crashes in product but it seems to be cheap enough to bail out anyway)
- loopnode.cpp:5665: assert(!had_error) failed: bad dominance or "Bad graph detected in compute_lca_of_uses" JDK-8318690 (This seems very expensive though but lead to crashes in the past, see JDK-8078262)
- gcm.cpp:276: assert(false) failed: unscheduable graph JDK-8283466 (might be too expensive but we've seen crashes in the past JDK-8218961)
- loopopts.cpp:1598: assert(!n->is_Store() && !n->is_LoadStore()) failed: no node with a side effect JDK-8286625

Probably harmless but we should verify:
- gcm.cpp:830: assert(store->find_edge(load) != -1) failed: missing precedence edge JDK-8265132
- chaitin.cpp:1661: "No dead instructions after post-alloc" and postaloc.cpp:140: "unexpected yanked node" JDK-8210389

Feel free to add to this list.
Comments
I filed this as an enhancement for now because it yet has to be evaluated if bailouts are even feasible. We might want to convert this to a bug later.
03-11-2023

Added some C2 experts as watchers. If you can think of any other place / assert that fits above requirements, please add it to the list. The idea is not to convert all the assert(false, ...) that we have in C2 but critical ones where we hit issues in release builds in the past.
26-10-2023