Integrated: 8357781: Deep recursion in PhaseCFG::set_next_call leads to stack overflow
Marc Chevalier
mchevalier at openjdk.org
Wed May 28 07:55:05 UTC 2025
On Mon, 26 May 2025 12:07:08 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:
> There is nothing very wrong here:
> - the graph is not broken
> - the algorithm is correct
>
> It just happens that the graph is very deep, it has a very long, narrow chain of nodes because of crazy unrolling, because of `LoopUnrollLimit=8192`. This depth simply makes the algorithm recurse deeper than the stack size allows. This kind of graph shape is not quite trivial to reproduce. The proposed reproducer is very easy to change into a non-reproducer, with many kinds of change, even that seem harmless to me.
>
> The fix is also pretty direct: let's change the recursive traversal, with a worklist-based iterative one. It's not as elegant, but it doesn't overflow.
>
> How sad stacks are still so bounded...
This pull request has now been integrated.
Changeset: 1d57ff8a
Author: Marc Chevalier <mchevalier at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/1d57ff8ad4938bc9ca9b1996eb200c1b51bdf300
Stats: 82 lines in 3 files changed: 74 ins; 0 del; 8 mod
8357781: Deep recursion in PhaseCFG::set_next_call leads to stack overflow
Reviewed-by: thartmann, kvn, mhaessig
-------------
PR: https://git.openjdk.org/jdk/pull/25448
More information about the hotspot-compiler-dev
mailing list