sim: Fix STATUS_ACCESS_VIOLATION on Windows x86_64 - #2771
Open
josesimoes wants to merge 1 commit into
Open
Conversation
josesimoes
force-pushed
the
sim-context-windows
branch
from
June 19, 2026 11:57
de97598 to
7057338
Compare
Contributor
Author
|
Pinging @d3zd3z in case this slipped through the cracks... |
d3zd3z
requested changes
Jul 9, 2026
josesimoes
force-pushed
the
sim-context-windows
branch
2 times, most recently
from
July 9, 2026 14:33
e0e086c to
cdd833a
Compare
d3zd3z
reviewed
Jul 9, 2026
Contributor
Author
|
@d3zd3z anything missing here? |
d3zd3z
reviewed
Jul 29, 2026
d3zd3z
left a comment
Member
There was a problem hiding this comment.
This looks good. The only thing I'd say remains would be to just squash the three commits into a single commit. This will help with future bisecting.
- The C `jmp_buf` embedded in this FFI struct needs 16-byte alignment under mingw's setjmp (saves XMM registers with movaps). The C compiler aligns the struct to 16 to satisfy that, but Rust's repr(C) only picked the 8-byte alignment of [u64; 48], so the field could land 8-byte aligned and setjmp faulted with STATUS_ACCESS_VIOLATION. - Added a compile-time assertion to document the invariant and will fail the build if a future field reorder/addition ever regresses alignment below 16 bytes. Works on all platforms. Signed-off-by: José Simões <jose.simoes@eclo.solutions>
josesimoes
force-pushed
the
sim-context-windows
branch
from
July 29, 2026 22:33
69b77ec to
1e89b65
Compare
Contributor
Author
|
@d3zd3z done. And I've also rebased on main. |
d3zd3z
approved these changes
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The C
jmp_bufembedded in this FFI struct needs 16-byte alignment under mingw's setjmp (saves XMM registers with movaps). The C compiler aligns the struct to 16 to satisfy that, but Rust's repr(C) only picked the 8-byte alignment of [u64; 48], so the field could land 8-byte aligned and setjmp faulted with STATUS_ACCESS_VIOLATION.