Skip to content

Fix Windows ConPTY process-list fallback - #3009

Merged
Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/windows-crash-on-startup-since-1.4.32-heap-corru
May 28, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/windows-crash-on-startup-since-1.4.32-heap-corru

Conversation

@Jinwoo-H

Copy link
Copy Markdown
Contributor

Summary

  • patch node-pty's Windows conpty_console_list_agent so AttachConsole failures fall back to the shell PID instead of throwing
  • refresh the pnpm patch hash in the lockfile

Repro / validation

  • Reproduced locally on Windows with current 1.4.33 code: pnpm dev rendered Orca, but stderr showed node-pty/lib/conpty_console_list_agent.js throwing Error: AttachConsole failed during startup cleanup.
  • Reduced repro with Electron-as-Node + node-pty.spawn(...).kill() printed the same helper stack before the patch.
  • After the patch, the reduced repro exits cleanly with no helper stack.
  • After the patch, pnpm dev with a fresh ORCA_DEV_USER_DATA_PATH rendered Orca; Playwright confirmed the window identity matched this worktree; stderr scan found no AttachConsole failed / conpty_console_list_agent stack.

Related to #2997. I did not reproduce the exact 0xc0000374 heap-corruption crash, but this fixes the Windows ConPTY helper failure reproduced locally in the same startup area.

@Jinwoo-H
Jinwoo-H merged commit ff687a3 into main May 28, 2026
2 checks passed
@Jinwoo-H
Jinwoo-H deleted the Jinwoo-H/windows-crash-on-startup-since-1.4.32-heap-corru branch May 28, 2026 22:35
@MrViSiOn

Copy link
Copy Markdown

Update from the original reporter (#2997). I tested the merged fix on
version 1.4.35.0 and the crash persists. Crucially, comparing the
WER reports before and after the fix shows the StackHash is byte-for-byte
identical
, which means the heap corruption is happening at the exact
same point in the call stack — the fix has not touched the code path
that's actually crashing.

Comparison: WER signatures before vs. after the fix

Field 1.4.33 (before) 1.4.35 (after PR #3009)
ExceptionCode c0000374 c0000374
Faulting module ntdll.dll (10.0.26100.8328) ntdll.dll (10.0.26100.8328)
Faulting offset 0x1627F4 0x1627F4
StackHash (DynamicSig22) 0cec1953d814d595f291e48aef93bab1 0cec1953d814d595f291e48aef93bab1 ✅
AdditionalInfo (Sig24) 40eaf3994955e23d3dc226ae200446d9 40eaf3994955e23d3dc226ae200446d9 ✅
BucketId ca73297130f9a1744468adeee883d1a4 1a46c811bd6328c164376b9fe93ef4de

The BucketId differs only because Windows includes the app version in
the bucket. The StackHash and StackHash-derived AdditionalInfo are
identical, so it's the same crash.

Loaded-modules diff (potentially useful)

In 1.4.33, the crashing process had loaded the DirectX/MediaFoundation
stack before dying: d3d11.dll, dxgi.dll, dxcore.dll,
directxdatabasehelper.dll, D3D10Warp.dll, Microsoft.Internal.WarpPal.dll,
dcomp.dll, mf.dll, mfplat.dll, MFCORE.DLL, RTWorkQ.DLL.

In 1.4.35 none of those modules are loaded at crash time. Only
CoreUIComponents.dll was added. This suggests the crash in 1.4.35 is
hitting earlier in startup than in 1.4.33 — before the graphics/MF
stack is brought up — yet still ends up at the same ntdll offset with
the same StackHash, and with conpty.node already loaded.

Native modules loaded in both crashes

  • resources\app.asar.unpacked\node_modules\node-pty\build\Release\conpty.node
  • resources\app.asar.unpacked\node_modules\cpu-features\build\Release\cpufeatures.node

Environment

  • OS: Windows 11 Pro, build 26200 (ubr 8457)
  • 64 GB RAM
  • Last known good version: 1.4.3 (still stable on rollback)

Happy to share the full Report.wer files and the .dmp if useful.
The dump should let you see the actual call stack going into ntdll —
might point at a different allocation/free path in node-pty than the
one the PR targeted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants