Stream: git-wasmtime

Topic: wasmtime / PR #6321 `wasmtime`: Fix resetting stack-walki...


view this post on Zulip Wasmtime GitHub notifications bot (May 01 2023 at 23:08):

fitzgen opened PR #6321 from fitzgen:save-restore-stack-walking-registers to bytecodealliance:main:

Fixes a regression from #6262, originally reported in https://github.com/bytecodealliance/wasmtime-dotnet/pull/245

The issue was that we would enter Wasm and save the stack-walking registers but never clear them after Wasm returns. Then if a host-to-host call tried to capture a stack, we would mistakenly attempt to use those stale registers to start the stack walk. This mistake would be caught by an assertion, triggering a panic.

This commit fixes the issue by managing the save/restore in the CallThreadState construction/drop, rather than in the old set_prev method.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (May 01 2023 at 23:08):

fitzgen requested jameysharp for a review on PR #6321.

view this post on Zulip Wasmtime GitHub notifications bot (May 01 2023 at 23:08):

fitzgen requested wasmtime-core-reviewers for a review on PR #6321.

view this post on Zulip Wasmtime GitHub notifications bot (May 01 2023 at 23:35):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 01 2023 at 23:35):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 01 2023 at 23:35):

alexcrichton created PR review comment:

(in async for example minimizing hits to tls can be somewhat important)

view this post on Zulip Wasmtime GitHub notifications bot (May 01 2023 at 23:35):

alexcrichton created PR review comment:

This might be good to tighten up as self.prev.set(tls::raw::replace(self)) perhaps?

view this post on Zulip Wasmtime GitHub notifications bot (May 02 2023 at 17:13):

fitzgen updated PR #6321.

view this post on Zulip Wasmtime GitHub notifications bot (May 02 2023 at 17:14):

fitzgen has enabled auto merge for PR #6321.

view this post on Zulip Wasmtime GitHub notifications bot (May 02 2023 at 22:42):

fitzgen updated PR #6321.

view this post on Zulip Wasmtime GitHub notifications bot (May 03 2023 at 00:20):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 03 2023 at 06:06):

fitzgen merged PR #6321.


Last updated: Nov 22 2024 at 17:03 UTC