On Mon, 16 Nov 2026 01:16:47 GMT, Ashay Rane <[email protected]> wrote:
>> Hello @raneashay @dean-long, >> >> Thank you for this monumental effort on Windows stack handling. I wanted to >> share a concrete real-world production failure from the field that directly >> validates the necessity of this PR. >> >> In our runtime environment on **Windows x64 with JDK 27**, we hit this exact >> failure during an asynchronous shader compilation pipeline driven by Project >> Panama (FFM) downcalls and upcalls (`Shaderc` bindings via >> `jdk.internal.foreign`): >> >> ### The Crash Pattern >> - **Symptom:** Silent process termination with unhandled NTSTATUS >> `0xC0000005` (Access Violation), without triggering `StackOverflowError` and >> **without generating any `hs_err` log**. >> - **Context:** A newly spawned `ForkJoinWorkerThread` with only ~102 KB of >> stack committed out of 1024 KB reserved. >> - **Faulting Instruction:** C2 JIT nmethod entry for >> `jdk/internal/foreign/StringSupport$CharsetKind.of` (invoked via an FFM >> upcall stub): >> >> DowncallStub.invoke >> -> UpcallStub.invoke >> -> DirectMethodHandle$Interface.checkReceiver >> -> java.lang.Class.getName >> -> jdk.internal.foreign.StringSupport$CharsetKind.of <-- Faulting PC (C2 >> nmethod code entry) >> >> - **Memory Analysis:** Minidump / ProcDump analysis confirmed that the C2 >> nmethod's far-access stack bang (`RSP - 0x8000`) jumped into an uncommitted >> guard page. Because the Windows incremental stack commit mechanism was not >> engaged sequentially, Windows dropped it as an untracked access violation, >> crashing the JVM before SEH could recover it. >> >> Our application-level workaround was to isolate the FFM pipeline onto >> dedicated threads with a 16 MiB stack, but having this proper far-access >> probe recovery merged into upstream HotSpot will be a massive stability >> boost for real-world applications leveraging Project Panama on Windows. >> >> Looking forward to seeing this integrated! > > Hi @FuBangkun, thanks for sharing the problem that you're running into. And > thanks also for triaging the problem at your end! > > There are a couple of scenarios that could explain the crash that you saw, > one of which was addressed just last week in > https://github.com/openjdk/jdk/pull/33729. I have just now initiated > backporting of that patch to JDK27 and CI builds are running at > https://github.com/raneashay/jdk-27/actions/runs/43782257129. If you were > running into this scenario, then PR 33729's patch (and the JDK27 build from > the link above) might work for you. > > The other possible scenario is that the downcall stub allocated its frame > without a stack bang, so at this point, the stack could already be in a bad > state, which makes it hard to hypothesize what could have happened next. > That problem is addressed by this PR's changes (specifically, on Windows, the > downcall stub first probes the allocation). There are a few other fixes in > this PR (like the default stack shadow pages being bumped to 20 pages to > match other OSes) that could be relevant. > > I have merged the master branch into this PR's branch, which should trigger > the CI build. If the JDK27 Windows/x64 build from above doesn't fix the > issue, would you be willing to try the JDK tip (i.e. JDK28) build that's > produced by this PR's CI (from > https://github.com/raneashay/openjdk-jdk/actions/runs/43785113617) to see if > that resolves the issue? Hi @raneashay, Thank you so much for initiating the JDK 27 backport and setting up these CI builds! I would be glad to help verify them. I'm keeping an eye on both workflow runs right now. Once the Windows/x64 artifacts are ready, I'll temporarily disable our 16 MiB stack workaround to restore the baseline crash condition, test the JDK 27 build first (and the JDK 28 tip build if needed), and report the exact results back here. ------------- PR Comment: https://git.openjdk.org/jdk/pull/32365#issuecomment-6904806340
