Skip to content

Conversation

alexcrichton
Copy link
Member

In #11344 it was found that if Wasmtime had a frame on the stack then an application's previous unwinding was broken. This was due to the fact that Wasmtime's C API artifacts do not have unwind information built-in due to being build with -Cpanic=abort. This change updates to building the C API artifacts with -Cforce-unwind-tables even though Rust itself won't use them to assist with embedders that want to unwind. These should in theory be easily strippable if desired and additionally embedders always have the option to build their own version of the C API too.

Closes #11344

In bytecodealliance#11344 it was found that if Wasmtime had a frame on the stack then an
application's previous unwinding was broken. This was due to the fact
that Wasmtime's C API artifacts do not have unwind information built-in
due to being build with `-Cpanic=abort`. This change updates to building
the C API artifacts with `-Cforce-unwind-tables` even though Rust itself
won't use them to assist with embedders that want to unwind. These
should in theory be easily strippable if desired and additionally
embedders always have the option to build their own version of the C API
too.

Closes bytecodealliance#11344
@alexcrichton alexcrichton requested a review from a team as a code owner August 5, 2025 16:17
@alexcrichton alexcrichton requested review from rvolosatovs and removed request for a team August 5, 2025 16:17
@fitzgen fitzgen added this pull request to the merge queue Aug 6, 2025
@bjorn3
Copy link
Contributor

bjorn3 commented Aug 6, 2025

By the way rust-lang/rust#143613 will make -Cforce-unwind-tables the default on Linux. It was already force enabled on Windows. macOS would still need -Cforce-unwind-tables though.

Merged via the queue into bytecodealliance:main with commit 3cbeb24 Aug 6, 2025
43 checks passed
@alexcrichton alexcrichton deleted the force-unwind-tables branch August 6, 2025 21:01
@alexcrichton
Copy link
Member Author

Oh nice I wasn't aware of that!

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.

Why is my host app's crash stack trace overwritten/lost when Wasmtime is embedded?
3 participants