-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
rust-analyzer version: 0.3.2353-standalone (37acea8 2025-03-23)
rustc version: (eg. output of rustc -V)
rustc 1.85.1 (4eb161250 2025-03-15)
editor or extension: (eg. VSCode, Vim, Emacs, etc. For VSCode users, specify your extension version; for users of other editors, provide the distribution if applicable)
VSCode (rust-lang.rust-analyzer 0.3.2353)
relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)
repository link (if public, optional): (eg. rust-analyzer)
code snippet to reproduce:
fn main() {
// try to create a Box from a invalid pointer
let _ = unsafe {
let mut ptr: *mut i32 = std::ptr::null_mut();
ptr = ptr.add(10usize);
Box::from_raw(ptr);
};
}Observed behavior:
When running cargo run from the terminal, the program correctly triggers a segmentation fault.
However, when running the same code using VSCode’s "Run" button (runnable feature), it does not trigger a segmentation fault.
Expected behavior:
The behavior should be consistent: running the code in VSCode should also trigger a segmentation fault, just like when using cargo run in the terminal.
Additional context:
It seems that the VSCode runnable feature might be handling process crashes differently. Would appreciate insights on whether this is expected behavior or a bug.

