-
Notifications
You must be signed in to change notification settings - Fork 13k
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
[Mac M2 pro] Seg faults on multiple libraries #101247
Comments
For future reference, try to clarify up front whether it's the Rust compiler that's segfaulting / crashing or the application that you compiled. Could you please provide a link to a GitHub repository that demonstrates the issue so that someone can try to reproduce the problem? @rustbot label O-macos O-aarch64 |
Can you run |
|
@BGR360 I have posted the code in my original post. It segfaults on tokio hello world if I use the process feature. I think the issue is probably due to some formatting in the std library. And, it is not just one library, other libraries like cargo what features, etc. also seg faults. So, I think it is something from Rust Std library. |
It doesn't seem to be related to the hardware features (which are a strict superset of what I have on my M1Max, see below). I'm not quite sure then, given the origin of the error, it does seem to be from the formatting code, but it's probably an issue with how things are linked/loaded, somehow. In case it matters, the features this has that my machine has disabled are:
|
Solved! I was using mold linker. Thanks for mentioning it. Also, sorry for the inconvenience.
|
I am currently using m2 and have issues with multiple libraries like Tokio / Cargo what-features. It segfaults which means I am unable to use a rust compiler in my m2 pro 13inch 24 GB ram. I initially thought it was a crate issue, but I think it is a problem with rust in general and is related to formatted-related things.
This doesn't seg fault
Cargo.toml
main.rs
If I add process feature to tokio it segfaults
Running from lldb, I don't know why I don't get symbols but it shows the following output
I guess there is some issue with core::fmt::Formatter::debug_struct. I don't know the internals of rust so, I can't speak anything else.
Now lets run through Address sanitizer
Shows some errors. I tried
export DYLD_INSERT_LIBRARIES=/Users/quantum/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc-nightly_rt.asan.dylib
but as expected it also doesn't work.Lastly, I tried with
cargo run -Zbuild-std --target aarch64-apple-darwin
It works. So, what is the problem? Are the binaries provided by rustup not good?
Thanks.
The text was updated successfully, but these errors were encountered: