Closed Bug 821710 Opened 13 years ago Closed 13 years ago

Send the tab URL for B2G browser content crashes

Categories

(Firefox OS Graveyard :: General, defect, P3)

x86_64
Linux
defect

Tracking

(blocking-basecamp:+, firefox19 wontfix, firefox20 wontfix, firefox21 fixed, b2g18 fixed)

RESOLVED FIXED
B2G C4 (2jan on)
blocking-basecamp +
Tracking Status
firefox19 --- wontfix
firefox20 --- wontfix
firefox21 --- fixed
b2g18 --- fixed

People

(Reporter: kairo, Assigned: cjones)

References

Details

Attachments

(2 files)

Bug 806515 is implementing the sending of the app origin with crash reports for processes that run an app, I'm splitting off to this bug the part about sending the currently active URL of crashing tab processes in the browser. I hope that should complete us sending useful info in the URL field of all B2G content processes - or do we have others?
This bug (or something like it) may be necessary in order for us to distinguish between crashes in browser process and crashes in the main process. See bug 824658 comment 19.
blocking-basecamp: --- → ?
Please don't use the same field ("URL") for the browser's current URI and the app's manifest URI. That would be confusing, because it would give us no way to filter between app process crashes and browser process crashes. Note also that a browser process may have multiple current URIs. At the moment we have one TabChid per browser process, but that may change. You should iterate over all the crashed ContentParent's TabParents and find their URIs (which you may have to send up to the parent; I'm not sure they're there at the moment).
blocking-basecamp: ? → +
Priority: -- → P3
Target Milestone: --- → B2G C3 (12dec-1jan)
Assignee: nobody → dale
(In reply to Justin Lebar [:jlebar] (away 12/21-1/2) from comment #1) > This bug (or something like it) may be necessary in order for us to > distinguish between crashes in browser process and crashes in the main > process. See bug 824658 comment 19. Main process crashes have the module "b2g" loaded, and browser processes have "plugin-container" loaded.
We also have the process type field that tells us easily what's a content process and what is the main process crashing, we don't need those workarounds for that.
(In reply to Justin Lebar [:jlebar] (away 12/21-1/2) from comment #2) > Note also that a browser process may have multiple current URIs. At the > moment we have one TabChid per browser process, but that may change. You > should iterate over all the crashed ContentParent's TabParents and find > their URIs (which you may have to send up to the parent; I'm not sure > they're there at the moment). We can have multiple tabchilds because of popups. But in desktop, we just send the most-recently-navigated URI. I think that code will sort of accidentally Just Work even in remote browser processes with multiple tabs.
(In reply to Justin Lebar [:jlebar] (away 12/21-1/2) from comment #2) > You > should iterate over all the crashed ContentParent's TabParents and find > their URIs (which you may have to send up to the parent; I'm not sure > they're there at the moment). We should always send only one URL, as that's all that our analysis supports. As comment #5 explains, we send the most recently navigated URI on desktop or mobile right now, if we have multiple URLs, we should do the same. In most cases, that's enough for analysis.
I think this should already be working. Let me check right quick.
bp-9a5a5ec5-c453-46d2-9999-c9de62121227 --- nope. *scratches head* http://mxr.mozilla.org/mozilla-central/source/toolkit/crashreporter/nsExceptionHandler.cpp#292 294 static const char* kSubprocessBlacklist[] = { 295 "FramePoisonBase", 296 "FramePoisonSize", 297 "StartupTime", 298 "URL" 299 }; Whups!
cjones? does that just mean we need to remove the url field from the blacklist to get this fixed? And how do I force a crash so I can test this out?
> And how do I force a crash so I can test this out? $ adb shell # b2g-ps # kill -9 pid-of-browser-process
(In reply to Dale Harvey (:daleharvey) from comment #9) > cjones? does that just mean we need to remove the url field from the > blacklist to get this fixed? I don't think that's the best solution, since it could be prone to races based on whichever caller happened to set the annotation last. I suspect it would be better to have TabParent actors set the annotation correctly in ActorDestroy, and ensure that ContentParent doesn't overwrite it.
The original problem that motivated the blacklist is that plugin subprocesses crash and generate crash reports, but those reports would also pick up annotations from the parent process. We want most of those parent-process annotations, except the ones in the blacklist. For content processes however, all these annotations are supplied by the content process and are useful. (Except probably StartupTime ...) So we need to ensure that the annotations provided by the content processes "override" the ones from the parent process, and that we don't apply the blacklist when writing the .extra file.
The solution seems like a platform bug. Moving to General.
Component: Gaia::Browser → General
QA Contact: nhirata.bugzilla
Target Milestone: B2G C3 (12dec-1jan) → B2G C4 (2jan on)
Assignee: dale → nobody
Two things seem to be happening here - the Annotate() function being used by CrashReporterParent seems to be bypassing the child-process blacklist. Whups. - the code added by bug 806515 is unconditionally stomping the "URL" annotation with mAppManifestURL. For "browser" processes, this will be the empty string. So even though browser processes (should) already be annotating the URL correctly, and that annotation shouldn't be filtered by the blacklist, it will be stomped by the code in bug 806515.
So it turns out the frontend is responsible for annotating URL in the common case. This patch lets TabChild serve that role in a simple way. This also prefers the manual app-manifest annotation over whichever URI happened to have been loaded last in an app process.
Assignee: nobody → jones.chris.g
Attachment #698077 - Flags: review?(ted)
Kill browser process URL=http://www.bing.com/ killing dialer process URL=app://communications.gaiamobile.org/manifest.webapp
The UI process of the browser app still sends it app manifest, though, right?
The browser UI runs in-process.
(In reply to Chris Jones [:cjones] [:warhammer] from comment #18) > The browser UI runs in-process. Ah, OK.
Comment on attachment 698077 [details] [diff] [review] Send the URL along with "browser" process crashes Review of attachment 698077 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/ipc/ContentParent.cpp @@ +716,5 @@ > + // loaded in the child process with our manifest URL. We > + // would rather associate the crashes with apps than > + // random child windows loaded in them. > + // > + // XXX would be nice if we could get both ... If you want both, file a followup to send the manifest URL in a separate annotation. We'd have to hook up some Socorro UI to display it (which is probably why URL was used here), but that would let you get the actual URL that's loaded out of webapps, which would be nice.
Attachment #698077 - Flags: review?(ted) → review+
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #20) > If you want both, file a followup to send the manifest URL in a separate > annotation. We'd have to hook up some Socorro UI to display it (which is > probably why URL was used here), but that would let you get the actual URL > that's loaded out of webapps, which would be nice. It would probably take us a few months to get such an additional field displayed in the Socorro UI (judging by how much is on their plans and the current state of Socorro UI development), and we'd need to change the desktop and mobile WebRT implementations to also send the app origin/manifest in the new field, or else we'd be heavily inconsistent in how we send that info across products. We can revisit this later, but for at least v1.x of FxOS, I heavily prefer the current state of having this in the UI field as that gives us at least the chance to have decent crash analysis via Socorro.
This changeset appears to have broken the Android build on Mac: /Users/dmose/r/inbound/src/dom/ipc/TabChild.cpp:33:32: fatal error: nsExceptionHandler.h: No such file or directory I have --disable-crashreporter in my mozconfig, because <https://wiki.mozilla.org/Mobile/Fennec/Android#Setup_Fennec_mozconfig> says this is required.
Attachment #698809 - Flags: review?(jst) → review+
Thanks for the quick review, Chris. Landed on mozilla-inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/9de5e35606d2
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: