-
-
Notifications
You must be signed in to change notification settings - Fork 161
fix(runtime): no Rust frame is ever a longjmp target — cc --help segfault fixed, parity gate back online (#9305) #9323
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
Merged
proggeramlug
merged 6 commits into
PerryTS:main
from
proggeramlug:fix/9305-setjmp-transport
Aug 31, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b90badb
runtime: route every longjmp-target setjmp through a C trampoline (#9…
df63c97
tests: #9305 regression fixture (throw-in-microtask) + transport unit…
c7b5c12
fmt + changelog fragment (#9305)
3f34ceb
docs: js_try_push / ffi::setjmp contract notes (#9305)
65f964f
stdlib+ext-fastify: convert remaining raw setjmp trap sites to the C …
d75e6d0
runtime(regex): fancy engine accepts the ASCII word-boundary marker (…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| ### Fixed | ||
|
|
||
| - A `RegExp` combining a lookaround (or backreference) with `\b`/`\B` no | ||
| longer throws a bogus `SyntaxError: invalid pattern`: the ASCII | ||
| word-boundary spelling `(?-iu:\b)` the translator emits (#9263) is valid | ||
| for the linear engine but rejected by fancy-regex's parser, so every | ||
| pattern forced onto the fancy engine lost its word boundaries. | ||
| `build_fancy_regex` now rewrites the marker into the equivalent | ||
| one-code-point-lookaround form. This was the throw inside a microtask | ||
| that #9305's setjmp miscompile turned into the `cc --help` segfault; | ||
| with both fixed, `marked`'s html-block regex — and `cc --help` — work | ||
| again. (#9305) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| ### Fixed | ||
|
|
||
| - `cc --help` (and any program throwing from inside a microtask) no longer | ||
| segfaults: every jmp_buf the exception transport can `longjmp` to is now | ||
| armed inside a dedicated C trampoline (`perry_sjlj_try`) instead of a raw | ||
| `setjmp` call in Rust. rustc cannot express `returns_twice`, so a Rust | ||
| frame containing a live `setjmp` was compiled under LLVM's one-return | ||
| assumption — in `run_microtasks` LLVM colored the stack slot of the | ||
| spilled TLS-base temporary into the task-record copy loop, and the | ||
| longjmp return path reloaded NULL. The trampoline makes the hazard | ||
| unrepresentable for all current and future Rust trap sites; the one | ||
| remaining raw `setjmp` (the GC's register-snapshot spill, which never | ||
| longjmps) is documented as the deliberate exception. (#9305) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Describe the compile failure consistently.
Lines 3-6 state that fancy-regex rejected the pattern. Line 7 instead says the pattern lost word boundaries. The pattern did not compile, so it could not run with missing boundary semantics. Replace this wording with a statement that affected patterns raised
SyntaxErrorbefore matching.Based on learnings, changelog fragments must describe the final shipped behavior as one coherent release-note entry.
🤖 Prompt for AI Agents
Source: Learnings