Integrated: 8353341: C2: removal of a Mod[DF]Node crashes when the node is already dead

Marc Chevalier mchevalier at openjdk.org
Thu Apr 3 08:41:12 UTC 2025


On Wed, 2 Apr 2025 07:19:35 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:

> If the Mod[DF]Node has no control projection when it's being removed (because its result is unused), `extract_projections` will fail an assert. So, let's skip the removal.
> 
> But that should happen only when the nodes are already unreachable (control input being transitively top). At the end of the day, the node should be dropped. because of that, so there is no rush, and let dead node deletion do the job.
> 
> On the reduced reproducer, the crash is not common (even with `-XX:RepeatCompilation=300`, it might need more than a run to reproduce). So I've tried my fix on multiple thousands repeat compilations (by 300 packs) without a crash, and without having the modulo node alive at the end.
> 
> For instance, that's what happen on the reproducer. Quickly, some big sub-graph is dead, but nodes stay a while in the graph:
> <img src="https://github.com/user-attachments/assets/7956771a-4bc4-4ab6-9207-3954cf067868" width="300">
> Then:
> <img src="https://github.com/user-attachments/assets/012868df-0d14-4292-aaeb-b342391ebbcd" width="300">
> And eventually, everything is removed, so the control projection is removed, and `extract_projections` doesn't like it.
> <img src="https://github.com/user-attachments/assets/cf20b745-cf86-48ba-94df-078aa50cdd45" width="300">
> 
> Thanks,
> Marc

This pull request has now been integrated.

Changeset: 00a038e9
Author:    Marc Chevalier <mchevalier at openjdk.org>
Committer: Christian Hagedorn <chagedorn at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/00a038e9c559401b7934f30b4719010bb1024291
Stats:     95 lines in 2 files changed: 93 ins; 0 del; 2 mod

8353341: C2: removal of a Mod[DF]Node crashes when the node is already dead

Reviewed-by: thartmann, chagedorn

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

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


More information about the hotspot-compiler-dev mailing list