Skip to content

fix(fspy): avoid recursive syscall initialization - #854

Merged
wan9chi merged 4 commits into
mainfrom
fix/fspy-syscall-recursion
Oct 14, 2026
Merged

wan9chi merged 4 commits into
mainfrom
fix/fspy-syscall-recursion

Conversation

@fengmk2

@fengmk2 fengmk2 commented Oct 14, 2026

Copy link
Copy Markdown
Member

Motivation

Concurrent calls to syscall can make tracked Linux programs, such as pnpm dlx, abort with a stack overflow. LazyLock waits through futex, which calls the same syscall hook before its initialization completes.

The hook now sends system calls directly to the kernel and preserves libc return values and errno.

Fixes the stack overflow in the Vite+ create job.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +0.68%  [ -9.21% ..  +9.67%]  overhead   +49.67%
dynamic/access             change  -0.57%  [-17.30% ..  +6.38%]  overhead   +13.20%
dynamic/access-relative    change  -1.14%  [-15.54% .. +10.52%]  overhead   +58.38%
dynamic/access-contended   change  +0.32%  [-11.93% .. +13.57%]  overhead   +22.39%
static/launch              change  +0.02%  [ -4.23% ..  +5.78%]  overhead  +180.02%
static/access              change  +0.25%  [ -1.73% ..  +1.99%]  overhead  +810.50%
static/access-relative     change  +0.89%  [ -2.60% ..  +5.00%]  overhead +1343.52%
static/access-contended    change  +0.06%  [ -3.21% ..  +2.05%]  overhead +3237.29%

macos

dynamic/launch             change  +0.32%  [ -1.60% ..  +2.81%]  overhead  +223.27%
dynamic/access             change  +0.48%  [ -1.89% ..  +2.69%]  overhead    +4.53%
dynamic/access-relative    change  +0.00%  [ -1.83% ..  +2.84%]  overhead  +244.26%
dynamic/access-contended   change  +1.30%  [ -0.74% ..  +3.08%]  overhead    +0.62%

windows

dynamic/launch             change  -0.65%  [-12.26% .. +11.68%]  overhead   +32.21%
dynamic/access             change  +0.21%  [ -2.23% ..  +3.79%]  overhead    +2.59%
dynamic/access-relative    change  +0.00%  [ -2.64% ..  +1.64%]  overhead    +1.68%
dynamic/access-contended   change  +1.00%  [ -3.14% .. +23.48%]  overhead    +1.84%

@fengmk2

fengmk2 commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T13:29:53.795031Z a63dea0 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: a63dea0e36

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fengmk2
fengmk2 requested a review from wan9chi October 14, 2026 15:13
@fengmk2
fengmk2 marked this pull request as ready for review October 14, 2026 15:14
fengmk2 and others added 4 commits October 15, 2026 00:18
Co-authored-by: GPT-6 <noreply@openai.com>
Co-authored-by: GPT-6 <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hold the dynamic linker's lock with dlopen on a FIFO so the first
syscall caller blocks in dlsym while a second one calls syscall.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wan9chi
wan9chi force-pushed the fix/fspy-syscall-recursion branch from 3465fcf to 449691b Compare October 14, 2026 16:18
@wan9chi
wan9chi merged commit 8f29881 into main Oct 14, 2026
21 checks passed
@wan9chi
wan9chi deleted the fix/fspy-syscall-recursion branch October 14, 2026 16:25
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