Closed Bug 777185 Opened 13 years ago Closed 13 years ago

Hook up content process crash reporting for B2G

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-basecamp:+, firefox18 fixed)

RESOLVED FIXED
blocking-basecamp +
Tracking Status
firefox18 --- fixed

People

(Reporter: ted, Assigned: hub)

References

Details

(Keywords: feature, Whiteboard: [WebAPI:P0][LOE:S])

Attachments

(1 file, 2 obsolete files)

For content process crash reporting, the parent process will have to listen to an observer service notification and submit a report based on the ID it receives. This code was all hooked up in XUL Fennec, so you can probably just copy what it did.
https://github.com/mozilla-b2g/gaia/issues/2283 also has some discussion surrounding this.
blocking-basecamp: --- → ?
blocking-basecamp: ? → +
Ted: Who do you think could do this? Could you or bsmedberg? Assigning to Ted for now.
Assignee: nobody → ted.mielczarek
Not me, no. I don't know anything about the B2G chrome and I'm tied up in other work at the moment. It should be mostly copy-paste from the XUL fennec code.
Assignee: ted.mielczarek → nobody
Hub, is this something you can take?
Assignee: nobody → hub
Whiteboard: [WebAPI:P0]
Keywords: feature
Whiteboard: [WebAPI:P0] → [WebAPI:P0][LOE:S]
This is my current priority. Working on it.
Attached patch WiP to submit dump (obsolete) — Splinter Review
It seems that we don't get a dumpID in case of abnormal termination. The dump file are there though. I'm on PTO from now until Oct 19th. I will possibly have downtime to look at it, but if you really want to finish the patch before that, please, re-assign.
Fixed and working patch. I don't think I'll be able to commit this before Monday. I'll do my best, luckily being on Paris it should be easier.
Attachment #668686 - Attachment is obsolete: true
Attachment #668844 - Flags: review?(fabrice)
Attachment #668844 - Flags: feedback?(ted.mielczarek)
Comment on attachment 668844 [details] [diff] [review] Bug 777185 - Hookup content process crash reporting. Review of attachment 668844 [details] [diff] [review]: ----------------------------------------------------------------- I want to be sure of the potential QI issue. ::: b2g/chrome/content/shell.js @@ +85,4 @@ > try { > + if (crashID == undefined || crashID == "") > + crashID = Cc["@mozilla.org/xre/app-info;1"] > + .getService(Ci.nsIXULRuntime).lastRunCrashID; Nit: align .getService() with [ @@ +786,3 @@ > (function contentCrashTracker() { > Services.obs.addObserver(function(aSubject, aTopic, aData) { > if(aTopic == "ipc:content-shutdown") { That test is useless since we only register for this topic. Let's remove it. @@ +786,5 @@ > (function contentCrashTracker() { > Services.obs.addObserver(function(aSubject, aTopic, aData) { > if(aTopic == "ipc:content-shutdown") { > + let cs = Cc["@mozilla.org/consoleservice;1"] > + .getService(Ci.nsIConsoleService); Nit: indentation @@ +791,5 @@ > + cs.logStringMessage("content-shutdown has been caught"); > + > + if (aSubject.QueryInterface(Ci.nsIPropertyBag2).hasKey("abnormal")) { > + cs.logStringMessage("abnormal shutdown"); > + if (aSubject.hasKey("dumpID")) { don't you need to QI here also? Storing aSubject.QueryInterface(Ci.nsIPropertyBag2) in a local would make it clearer to me.
Attachment #668844 - Flags: review?(fabrice) → review-
Comment on attachment 668844 [details] [diff] [review] Bug 777185 - Hookup content process crash reporting. Review of attachment 668844 [details] [diff] [review]: ----------------------------------------------------------------- ::: b2g/chrome/content/shell.js @@ +791,5 @@ > + cs.logStringMessage("content-shutdown has been caught"); > + > + if (aSubject.QueryInterface(Ci.nsIPropertyBag2).hasKey("abnormal")) { > + cs.logStringMessage("abnormal shutdown"); > + if (aSubject.hasKey("dumpID")) { It does not seem to be necessary to QI the second time. BUT, I'm ok with use a local. Will update with that change.
addressed comments
Attachment #668844 - Attachment is obsolete: true
Attachment #668844 - Flags: feedback?(ted.mielczarek)
Attachment #669427 - Flags: review?(fabrice)
Attachment #669427 - Flags: feedback?
Attachment #669427 - Flags: feedback? → feedback?(ted.mielczarek)
Comment on attachment 669427 [details] [diff] [review] Bug 777185 - Hookup content process crash reporting. Review of attachment 669427 [details] [diff] [review]: ----------------------------------------------------------------- ::: b2g/chrome/content/shell.js @@ +788,5 @@ > + let cs = Cc["@mozilla.org/consoleservice;1"] > + .getService(Ci.nsIConsoleService); > + let props = aSubject.QueryInterface(Ci.nsIPropertyBag2); > + if (props.hasKey("abnormal")) { > + if (props.hasKey("dumpID")) { nit: if (props.hasKey("abnormal") && props.hasKey("dumpID")) { ... }
Attachment #669427 - Flags: review?(fabrice) → review+
Attachment #669427 - Flags: feedback?(ted.mielczarek)
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
So, I think this is working, given those two reports I have seen from unagi devices: bp-62664bb5-3295-441b-8a04-d379d2121016 and bp-a4035b13-3470-4fb1-b282-aa28b2121016
Excellent !!!!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: