-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
[AVR] compiler segfaults #107261
Comments
I tried making the reproducer as small as possible, but at some point it becomes extremely sensitive to seemingly trivial changes: for example, if I remove the unused |
Tried it with latest nightly, crashes just the same:
|
Can you try getting a backtrace where the segfault occurs by running the rustc command in a debugger? |
Sure. BTW, is your question implying that you didn't manage to reproduce this with what I've provided so far? Do let me know if I'm missing some inputs that are relevant.
|
Just noting that this still reproduces even with avr-progmem 0.3.3, the latest fixes in rustc for AVR and |
Hmm. Isn't it also a bug in itself if |
Oh, probably. |
fwiw, on the newest llvm-project (with debug assertions enabled), this itself: #![no_std]
#![no_main]
extern crate avr_std_stub;
use core::{hint::black_box, panic::PanicInfo};
fn reverse_bits(mut x: u8) -> u8 {
let mut y: u8 = 0;
let mut i = 7;
while i > 0 {
if x & 0x01 != 0 {
y |= 0x80;
}
y = y.rotate_left(1);
x >>= 1;
i -= 1;
}
y
}
#[no_mangle]
pub extern "C" fn main() {
let x = black_box(123);
let x = reverse_bits(x);
let x = black_box(x);
loop {
//
}
} ... fails with:
Curiously, it works with 16-bit+ types; I'll see if there's anything I can do. Edit: minimized:
|
Okie, patch submitted: With that patch, compiling your application, @gergoerdi, seems to pass; I'll let know once the patch is merged and applied to rustc 🙂 |
Status: fixed on LLVM's side - will be solved when LLVM's version is bumped here (apparently soon ™️ ). |
fwiw, this got fixed with #114048 🙂 |
On this linked repository, running
cargo build --release
fails with a segmentation fault:The text was updated successfully, but these errors were encountered: