Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

fix save/restore of PC/FP/SP/limit on fiber switch#107

Merged
dicej merged 1 commit intomainfrom
dicej/fiber-switch-save-restore
Apr 5, 2025
Merged

fix save/restore of PC/FP/SP/limit on fiber switch#107
dicej merged 1 commit intomainfrom
dicej/fiber-switch-save-restore

Conversation

@dicej
Copy link
Copy Markdown
Collaborator

@dicej dicej commented Apr 4, 2025

This fixes stack backtrace panics/SIGSEGVs due to broken CallThreadState/VMStoreContext PC/FP/SP/limit info which wasn't been updated correctly for nested fiber invocations.

Thanks to Alex for walking me through the code and sketching the solution.

Fixes #102

@dicej dicej requested a review from alexcrichton April 4, 2025 20:57
@dicej dicej force-pushed the dicej/fiber-switch-save-restore branch from 86e60bf to f4324b4 Compare April 4, 2025 21:01
@dicej dicej enabled auto-merge April 4, 2025 21:07
@dicej dicej added this pull request to the merge queue Apr 4, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 4, 2025
@dicej
Copy link
Copy Markdown
Collaborator Author

dicej commented Apr 4, 2025

Looks like this is broken on MacOS; I just reproduced it locally on my M1 Macbook Air. Interestingly, it works fine on Asahi Linux on my Mac Mini M2 Pro and breaks on MacOS x86_64, so it appears to be MacOS -specific.

@dicej dicej force-pushed the dicej/fiber-switch-save-restore branch 5 times, most recently from 04e1f26 to 5096a1f Compare April 5, 2025 01:34
This fixes stack backtrace panics/SIGSEGVs due to broken
`CallThreadState`/`VMStoreContext` PC/FP/SP/limit info which wasn't been updated
correctly for nested fiber invocations.

Thanks to Alex for walking me through the code and sketching the solution.

Fixes #102

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
@dicej dicej force-pushed the dicej/fiber-switch-save-restore branch from 5096a1f to ed9f304 Compare April 5, 2025 01:35
@dicej dicej enabled auto-merge April 5, 2025 01:37
@dicej dicej added this pull request to the merge queue Apr 5, 2025
Merged via the queue into main with commit 90f0c48 Apr 5, 2025
44 checks passed
@dicej dicej deleted the dicej/fiber-switch-save-restore branch April 5, 2025 17:13
@dicej dicej mentioned this pull request Apr 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Aborting panic on wasm trap

2 participants