-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Aarch64 macOS: ucontext_t is not FFI-Safe #2812
Comments
Thanks for the report. isn't it because ucontext_t type has a missing field in libc ? mcontext_data. If I hack the cached libc version test_windows_get_core_ids test no longer segfault, only core_affinity fails now. |
What I can propose eventually :
Let me know what you think. |
As far as I can tell, there is not really any good alternative to these APIs, and of course it would be great to have them somehow officially supported by the libc create (?) |
I ve prepared a change, is it possible for you to temporarily tried out this repo/branch ? |
ucontext usage update on macos 64 bits. closes #2812
ucontext usage update on macos 64 bits. closes #2812
I think this change broke the sigaction API on Apple silicon. Related to wasmerio/wasmer#4072 |
This commit effectively reverts #2817. Currently `ucontext_t` has both the wrong size and the wrong alignment for aarch64-apple-darwin which causes problems for users referencing the structure [1]. The issue linked from #2817 claimed that it fixed #2812 but that's still an issue where FFI warnings are still emitted for usage of `ucontext_t` due to its transitive usage of `u128`. I'm not sure how to fix #2812 myself, but given that #2817 doesn't appear to solve its original intent and additionally the size/align are currently wrong this commit reverts in the meantime. [1]: bytecodealliance/wasmtime#6785 (comment)
…ohnTitor Fix size/align of `ucontext_t` on aarch64-apple-darwin This commit effectively reverts #2817. Currently `ucontext_t` has both the wrong size and the wrong alignment for aarch64-apple-darwin which causes problems for users referencing the structure [1]. The issue linked from #2817 claimed that it fixed #2812 but that's still an issue where FFI warnings are still emitted for usage of `ucontext_t` due to its transitive usage of `u128`. I'm not sure how to fix #2812 myself, but given that #2817 doesn't appear to solve its original intent and additionally the size/align are currently wrong this commit reverts in the meantime. [1]: bytecodealliance/wasmtime#6785 (comment)
…ohnTitor Fix size/align of `ucontext_t` on aarch64-apple-darwin This commit effectively reverts #2817. Currently `ucontext_t` has both the wrong size and the wrong alignment for aarch64-apple-darwin which causes problems for users referencing the structure [1]. The issue linked from #2817 claimed that it fixed #2812 but that's still an issue where FFI warnings are still emitted for usage of `ucontext_t` due to its transitive usage of `u128`. I'm not sure how to fix #2812 myself, but given that #2817 doesn't appear to solve its original intent and additionally the size/align are currently wrong this commit reverts in the meantime. [1]: bytecodealliance/wasmtime#6785 (comment)
This commit effectively reverts rust-lang#2817. Currently `ucontext_t` has both the wrong size and the wrong alignment for aarch64-apple-darwin which causes problems for users referencing the structure [1]. The issue linked from rust-lang#2817 claimed that it fixed rust-lang#2812 but that's still an issue where FFI warnings are still emitted for usage of `ucontext_t` due to its transitive usage of `u128`. I'm not sure how to fix rust-lang#2812 myself, but given that rust-lang#2817 doesn't appear to solve its original intent and additionally the size/align are currently wrong this commit reverts in the meantime. [1]: bytecodealliance/wasmtime#6785 (comment)
When using
ucontext_t
ingetcontext
(manually added, the API seems not to be exported on aarch64 mac in libc), like so:the compiler complains that ucontext_t is not ffi-safe, as 128 bit integers are not supported in FFI.
I did not find any use of 128 bit ints, hence, I assume the compiler is overly smart for the neon state(?) which is:
When I hand-roll the ucontext_t struct, including a neon-state like this, the compiler no longer complains.
Coincidentally, my testcase would segfault after the original getcontext, which may be related.
This is on macos, aarch64, with libc 0.2.121 and rust 1.59.0
The text was updated successfully, but these errors were encountered: