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

Function faulthandler_dump_traceback

crates/stdlib/src/faulthandler.rs:279–296  ·  view source on GitHub ↗
(fd: i32, all_threads: bool)

Source from the content-addressed store, hash-verified

277 // faulthandler_dump_traceback (signal-safe, for fatal errors)
278 #[cfg(any(unix, windows))]
279 fn faulthandler_dump_traceback(fd: i32, all_threads: bool) {
280 static REENTRANT: AtomicBool = AtomicBool::new(false);
281
282 if REENTRANT.swap(true, Ordering::SeqCst) {
283 return;
284 }
285
286 // Write thread header
287 if all_threads {
288 write_thread_id(fd, current_thread_id(), true);
289 } else {
290 puts(fd, "Stack (most recent call first):\n");
291 }
292
293 dump_live_frames(fd);
294
295 REENTRANT.store(false, Ordering::SeqCst);
296 }
297
298 /// MAX_STRING_LENGTH in traceback.c
299 const MAX_STRING_LENGTH: usize = 500;

Callers 3

faulthandler_fatal_errorFunction · 0.85
faulthandler_exc_handlerFunction · 0.85
faulthandler_user_signalFunction · 0.85

Calls 7

newFunction · 0.85
write_thread_idFunction · 0.85
putsFunction · 0.85
dump_live_framesFunction · 0.85
current_thread_idFunction · 0.70
swapMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected