Skip to content

Fix infinite recursion crash in FileDropOverlayView.mouseDown - #69

Closed
austinywang wants to merge 1 commit into
mainfrom
cmux/fix-infinite-loop
Closed

austinywang wants to merge 1 commit into
mainfrom
cmux/fix-infinite-loop

Conversation

@austinywang

Copy link
Copy Markdown
Contributor

Summary

  • Fixes 6 crashes (Feb 18) + 4 hangs + 2 CPU resource violations (Feb 17) caused by infinite recursion in FileDropOverlayView.forwardEvent()
  • The hide-send-unhide mouse forwarding pattern recurses because NSWindow.sendEvent: routes the event back to the same overlay view without re-doing hit testing
  • Adds a simple isForwarding reentrancy guard to break the cycle

Test plan

  • Launch app, click around terminal splits — mouse events still pass through the overlay
  • Drag files from Finder onto terminal splits — drops still work
  • Verify no crashes in Console.app / crash reporter after extended use

🤖 Generated with Claude Code

The hide-send-unhide pattern in forwardEvent() causes infinite recursion
because NSWindow.sendEvent: doesn't always re-do hit testing for mouse
events — it routes the event back to the same overlay view, creating a
loop that overflows the 8MB stack after ~43K frames.

Add a reentrancy guard so re-entrant calls from sendEvent: are dropped.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cmux-agent

cmux-agent Bot commented Feb 18, 2026 •

Copy link
Copy Markdown
Contributor

Preview Videos and Screenshots

Open Workspace (1 hr expiry) · Open Dev Browser (1 hr expiry) · Open Diff Heatmap

Screenshot capture was skipped.

No UI changes detected - screenshots skipped


Generated by manaflow preview system

@vercel

vercel Bot commented Feb 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Feb 18, 2026 10:30pm

@austinywang

Copy link
Copy Markdown
Contributor Author

Closing in favor of #68 which is a better fix — direct dispatch via hit-test instead of reentrancy guard that would silently swallow mouse events.

This branch was successfully deployed

1 active deployment
Preview — 7317834b Deployed Feb 18, 2026 by vercel[bot]
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