Open Bug 1290357 Opened 5 years ago Updated 2 years ago
[mozcrash] Add logging for uptime of the application
It would be great to know how long the application was already running since a crash happened. With that information we could determine if it is a startup crash (application run time <60s). Ted, would that be possible? I hope so.
Yes, we already record that information in the .extra file. I don't think mozcrash currently parses the .extra file, but it's not a very complicated format. If you look at one you'll find: CrashTime=1431997333 StartupTime=1431945302 Those are both timestamps, so you can calculate (CrashTime - StartupTime) to get uptime in seconds.
The code that parses .extra files for when you submit crashes via about:crashes is here, FYI: https://dxr.mozilla.org/mozilla-central/rev/fe895421dfbe1f1f8f1fc6a39bb20774423a6d74/toolkit/crashreporter/KeyValueParser.jsm#16
Strange when I run the latest code locally via: > $ python mozcrash/mozcrash.py /mozilla/code/gecko/ None The output I see is the following: > Crash reason: SIGSEGV > Crash address: 0x0 > Process uptime: not available So we already have the process uptime as part of the output from minidump_stackwalk. Not sure why I do not see that on Treeherder for crashes. Maybe we had this feature at one point but removed it? The version I have is a bit old: > -rwxr-xr-x 1 henrik henrik 1729752 Mar 7 15:33 /mozilla/bin/minidump_stackwalk If that is not what you have in mind please let me know. But adding content via mozcrash to the process crash output from minidump especially at specific lines doesn't seem to be that easy.
(In reply to Henrik Skupin (:whimboo) from comment #3) > Strange when I run the latest code locally via: > > > $ python mozcrash/mozcrash.py /mozilla/code/gecko/ None > > The output I see is the following: > > > Crash reason: SIGSEGV > > Crash address: 0x0 > > Process uptime: not available > > So we already have the process uptime as part of the output from > minidump_stackwalk. Not sure why I do not see that on Treeherder for > crashes. Maybe we had this feature at one point but removed it? The version > I have is a bit old: That output was added in upstream Breakpad in 2014: https://chromium.googlesource.com/breakpad/breakpad/+/63919583ba0d302a2ceb437ecf41a7975f44f54b%5E%21/#F7 It only shows up if certain information is present in the minidump though, and it's possible that Breakpad doesn't write that information on all platforms. Note that as of recently we also have a "StartupCrash" annotation in the .extra file: bug 1295934.
So what would you prefer then? Should we add those extra lines to the stackwalk_output array right before the output from minidump_stackwalk? If we do it afterward it won't be that recognizable. Or should we inject those lines as mentioned above right behind the block starting with "Crash reason".
4 years ago
Printing it before the minidump_stackwalk output seems fine. I wouldn't try to inject it into the middle of the stackwalk output, that's confusing.
You need to log in before you can comment on or make changes to this bug.