-
-
Notifications
You must be signed in to change notification settings - Fork 158
fix(runtime): remove the C-unwind abort guards from the JS throw path (#8479) #8488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7d96371
6fa7350
c68c21b
f242881
c9e0594
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| fix(runtime): remove the `extern "C-unwind"` guards from the JS throw path (#8479). The runtime is built `panic=abort` and a JS throw travels as a raw Itanium `_Unwind_Exception` that must step *through* runtime frames untouched — the workspace `Cargo.toml` states the requirement outright ("no RFC-2945 abort-on-unwind guards … which a JS throw crossing a helper frame would trip"). Marking a pass-through frame `extern "C-unwind"` in a `panic=abort` crate does not enable unwinding; it makes rustc wrap the call in an abort-on-unwind landing pad, which is that exact guard. #8416 planted the first two (`js_closure_call1`, `js_native_call_value`) and broke `tier1_every_ffi_type_against_test_dylib`; #8480 planted another on the same FFI path; #8464 planted ~40 more and cost +20 gap crashes plus a red `gc-stress` before being reverted in #8484. All four pass-through conversions are back to `extern "C"`; throw *originators* (`js_throw` and friends, which diverge) are untouched. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| fix(ci): `cargo-test` and `e2e-scoped` now build the runtime archives with `--release`, so compiled test binaries link a `panic = "abort"` runtime like the one Perry ships (#8479). `panic` is a profile-level setting and only `release`/`dist`/`perry-dev` set `abort`; a bare `cargo build` produced a debug, `panic = "unwind"` runtime whose `extern "C"` helpers carry RFC-2945 abort guards that a JS throw trips. The test environment therefore had the *opposite* unwind semantics from production, which is why the two throw-transport canaries could never both pass and why #8416, #8464 and #8480 each fixed one by breaking the other. Paired with removing those `extern "C-unwind"` conversions (#8488): against a `panic = "abort"` runtime, both `tier1_every_ffi_type_against_test_dylib` and `function_apply_with_runtime_args_defers_to_a_located_aot_error` pass. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1 @@ | ||||||
| fix(test): `function_apply_dynamic_args_eval_surface` builds and links a `--release` runtime archive (#8479). It hardcoded `target/debug` and passed it via `PERRY_RUNTIME_DIR`, so it always linked a `panic = "unwind"` runtime — a configuration Perry never ships — where rustc plants an RFC-2945 abort guard in every `extern "C"` helper and a JS throw crossing one aborts. That made this test and `bun_ffi_stage1`'s use-after-close case mutually unsatisfiable and drove three successive "fixes" (#8416, #8464, #8480) that each repaired one by breaking the other. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Keep this changeset focused on shipped behavior. This entry includes the development history of Proposed changeset-fix(test): `function_apply_dynamic_args_eval_surface` builds and links a `--release` runtime archive (`#8479`). It hardcoded `target/debug` and passed it via `PERRY_RUNTIME_DIR`, so it always linked a `panic = "unwind"` runtime — a configuration Perry never ships — where rustc plants an RFC-2945 abort guard in every `extern "C"` helper and a JS throw crossing one aborts. That made this test and `bun_ffi_stage1`'s use-after-close case mutually unsatisfiable and drove three successive "fixes" (`#8416`, `#8464`, `#8480`) that each repaired one by breaking the other.
+fix(test): Build and link `function_apply_dynamic_args_eval_surface` with a release runtime archive so it exercises Perry’s shipped `panic = "abort"` configuration (`#8479`).Based on learnings, PerryTS/perry changelog fragments must describe final shipped behavior as one coherent release-note entry and must not include separate development-slice narratives. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Learnings |
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Publish one changeset for the shipped behavior.
These fragments describe dependent parts of one runtime behavior. Replace them with one final release-note entry. Use the current PR number in
changelog.d/<PR>-<slug>.md.changelog.d/8485-remove-c-unwind-guards.md#L1-L1: merge the runtime ABI description into the single final entry.changelog.d/8491-test-runtime-panic-strategy.md#L1-L1: merge the CI runtime-profile description into the same final entry.Based on learnings,
changelog.d/must describe final shipped behavior as one coherent release-note entry. As per coding guidelines, addchangelog.d/<PR>-<slug>.mdwith the entry body.📍 Affects 2 files
changelog.d/8485-remove-c-unwind-guards.md#L1-L1(this comment)changelog.d/8491-test-runtime-panic-strategy.md#L1-L1🤖 Prompt for AI Agents
Sources: Coding guidelines, Learnings