Open Bug 1441453 Opened 7 years ago Updated 1 year ago

Report the command line of a crashed process

Categories

(Toolkit :: Crash Reporting, enhancement)

enhancement

Tracking

()

ASSIGNED

People

(Reporter: sfink, Assigned: sfink)

References

Details

Attachments

(1 file)

When mozcrash.py runs, it generates PROCESS-CRASH output but I don't see anything in it that allows me to associate a crash with the program that ran. A pid would be enough to associate them, although having the command line immediately available would be more convenient.
mozcrash just runs minidump_stackwalk on the dump files, it doesn't know anything about processes. There is a PID in the dump file (at least on Windows, I'm not sure if other platforms fill that in), so we could ostensibly make minidump_stackwalk print that. Minidumps don't have the commandline information, though.
Yeah, sorry, I didn't meant to imply this was a mozcrash.py thing. I looked through minidump_stackwalk, and it seemed like it wanted to find some sort of MinidumpInfo struct with process information in it (I forget the exact name). My sample minidump appeared to not contain that data. I tried stepping through the crash dump generation to figure out when it might be emitted, but didn't have much luck and didn't want to spend a lot of time figuring it out. Especially if someone (likely a ted-shaped someone) happened to already know a simple solution.
Yeah, `MDRawMiscInfo` has a `process_id` field: https://chromium.googlesource.com/breakpad/breakpad/+/6d0287851fabc21a90838ae068b11f2d777393d5/src/google_breakpad/common/minidump_format.h#785 ...but the Linux client code doesn't write that info to minidumps. Since we use Microsoft's API on Windows we get it there, and the Mac client has code to write it (which probably wouldn't be hard to port to the Linux client): https://dxr.mozilla.org/mozilla-central/rev/5297541590781af40ff09e067646f3115960af75/toolkit/crashreporter/breakpad-client/mac/handler/minidump_generator.cc#1528

(Yoshi, Jon: I guess I already filed a bug for this one. CC'ing.)

To expound on my earlier answer: dumps written by Breakpad on Linux do contain the raw contents of /proc/self/cmdline:
https://chromium.googlesource.com/breakpad/breakpad/+/6d0287851fabc21a90838ae068b11f2d777393d5/src/processor/minidump_dump.cc#192

Windows minidumps do apparently usually contain the commandline in the process environment block but you have to grovel around through poorly-documented structures to find it.

After bug 1487410 lands it should be rather easy to write out the PID into the stackwalker's JSON output and have mozcrash present it to the user

Depends on: 1487410
Depends on: 1758216
Assignee: nobody → sphink
Status: NEW → ASSIGNED
Pushed by sfink@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e04c792b53e3 Display the linux command line if available r=gsvelto
Severity: normal → S3

Changing the title here because we've been printing the PID of each crashed process in bug 1840651.

Summary: Report the command line and pid of a crashed process → Report the command line of a crashed process
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: