-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Rust 1.60 segmentation fault related to const generics #96672
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
Comments
Hey Cleanup Crew ICE-breakers! This bug has been identified as a good cc @AminArria @ayazhafiz @camelid @chrissimpkins @contrun @elshize @h-michael @HallerPatrick @hdhoang @hellow554 @henryboisdequin @imtsuki @JamesPatrickGill @kanru @KarlK90 @matheus-consoli @mental32 @nmccarty @Noah-Kennedy @pard68 @PeytonT @pierreN @Redblueflame @RobbieClarken @RobertoSnap @robjtede @SarthakSingh31 @shekohex @sinato @smmalis37 @steffahn @Stupremee @tamuhey @turboladen @woshilapin @yerke |
Reduced: (must be compiled with fn explode<V, F, V2>(mut node_map: F) -> Option<()>
where
F: FnMut(V) -> Option<V2>,
{
let key = conjure();
node_map(key)?;
None
}
pub struct Layout<const N: usize>;
impl<const N: usize> Layout<N> {
pub fn new() {
for i in 0..N {
let node_map = |key: [(); N]| -> Option<[f32; N]> {
key[i];
None
};
explode(node_map);
}
}
}
fn conjure<T>() -> T {
unimplemented!()
}
pub fn main() {
Layout::<0>::new();
} |
searched nightlies: from nightly-2022-01-13 to nightly-2022-05-03 bisected with cargo-bisect-rustc v0.6.3Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --preserve --start=2022-01-13 --target=wasm32-unknown-unknown -- build --release --target=wasm32-unknown-unknown This did indeed regress in the LLVM bump (#94764). @rustbot label I-crash A-llvm |
Assigning priority as discussed in the Zulip thread of the Prioritization Working Group. Great work @SNCPlay42 thanks! @rustbot label -I-prioritize +P-high -ICEBreaker-Cleanup-Crew |
Looks like https://reviews.llvm.org/D119854 is the change where it starts failing. cc @nikic |
IR: https://gist.github.com/nikic/66478e84510d35b763a6b99a2aefa508 Running this through |
Bisect points to llvm/llvm-project@857c612, which probably just hides the problem. |
Ah no, I misread. That does look like the actual fix for the issue. |
Filed backport issue: llvm/llvm-project#55304 |
Apologies for the noise, but did this fix make its way into 1.61? I'm still getting similar issues there. |
Code
I tried this code:
I expected to see this happen: successful compilation
Instead, this happened:
Version it worked on
It most recently worked on (
nix build github:homotopy-io/homotopy-rs?rev=5ba852c72a3e552d3668233a14fd9769dea0797e
):Version with regression
rustc --version --verbose
:Other information
We've determined that https://github.com/homotopy-io/homotopy-rs/blob/0cc608109c699f7fac2e7979f2f0d440ac4ac786/homotopy-web/src/app/workspace.rs#L101 is the culprit; either removing that line or replacing
<0>
with<1>
both fix the compiler crashing (although this does not produce the code we want).This looks like it's possibly related to the LLVM version.
@rustbot modify labels: +regression-from-stable-to-stable -regression-untriaged
The text was updated successfully, but these errors were encountered: