Skip to content

Avoid double-closing Windows ConPTY handles - #3359

Merged
Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/windows-packaged-heap-corruption
May 29, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/windows-packaged-heap-corruption

Conversation

@Jinwoo-H

Copy link
Copy Markdown
Contributor

Summary

  • avoid calling destroy() after an intentional Windows PTY kill() because node-pty implements Windows destroy() as another kill
  • keep natural-exit cleanup intact so Windows ConPTY teardown still runs when no explicit kill happened
  • add regression tests for hidden rate-limit PTYs and local PTY shutdown/orphan cleanup

Evidence

  • user-provided Orca.exe.21960.dmp confirms Orca.exe 1.4.35.0 still hit 0xc0000374 heap-corruption termination
  • parsed dump showed the crashing thread in ntdll.dll with conpty.node present in stack memory
  • this points at the same native ConPTY cleanup class as the recent Windows startup crashes, but not fully fixed by Fix Windows ConPTY process-list fallback #3009

Testing

  • pnpm exec vitest run --config config/vitest.config.ts src/main/rate-limits/hidden-pty-cleanup.test.ts src/main/providers/local-pty-provider.test.ts
  • pnpm run typecheck:node

Notes

  • src/main/ipc/pty.test.ts still has unrelated Windows-host failures from POSIX path/newline expectations; those failures were not introduced by this change.

@Jinwoo-H
Jinwoo-H merged commit 5692800 into main May 29, 2026
2 checks passed
@Jinwoo-H
Jinwoo-H deleted the Jinwoo-H/windows-packaged-heap-corruption branch May 29, 2026 23:17
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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.

1 participant