Skip to content

Comments

fix(jsc): disable WASM IPInt on Linux x86_64 to prevent segfaults#27341

Open
robobun wants to merge 1 commit intomainfrom
claude/fix-wasm-ipint-segfault-27340
Open

fix(jsc): disable WASM IPInt on Linux x86_64 to prevent segfaults#27341
robobun wants to merge 1 commit intomainfrom
claude/fix-wasm-ipint-segfault-27340

Conversation

@robobun
Copy link
Collaborator

@robobun robobun commented Feb 22, 2026

Summary

Background

The WASM IPInt has a known stack-check bug on Linux x86_64 (WebKit #289009) that causes segfaults during repeated WASM function calls. The upstream fix exists but is pending the WebKit upgrade in #26922. This change provides an immediate workaround by disabling IPInt, which falls back to the older (stable) WASM interpreter.

Test plan

  • bun bd test test/regression/issue/27340.test.ts passes
  • Verified WASM execution works correctly with IPInt disabled
  • Verified BUN_JSC_useWasmIPInt=1 env var override still works
  • CI passes on all platforms (the #if guard ensures this only affects Linux x86_64)

Closes #27340

🤖 Generated with Claude Code

Disable the JavaScriptCore WASM In-Place Interpreter (IPInt) by default
on Linux x86_64 to work around an upstream JSC bug that causes segfaults
in `wasm_ipint_call_wide32`. This affects 20+ reported issues (#17841).

The fix is placed before env var processing so users can still re-enable
IPInt with `BUN_JSC_useWasmIPInt=1` if needed.

Closes #27340

Co-Authored-By: Claude <noreply@anthropic.com>
@robobun
Copy link
Collaborator Author

robobun commented Feb 22, 2026

Updated 11:15 PM PT - Feb 21st, 2026

❌ Your commit 39d94baf has 4 failures in Build #37910 (All Failures):


🧪   To try this PR locally:

bunx bun-pr 27341

That installs a local version of the PR into your bun-27341 executable, so you can run:

bun-27341 --bun

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 22, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

Disables the WASM In-Place Interpreter (useWasmIPInt) for Linux x86_64 in JSC initialization to address a segmentation fault issue. A regression test is added to verify that repeated WASM function calls complete without crashes and produce correct results.

Changes

Cohort / File(s) Summary
WASM In-Place Interpreter Disable
src/bun.js/bindings/ZigGlobalObject.cpp
Adds conditional compilation guard for Linux x86_64 to disable WASM In-Place Interpreter (useWasmIPInt = false) during JSC initialization, preventing IPInt path execution on the affected platform.
Regression Test
test/regression/issue/27340.test.ts
New regression test file verifying that repeated WASM function calls (10,000 iterations) complete without segmentation faults and produce the expected accumulated result of 50005000.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: disabling WASM IPInt on Linux x86_64 to prevent segfaults, which directly matches the core objective.
Description check ✅ Passed The description follows the template with complete sections. It explains what the PR does (disables WASM IPInt), provides background (upstream JSC bug), details the test plan with checkboxes, and references the issue it closes.
Linked Issues check ✅ Passed The changes fully address issue #27340 objectives: mitigate segfaults on Linux x86_64 via IPInt disablement, make it reversible with BUN_JSC_useWasmIPInt env var, and include regression test verification.
Out of Scope Changes check ✅ Passed All changes are directly in scope: conditional compilation disables IPInt for Linux x86_64, and the regression test validates the fix without introducing unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link
Contributor

claude bot commented Feb 22, 2026

39d94 — Looks good!

Reviewed 2 files across src/bun.js/bindings/ and test/regression/issue/: Disables the WebAssembly In-Place Interpreter (IPInt) by default on Linux x86_64 to work around an upstream JavaScriptCore bug that causes segfaults during repeated WASM function calls, and adds a regression test verifying WASM execution stability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Segmentation fault in WASM trampoline (v1.3.10, Linux x86_64)

1 participant