RFR: 8374469: Mixed jstack does not work on Windows [v6]
Yasumasa Suenaga
ysuenaga at openjdk.org
Sun Jan 11 07:45:11 UTC 2026
> When we run `jhsdb jstack --mixed` on Windows, we can see top of call frames only as following:
>
>
> ----------------- 4 -----------------
> "main" #3 prio=5 tid=0x0000021ee0357e90 nid=22356 waiting on condition [0x0000004ae7eff000]
> java.lang.Thread.State: TIMED_WAITING (sleeping)
> JavaThread state: _thread_blocked
> 0x00007ffca3c41c44 ntdll!NtWaitForSingleObject + 0x14
> ----------------- 5 -----------------
>
>
> This is long standing bugs since JDK 9 at least (maybe this includes older JDK releases).
> We cannot depend on base pointer to unwind call frames, but SA do that.
>
> This PR use [GetStackTrace](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/dbgeng/nf-dbgeng-idebugcontrol-getstacktrace) to find caller frame, then native call frames would be unwinded.
>
> However it has still problems for JIT'ed frames because it does not have a hint for unwinder like [RtlAddFunctionTable](https://learn.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-rtladdfunctiontable). But it would affect entire of JIT compilers, so I've limited the change to SA.
>
> This change passed serviceability/sa tests on Windows 11.
Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains nine additional commits since the last revision:
- Merge remote-tracking branch 'origin/master' into jhsdb-jstack-win
- Merge remote-tracking branch 'origin/master' into jhsdb-jstack-win
- Merge remote-tracking branch 'origin/master' into jhsdb-jstack-win
- Add comments
- Remove unused declaration
- Update src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java
Co-authored-by: Chris Plummer <chris.plummer at oracle.com>
- Fix split pattern for Windows
- Tweak toFrame()
- 8374469: Mixed jstack does not work on Windows
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/29019/files
- new: https://git.openjdk.org/jdk/pull/29019/files/f2530266..35d6fff2
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=29019&range=05
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=29019&range=04-05
Stats: 18 lines in 2 files changed: 7 ins; 0 del; 11 mod
Patch: https://git.openjdk.org/jdk/pull/29019.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/29019/head:pull/29019
PR: https://git.openjdk.org/jdk/pull/29019
More information about the serviceability-dev
mailing list