[Desktop/Windows] App crashes on rapid window resize after extended conversation - conhost stack overflow + RADAR resource leak
Summary
Claude Code desktop app (Windows) crashes when rapidly resizing the window, but only after the conversation grows long. Short conversations (1-2 turns) are unaffected.
Environment
- OS: Windows 10 Home 10.0.19045
- Claude Code version: 2.1.150.0
- App type: Desktop (Electron)
Steps to Reproduce
- Have an extended conversation (many turns / long context)
- Rapidly resize the Claude Code window (drag edge quickly in and out)
- App crashes
Expected Behavior
App remains stable regardless of window resize speed or conversation length.
Actual Behavior
App crashes. Windows Error Reporting captures two distinct failure signatures:
1. RADAR_PRE_LEAK_64 - Resource exhaustion detected in claude.exe
Event: RADAR_PRE_LEAK_64
Application: claude.exe v2.1.150.0
OS: 10.0.19045
Timestamp: ~5 minutes before crash
Windows' Resource Exhaustion Detection and Recovery (RADAR) flagged claude.exe for pre-crash resource exhaustion. This is not heap memory (RAM usage remains stable) - RADAR tracks GDI handles, USER handles, and virtual address space. Likely cause: resize event listeners or DOM references accumulating without cleanup.
2. conhost.exe - Stack buffer overrun (0xc0000409)
Faulting application: conhost.exe v10.0.19041.5198
Exception code: 0xc0000409 (STATUS_STACK_BUFFER_OVERRUN)
Fault offset: 0x0000000000068eff <- identical across all crash instances
STATUS_STACK_BUFFER_OVERRUN is triggered by Windows /GS stack protection. The fault offset is identical across every crash, pointing to a deterministic code path. Likely cause: rapid resize triggers successive layout recalculations that recurse deeply enough to overflow the stack - the cost scales with conversation/DOM size, explaining why only long conversations are affected.
Hypothesis
Rapid resize
-> burst of resize events
-> event listeners / handles not cleaned up -> accumulate (RADAR_PRE_LEAK_64)
-> full DOM layout reflow on each event
-> deep recursion in layout engine -> stack overflow -> crash (0xc0000409)
The "only after long conversations" behavior is consistent: more DOM nodes = more expensive reflow = deeper recursion = easier to overflow the stack.
Suggested Fix Directions
- Debounce/throttle resize event handlers to prevent burst reflow
- Audit event listener cleanup on resize - ensure listeners are removed, not accumulated
- Virtualize conversation rendering to limit DOM size for long conversations
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗