Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse minidumps to determine which process they came from #1047

Closed
timfish opened this issue Jan 7, 2025 · 0 comments · Fixed by #1049
Closed

Parse minidumps to determine which process they came from #1047

timfish opened this issue Jan 7, 2025 · 0 comments · Fixed by #1049
Assignees

Comments

@timfish
Copy link
Collaborator

timfish commented Jan 7, 2025

Problem Statement

Currently we read minidumps from the crashpad directory when we are notified by Electron that a renderer or child process has crashed. We assume that all the minidumps we find correspond the the Electron event. All minidumps we read at startup are assumed to be main process crashes because they cause the process to exit immediately.

Although these assumptions are usually correct, I've personally seen events recorded incorrectly and so have other users (#1045).

Solution Brainstorm

Using the Rust minidump crate, I found that there is crashpad specific stream which contains the following info:

use minidump::*;

fn main() {
    let dump = minidump::Minidump::read_path("./mini.dmp").unwrap();
    let crashpad_info = dump.get_stream::<MinidumpCrashpadInfo>().unwrap();

    println!(
        "annotation_objects: {:#?}",
        crashpad_info.module_list[0].annotation_objects
    );
}

For an Electron renderer minidump this results in:

annotation_objects: {
    "num-experiments": String(
        "0",
    ),
    "osarch": String(
        "x86_64",
    ),
    "pid": String(
        "2796",
    ),
    "platform": String(
        "win32",
    ),
    "process_type": String(
        "renderer",
    ),
    "ptype": String(
        "renderer",
    ),
}

I've looked at both the node-minidump code and the Rust minidump crate code and it looks like this shouldn't be overly complex to parse these out.

If we can access the process_type in the minidump we no longer need to guess which process the minidump came from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant