minidumper-child

Crates.iominidumper-child
lib.rsminidumper-child
version0.2.2
sourcesrc
created_at2022-10-23 16:29:39.989586
updated_at2024-03-29 14:12:44.030712
descriptionCaptures minidumps in a child process
homepage
repositoryhttps://github.com/timfish/minidumper-child
max_upload_size
id695238
size36,234
Tim Fish (timfish)

documentation

README

minidumper-child

Master branch integration test status

Essentially takes the code from the minidumper diskwrite example and packages it in reusable form with some integration tests. This wraps the minidumper and crash-handler crates to capture and send minidumps from a separate crash reporting process.

It spawns the current executable again with an argument that causes it to start in crash reporter mode. In this mode it waits for minidump notification from the main app process and passes the minidump file to a user defined closure.

[dependencies]
minidumper-child = "0.1"
use minidumper_child::MinidumperChild;

fn main() {
    // Everything before here runs in both app and crash reporter processes
    let _guard = MinidumperChild::new()
        .on_minidump(|buffer: Vec<u8>, path: &Path| {
            // Do something with the minidump file here
        })
        .spawn();
    // Everything after here will only run in the app process

    App::run();

    // This will cause on_minidump to be called in the crash reporter process 
    #[allow(deref_nullptr)]
    unsafe {
        *std::ptr::null_mut() = true;
    }
}
Commit count: 7

cargo fmt