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
cursor Bot added a commit to voidzero-dev/vite-plus that referenced this pull request Oct 21, 2026
Bumps vite-task from `9ba4cc9` to `8db455e`.

Changelog:
voidzero-dev/vite-task@9ba4cc9...8db455e#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed

## Breaking change adapted

fspy no longer reports a bitset of access modes on each path. Each
tracked operation is its own `PathAccess` (`Read`, `Write`, `ReadWrite`,
or `ReadDir`). `vp_command` combines the operations that touch the same
workspace-relative path into the existing `AccessMode` set, so the
JavaScript `run_command` result is unchanged.

## User-facing vite-task changes

- A mistyped task setting now fails with an error that names the field,
instead of `data did not match any variant of untagged enum
UserTaskDefinition` (voidzero-dev/vite-task#815).
- `vp run` no longer panics on scripts that contain non-ASCII
characters, and no longer cuts those commands off where it displays them
(voidzero-dev/vite-task#861).
- Reinstalling with another pnpm version no longer changes the cache
fingerprint of `node_modules/.modules.yaml`; only whether the file
exists is hashed (voidzero-dev/vite-task#850).
- Cached tasks on Linux and macOS no longer abort when a program passes
`-1` as a directory descriptor, and concurrent syscalls in tracked
programs no longer overflow the stack (voidzero-dev/vite-task#862,
voidzero-dev/vite-task#854).

Docs are unchanged. These are fixes to existing behavior, and the guides
do not describe the old error text or the `.modules.yaml` fingerprint.

## Validation

- `cargo check --workspace --all-features --all-targets --locked`
- `cargo clippy -p vp_command -p vite-plus-cli --all-targets
--all-features -- --deny warnings`
- `cargo test` for `vp_command`, `vp_error`, `vp_pm_cli`,
`vp_js_runtime`, `vp_migration`, `vp_shared`, `vp_static_config`,
`vite-plus-cli`, and `vp_global_cli`


<div><a
href="https://cursor.com/agents/bc-9c9cb178-3b56-4d68-9556-3028d946a3ec?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/automations/3a586a0e-cc2b-11f1-bec7-b2318963e0b6"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/view-automation-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/view-automation-light.png"><img
alt="View Automation" width="141" height="28"
src="https://cursor.com/assets/images/view-automation-dark.png"></picture></a>&nbsp;</div>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Charles Wang <wan9chi@users.noreply.github.com>
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