Implementing a crash reporter - panic and abort signal

⚓ Rust    📅 2026-03-23    👤 surdeus    👁️ 2      

surdeus

I’m trying to implement a crash reporter for an app. I installed a panic hook (std::panic::set_hook) and also signal handlers (using the signal-hook crate). To avoid a double report, I uninstall the abort signal handler in the panic hook. This seemed to work, but now on Android it doesn’t. On Android, the handler for the SIGABRT still runs after the panic, and makes a second report file. This is odd to me because the signal-hook crate’s unregister function is not changing the low level C library signal handler, but rather a map of functions in Rust. So I don’t see why it’s behaving differently.

Any ideas?

(This scheme is a bit messed up with multithreading, since I could be getting panics that don’t crash the app. … Haven’t dealt with that yet.)

2 posts - 2 participants

Read full topic

🏷️ Rust_feed