Skip to content

stack-switching: fix continuation chain walking for backtraces #10992

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

Conversation

posborne
Copy link
Collaborator

@posborne posborne commented Jun 9, 2025

A refactor during the stack switching runtime changes introduced a defect not present in the base stack switching code. The chunks iterator call ends up skipping elements and the windows call would require pulling in something like itertools::zip_longest to work, so I just restored an impl closer to the original (but with more fine-grained unsafe calls).

This code has coverage but only in the final round of stack switching changes.


Original Discussion: #10388 (comment). I didn't look closely enough when I took on this approach and w/o testing this slipped through (though can't really be hit yet).

Failing Test with current main + cranelift changes + tests: https://github.com/posborne/wasmtime/actions/runs/15538863221/job/43744530801#step:19:1165

CC @frank-emrich, @dhil

A refactor during the stack switching runtime changes
introduced a defect not present in the base stack switching
code.  The `chunks` iterator call ends up skipping elements
and the `windows` call would require pulling in something
like `itertools::zip_longest` to work, so I just restored
an impl closer to the original implementation (but with
more fine-grained unsafe calls).

This code has coverage but only in the final round of
stack swithching changes.
@posborne posborne requested a review from a team as a code owner June 9, 2025 21:45
@posborne posborne requested review from pchickey and removed request for a team June 9, 2025 21:45
@posborne posborne changed the title stack-switching: fix continuation stack walking stack-switching: fix continuation chain walking for backtraces Jun 9, 2025
@posborne posborne requested a review from fitzgen June 9, 2025 21:51
@fitzgen fitzgen added this pull request to the merge queue Jun 9, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jun 9, 2025
A refactor during the stack switching runtime changes
introduced a defect not present in the base stack switching
code.  The `chunks` iterator call ends up skipping elements
and the `windows` call would require pulling in something
like `itertools::zip_longest` to work, so I just restored
an impl closer to the original implementation (but with
more fine-grained unsafe calls).

This code has coverage but only in the final round of
stack swithching changes.
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 9, 2025
@github-actions github-actions bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Jun 9, 2025
Copy link
Contributor

@dhil dhil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Though, it may be good to have @frank-emrich give it a look too.

@alexcrichton alexcrichton added this pull request to the merge queue Jun 10, 2025
Merged via the queue into bytecodealliance:main with commit 3438932 Jun 10, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasmtime:api Related to the API of the `wasmtime` crate itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants