-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustc segfaults on riscv64 musl #96876
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
Labels
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
I did a few more tests and managed to isolate some minimal examples. Example 1Code: fn main() { let mut f = Result::Ok(5)?; } Compilation:
Example 2Code: fn main() { let mut f = None?; } Compilation:
Any ideas how to debug this further or any hints on what might be causing these sorts of issues? |
I was able to crosscompile a rust binary for riscv64 using rust-1.62.0 and llvm14. The built rust compiler did not segfault when running the two testcases above:
|
Looks like this was fixed in 1.62.0 then. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Hi,
I am a contributor to the Alpine Linux distribution (which uses musl libc). Since recently, Alpine has support for riscv64. In this context, I am currently trying to make Rust available on this architecture. With some patching, I was able to successfully bootstrap a stage2 rustc for riscv64 musl by cross-compiling using our x86_64 Rust package on Alpine Linux Edge. Compiling basic software (e.g. hello world) with the stage2 rustc works on riscv64 musl. Unfortunately, re-compiling rustc itself with stage2 does not and causes a segmentation fault early on in the build process.
Code
The backtrace for this segfault looks as follows:
It looks to me like it is segfaulting while attempting to print a backtrace?
Full log: alpine-edge-riscv64-buildlog.txt
Meta
rustc --version --verbose
:As you can see, this version uses a custom Alpine triplet with some minor patches applied which cause rustc to link against musl dynamically by default. You can find the full set of patches (including the once required to make rust-1.6.0 build on riscv64 musl in the first place) here. I don't think that the issue is caused by the patches that we are currently applying, hence reporting this here (if strictly needed I can also compile a rustc without our custom triplet, however, as noted above vanilla rust-1.6.0 wont compile without patches on riscv64 musl anyhow).
Any ideas what might be causing this or tips on how to debug this further?
Related: #93975
CC: @nekopsykose, @kaniini, @Cogitri
The text was updated successfully, but these errors were encountered: