-
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
[libc-0.2] posix_spawn_file_actions_t
cannot be used on Linux after #3602
#3608
Comments
@JohnTitor: This is blocking updating |
The problematic PR has been reverted in #3678. |
After wasting a day, I also found out that posix_spawnattr_init is fine in 0.2.153, but 0.2.154 causes Segmentation fault...... |
I have yanked 0.2.154 with my |
It would be nice to get v0.2.155 published as soon as possible. Yanking of v0.2.154 breaks the latest version of |
#3690 has been merged, and |
Update libc to 0.2.155 Motivation: To fix `-Zbuild-std` / Xargo for visionOS targets. EDIT: Blocked on ~rust-lang/libc#3608 / rust-lang/libc#3609 ~rust-lang/libc#3682 and rust-lang/libc#3690 No longer blocked.
Update libc to 0.2.155 Motivation: To fix `-Zbuild-std` / Xargo for visionOS targets. EDIT: Blocked on ~rust-lang/libc#3608 / rust-lang/libc#3609 ~rust-lang/libc#3682 and rust-lang/libc#3690 No longer blocked.
Update libc to 0.2.155 Motivation: To fix `-Zbuild-std` / Xargo for visionOS targets. EDIT: Blocked on ~rust-lang/libc#3608 / rust-lang/libc#3609 ~rust-lang/libc#3682 and rust-lang/libc#3690 No longer blocked.
Update libc to 0.2.155 Motivation: To fix `-Zbuild-std` / Xargo for visionOS targets. EDIT: Blocked on ~rust-lang/libc#3608 / rust-lang/libc#3609 ~rust-lang/libc#3682 and rust-lang/libc#3690 No longer blocked.
Fixes: rust-lang#3709 Fixes: rust-lang#3608 Fixes: rust-lang#3677 Co-authored-by: Jorge Aparicio <[email protected]> [resolved conflict, update commit message - Trevor] (apply <rust-lang#3690> to `main`) (cherry picked from commit b2b2fd7) Signed-off-by: Trevor Gross <[email protected]>
We found an issue when updating ferrocene's libc submodule (ferrocene/ferrocene#356) to revision 947a185 . the only change included in our libc update was PR #3602 .
when building stage 2 of libstd to x86_64-linux the build failed to execute the build script of the
quote
crate with the following error:where the mentioned line corresponds to this revision.
Tracking down the error led us to this usage of the
posix_spawn
API:This code allocates a
posix_spawn_file_actions_init
type on the stack. before #3602, thefile_actions
stack variable had the correct size and alignment but after #3602, it now has a size and alignment of*mut c_void
(8 bytes on x86_64) and that results in UB whenposix_spawn_file_actions_init
is called.GLIBC implements
posix_spawn_file_actions_init
as a memset operation that zeroes the struct. In Rust syntax, that would be more or less this code:Bionic implements
posix_spawn_file_actions_init
differently. It uses a heap allocation as indirection. The Rust version of the bionic implementation looks roughly like this:This usage of
posix_spawn_file_actions_t
in libstd:is compatible with both GLIBC and Bionic but the
libc
crate needs to provide the correct size and alignment on Linux.So, the conditional code should produce this on Linux
but this on Android
All this probably also applies to the
posix_spawnattr_t
type but I have yet to look into the details of the GLIBC code around that type.I'll send up a fix PR after I have done some more testing.
The text was updated successfully, but these errors were encountered: