-
Notifications
You must be signed in to change notification settings - Fork 1.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
msghdr for musl cannot be instantiated because of private padding fields #2344
Labels
C-bug
Category: bug
Comments
Thanks for filing it! But I'm going to close as wontfix, see #2346 (comment). |
Could it at least derive |
jalaziz
added a commit
to jalaziz/agave
that referenced
this issue
Nov 29, 2024
msghdr cannot be directly instantiated on musl due to private padding fields (see rust-lang/libc#2344). The recommended solution is to use `mem::zeroed` to initialize the struct then set the fields as needed. While we could use the same solution for both glibc and musl, we use a conditional compilation directive to avoid using unsafe code when it's not required.
joncinque
pushed a commit
to anza-xyz/agave
that referenced
this issue
Dec 3, 2024
* [streamer] Fix musl build msghdr cannot be directly instantiated on musl due to private padding fields (see rust-lang/libc#2344). The recommended solution is to use `mem::zeroed` to initialize the struct then set the fields as needed. While we could use the same solution for both glibc and musl, we use a conditional compilation directive to avoid using unsafe code when it's not required. * fix lint warnings
Ma233
pushed a commit
to dephy-io/agave
that referenced
this issue
Jan 25, 2025
* [streamer] Fix musl build msghdr cannot be directly instantiated on musl due to private padding fields (see rust-lang/libc#2344). The recommended solution is to use `mem::zeroed` to initialize the struct then set the fields as needed. While we could use the same solution for both glibc and musl, we use a conditional compilation directive to avoid using unsafe code when it's not required. * fix lint warnings
Ma233
pushed a commit
to dephy-io/agave
that referenced
this issue
Jan 25, 2025
* [streamer] Fix musl build msghdr cannot be directly instantiated on musl due to private padding fields (see rust-lang/libc#2344). The recommended solution is to use `mem::zeroed` to initialize the struct then set the fields as needed. While we could use the same solution for both glibc and musl, we use a conditional compilation directive to avoid using unsafe code when it's not required. * fix lint warnings
jasl
pushed a commit
to jasl/agave
that referenced
this issue
Jan 26, 2025
* [streamer] Fix musl build msghdr cannot be directly instantiated on musl due to private padding fields (see rust-lang/libc#2344). The recommended solution is to use `mem::zeroed` to initialize the struct then set the fields as needed. While we could use the same solution for both glibc and musl, we use a conditional compilation directive to avoid using unsafe code when it's not required. * fix lint warnings
mergify bot
pushed a commit
to anza-xyz/agave
that referenced
this issue
Jan 27, 2025
* [streamer] Fix musl build msghdr cannot be directly instantiated on musl due to private padding fields (see rust-lang/libc#2344). The recommended solution is to use `mem::zeroed` to initialize the struct then set the fields as needed. While we could use the same solution for both glibc and musl, we use a conditional compilation directive to avoid using unsafe code when it's not required. * fix lint warnings (cherry picked from commit 8c1d4f6)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I attempt to build
on a generic linux target this works, but with
--target x86_64-unknown-linux-musl
I receive:This is because of private padding used in the musl version of these types: https://github.com/rust-lang/libc/blob/master/src/unix/linux_like/linux/musl/b64/mod.rs#L92
It is notable that in the types below the padding is made public, making this particular struct inconsistent.
Can be worked around with
mem::zeroed
but I think these fields should ideally be made publicThe text was updated successfully, but these errors were encountered: