MCPcopy Index your code
hub / github.com/RustPython/RustPython / _sigsegv

Function _sigsegv

crates/stdlib/src/faulthandler.rs:1208–1222  ·  view source on GitHub ↗
(_args: SigsegvArgs, _vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1206
1207 #[pyfunction]
1208 fn _sigsegv(_args: SigsegvArgs, _vm: &VirtualMachine) {
1209 #[cfg(not(target_arch = "wasm32"))]
1210 {
1211 suppress_crash_report();
1212
1213 // Write to NULL pointer to trigger a real hardware SIGSEGV,
1214 // matching CPython's *((volatile int *)NULL) = 0;
1215 // Using raise(SIGSEGV) doesn't work reliably because Rust's runtime
1216 // installs its own signal handler that may swallow software signals.
1217 unsafe {
1218 let ptr: *mut i32 = core::ptr::null_mut();
1219 core::ptr::write_volatile(ptr, 0);
1220 }
1221 }
1222 }
1223
1224 #[pyfunction]
1225 fn _sigabrt(_vm: &VirtualMachine) {

Callers

nothing calls this directly

Calls 1

suppress_crash_reportFunction · 0.85

Tested by

no test coverage detected