Skip to content

fix(mac): initialize task profilers before resuming processes - #18

Draft
not-matthias wants to merge 1 commit into
codspeedfrom
fix/mac-task-initialization
Draft

not-matthias wants to merge 1 commit into
codspeedfrom
fix/mac-task-initialization

Conversation

@not-matthias

Copy link
Copy Markdown
Member

TLDR: Keep accepted processes suspended until the sampler finishes initial thread and library discovery, preventing short-lived processes from exiting during initialization (macOS only).

  • Add a rendezvous acknowledgment after each task initialization attempt, including failures.
  • Resume the process after acknowledgment or sampler disconnection.
  • Extracted from feat(linux): support frame-pointer-only recording #12; contains only the two macOS files, with no Linux unwinding changes.

Validation: rustfmt and whitespace checks passed. macOS runtime validation is still needed; this draft was prepared on Linux.

Wait for the sampler to finish task initialization before releasing the preload handshake or resuming an attached task. Otherwise short-lived root processes can exit while their initial threads and libraries are still being read, causing the sampler to panic.

Reuse one rendezvous channel for task initialization. Release the accepter after each initialization attempt, including failures, so processes do not remain suspended when sampling stops.
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