I have this small sample crash with STATUS_STACK_BUFFER_OVERRUN
on Windows.
use std::cell::Cell;
struct Panicker;
impl Drop for Panicker {
fn drop(&mut self) {
panic!("Unhappy")
}
}
fn main() {
thread_local! {
static P: Cell<Option<Panicker>> = const { Cell::new(None) };
}
P.set(Some(Panicker));
println!("Done. Or am I?");
}
The question is whether I should worry about this issue (as in, is this a memory corruption issue).
Or am I fine leaving this code as is.
❯ cargo run
Compiling panicker v0.1.0 (C:\Users\:3\Projects\panicker)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.41s
Running `target\debug\panicker.exe`
Done. Or am I?
thread 'main' panicked at src\main.rs:6:9:
Unhappy
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: thread local panicked on drop
error: process didn't exit successfully: `target\debug\panicker.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)