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,

I have completed the verification in an isolated environment (with our 16 MiB 
stack workaround completely removed and using standard JVM flags):

### Test Results
1. **Baseline (`Zulu 27.0.1`)**:
   - **7 out of 8 runs crashed** with `0xC0000005` (exit code `139` / 
`-1073741819`) and **zero `hs_err` logs** (`hs_err=0`), crashing across both 
initial startup and the second reboot session.
2. **JDK 27 Backport CI Build (`27.0.2-internal` from run `43782257129` with PR 
#33729 / JDK-8394484)**:
   - **5 out of 5 consecutive runs PASSED cleanly** (exit code `0`, all 119–120 
end-to-end runtime checks passed with 0 failures and zero crashes).

This confirms that the failure we hit in the field was Scenario 1 
(`JDK-8394484`), and **PR #33729 completely resolves it on JDK 27**. 

Huge thanks for initiating the backport so quickly! Your test data here 
strongly validates getting PR #33729 into JDK 27 updates. (Let me know if you'd 
still like me to run a sanity check against the JDK 28 PR #32365 build as well.)

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

PR Comment: https://git.openjdk.org/jdk/pull/32365#issuecomment-6905616642

Reply via email to