Stream: git-wasmtime

Topic: wasmtime / PR #13657 Adjust stack alignment in nostd fibers


view this post on Zulip Wasmtime GitHub notifications bot (Jun 15 2026 at 17:49):

alexcrichton opened PR #13657 from alexcrichton:fix-nostd-fiber-alignment to bytecodealliance:main:

This commit adjust how fiber stacks are allocated/aligned to 16 byte boundaries in the nostd implementation of fibers. This was found where testing as-is with MIRI flags UB where an unaligned pointer write happens. This occurs because while the base pointer of a stack is aligned it means that the size of the stack is not aligned, producing an unaligned "top addr".

The fix in this commit is to change the element type of the stack to a type that naturally has an alignment of 16, so unaligned allocations aren't possible in the first place. Unfortunately this can't be added to CI, however, because the nostd implementation of fibers requires the 'stackswitch' module which Miri does not support, and the Miri implementation of fibers is backed by threads and doesn't do any of this. For now this'll end up just being manually verified as "no Miri errors until it executes naked_asm!".

<!--
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 (Jun 15 2026 at 17:49):

alexcrichton requested pchickey for a review on PR #13657.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 15 2026 at 17:49):

alexcrichton requested wasmtime-core-reviewers for a review on PR #13657.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 15 2026 at 18:26):

:thumbs_up: pchickey submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 15 2026 at 19:12):

alexcrichton added PR #13657 Adjust stack alignment in nostd fibers to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 15 2026 at 19:36):

:check: alexcrichton merged PR #13657.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 15 2026 at 19:36):

alexcrichton removed PR #13657 Adjust stack alignment in nostd fibers from the merge queue.


Last updated: Jul 29 2026 at 05:03 UTC