[jdk21u-dev] Integrated: 8324345: Stack overflow during C2 compilation when splitting memory phi

Satyen Subramaniam ssubramaniam at openjdk.org
Sat May 10 03:14:04 UTC 2025


On Tue, 22 Apr 2025 16:55:51 GMT, Satyen Subramaniam <ssubramaniam at openjdk.org> wrote:

> Backporting JDK-8324345: Stack overflow during C2 compilation when splitting memory phi. In some cases ConnectionGraph::find_inst_mem contains recursive calls that can lead to a native C++ stack overflow - this changeset takes the following action to address this. Adds a simple recursion depth limit to ConnectionGraph::find_inst_mem. When find_inst_mem reaches the limit, we bail out from the current compilation and retry without escape analysis. The depth limit is currently set to a fixed value of 1000, and a regression test `TestFindInstMemRecursion.java`. Also removes the implicit memory limit (due to [JDK-8331185](https://bugs.openjdk.org/browse/JDK-8331185)) from `VectorReplicateLongSpecialImmTest.java`: The memory limit triggers after this changeset, but the (potential) problem is most likely unrelated to this issue, addressed in [JDK-8337821](https://bugs.openjdk.org/browse/JDK-8337821). Ran GHA Sanity Checks, local Tier 1 and 2, and new `test/hotspot/jtreg/compiler/escapeAna
 lysis/TestFindInstMemRecursion.java` tests. Patch is clean.

This pull request has now been integrated.

Changeset: b654313e
Author:    Satyen Subramaniam <ssubramaniam at openjdk.org>
Committer: Paul Hohensee <phh at openjdk.org>
URL:       https://git.openjdk.org/jdk21u-dev/commit/b654313e4f6dc261fbdbc2123915f8a7a33d8aeb
Stats:     63 lines in 4 files changed: 54 ins; 0 del; 9 mod

8324345: Stack overflow during C2 compilation when splitting memory phi

Backport-of: fdb4350fcecef1915cdbc27ece24153a1b6c884d

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

PR: https://git.openjdk.org/jdk21u-dev/pull/1692


More information about the jdk-updates-dev mailing list