Skip to content
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

segmentation fault in risc-v code #114473

Closed
MaxHearnden opened this issue Aug 4, 2023 · 5 comments
Closed

segmentation fault in risc-v code #114473

MaxHearnden opened this issue Aug 4, 2023 · 5 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness O-riscv Target: RISC-V architecture

Comments

@MaxHearnden
Copy link
Contributor

MaxHearnden commented Aug 4, 2023

see https://github.com/MaxHearnden/rust-bug for accompanying files

The function tokio::runtime::scheduler::multi_thread::park::Parker::shutdown (which is _ZN91_$LT$tokio..runtime..scheduler..multi_thread..park..Parker$u20$as$u20$tokio..park..Park$GT$8shutdown17hc45107ddb2018849E in the provided files) contains a pattern match (present in the llvm-ir) which is not in the generated assembly. This causes a segmentation fault when the structure bound by the match is read on line 78373 in the generated assembly.

Meta

rustc --version --verbose:

1.70
@MaxHearnden MaxHearnden added the C-bug Category: This is a bug. label Aug 4, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 4, 2023
fgaz added a commit to fgaz/nixpkgs that referenced this issue Aug 5, 2023
@Noratrieb Noratrieb added O-riscv Target: RISC-V architecture E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness labels Aug 22, 2023
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Aug 22, 2023
@Noratrieb Noratrieb removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 22, 2023
@apiraino
Copy link
Contributor

@MaxHearnden it would be awesome to clarify this report and attach a reproducible MCVE, modulo the Nix files. Ideally including the rustc version that starts erroring. thanks

@MaxHearnden
Copy link
Contributor Author

MaxHearnden commented Aug 27, 2023

I have produced a fairly minimal reproduction at https://github.com/MaxHearnden/tokio-bug-repro
I am using rustc 1.71.1 and it fails on risc-v

@MaxHearnden
Copy link
Contributor Author

@MaxHearnden
Copy link
Contributor Author

I've filed a bug report upstream llvm/llvm-project#65025 and there is a candidate patch https://reviews.llvm.org/D158962

@MaxHearnden
Copy link
Contributor Author

fixed by #115959

@apiraino apiraino removed E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness O-riscv Target: RISC-V architecture
Projects
None yet
Development

No branches or pull requests

4 participants