Closed
Bug 903134
Opened 11 years ago
Closed 10 years ago
Trusted UI and friends (identity, marketplace) should listen for mozbrowsererror and clean up when the process dies
Categories
(Firefox OS Graveyard :: Gaia::System, defect)
Firefox OS Graveyard
Gaia::System
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: khuey, Assigned: jedp)
References
Details
Attachments
(3 files, 1 obsolete file)
The Persona sign in feature creates a mozbrowser iframe in the system app to display its UI. It doesn't listen for mozbrowsererror though, so if we kill -9 the persona browser process the UI does not get cleaned up. Justin, are there other mozbrowser events we should care about here, like mozbrowserclosed or something?
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → jparsons
Assignee | ||
Comment 1•11 years ago
|
||
I am on PTO this week, and I have no FirefoxOS device with me, so this patch is untested. But if anyone can hack on it, this is the file that needs the fix, and the patch could look something like the attachment.
Assignee | ||
Comment 2•11 years ago
|
||
Ah - it's actually the trusted UI that should be closing on mozbrowsererror.
Assignee | ||
Updated•11 years ago
|
Summary: identity.js should listen for mozbrowsererror and clean up when the persona process dies → Trusted UI and friends (identity, marketplace) should listen for mozbrowsererror and clean up when the process dies
Assignee | ||
Comment 3•11 years ago
|
||
This patch allows the Trusted UI to catch a mozbrowsererror and clean up. There doesn't seem to be any point in putting listeners for mozbrowsererror in either identity.js or payments.js, because they are contained within the Trusted UI process. This patch applies cleanly on today's gaia master and v1-train.
Attachment #788481 -
Attachment is obsolete: true
Attachment #796821 -
Flags: review?(ferjmoreno)
Updated•11 years ago
|
Attachment #796821 -
Flags: review?(ferjmoreno)
Comment 4•11 years ago
|
||
Thanks Jed! Shouldn't we show an error message instead of just closing the dialog? Check [1] for example. I would also handle "mozbrowserclose", so "window.close" can work within the trusted UI. [1] https://mxr.mozilla.org/gaia/source/apps/system/js/popup_manager.js#160
Assignee | ||
Comment 5•11 years ago
|
||
Oh nice - mozbrowserclose should indeed be handled. Thanks for the comments. I'll update the patch.
Assignee | ||
Comment 6•11 years ago
|
||
Having watched 2001 again last night, I now believe this should show a bright red error frame flashing the words COMPUTER MALFUNCTION.
Assignee | ||
Comment 7•11 years ago
|
||
Hi, Fernando, I've updated the patch to display an error screen when there is a crash. It also catches mozbrowserclose. I wasn't sure which error property was the correct one to use. Here's a screenshot. Comments? Thanks! j
Attachment #797925 -
Flags: feedback?(ferjmoreno)
Comment 8•11 years ago
|
||
Comment on attachment 797925 [details]
2013-08-30-13-06-56.png
Thanks Jed! I left a few comments in the PR.
Attachment #797925 -
Flags: feedback?(ferjmoreno) → feedback+
Assignee | ||
Comment 9•11 years ago
|
||
Thanks for your close reading as always, Fernando!
Assignee | ||
Comment 10•11 years ago
|
||
With your suggestion of handling additional known error cases (like airplane mode and loss of network), I'll add a "Try again" button alongside "Close". It turns out to be a bit of a squeeze getting these longer error messages inside the Trusted UI.
Assignee | ||
Comment 12•11 years ago
|
||
Hi, Kyle. Next step is UI design, with me, or someone enthusiastic about doing so, making the necessary layout changes to accommodate the additional error traps and lengthier error strings. I will check with :mhanratty for guidance on some layout questions.
Reporter | ||
Comment 13•11 years ago
|
||
I don't want to scope creep this bug if we don't have to. Can we land the code that removes the iframe mozbrowser (and thus shuts down the process, which uses several MB of memory) and deal with giving this good UI in a followup. IIRC the current UI just gives you a big empty gray box if the process crashes so we're not making things any worse here.
Assignee | ||
Comment 14•11 years ago
|
||
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #13) > I don't want to scope creep this bug if we don't have to. Can we land the > code that removes the iframe mozbrowser (and thus shuts down the process, > which uses several MB of memory) and deal with giving this good UI in a > followup. IIRC the current UI just gives you a big empty gray box if the > process crashes so we're not making things any worse here. That sounds like a plan
Flags: needinfo?(jparsons)
Reporter | ||
Comment 15•11 years ago
|
||
Great. Thanks. I'm told that we're branching for 1.2 on Monday but I can bless this bug with blocking-koi+ to land a safe patch for some time after that.
Assignee | ||
Comment 16•11 years ago
|
||
Thanks, Kyle. Working on it now.
Assignee | ||
Comment 17•11 years ago
|
||
Got some weird html layout problems that just started appearing after reverting and rebasing. (And alas, the awesome new Inspector for the App Manager, doesn't yet work on the System App.)
Assignee | ||
Comment 18•11 years ago
|
||
Oh wow. Back to the drawing board. As of today's m-c trunk and gaia master, killing the persona browser process reboots the phone! The mozbrowsererror is not captured any more.
Assignee | ||
Comment 19•11 years ago
|
||
Here's the lolcat emitted when the process is kill -9'd
Assignee | ||
Comment 20•11 years ago
|
||
Adding some dump statements line-by-line in the patch (lines starting with "TRUI"), it's actually clear that mozbrowsererror is getting caught, and the code is starting to create an error message. But in the midst of it all, we end up with a SIGSEGV I/GeckoDump( 1718): TRUI handleEvent: mozbrowsererror I/GeckoDump( 1718): TRUI handling mozbrowserloaderror I/GeckoDump( 1718): TRUI added .error to data; now show error I/GeckoDump( 1718): TRUI getTopDialog I/Gecko ( 1718): [Parent 1718] ###!!! ABORT: actor has been |delete|d: file /Users/zeus/code/b2g/objdir-gecko/ipc/ipdl/PGrallocBufferParent.cpp, line 378 E/Gecko ( 1718): mozalloc_abort: [Parent 1718] ###!!! ABORT: actor has been |delete|d: file /Users/zeus/code/b2g/objdir-gecko/ipc/ipdl/PGrallocBufferParent.cpp, line 378 F/libc ( 1718): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1) I/GeckoDump( 1718): TRUI get name and stuff I/GeckoDump( 1718): TRUI set textContexts I/GeckoDump( 1718): TRUI add .error class E/GeckoConsole( 1718): [JavaScript Error: "[Exception... "'Error: no message manager set' when calling method: [nsIObserver::observe]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0" data: no]"] I/DEBUG ( 1484): debuggerd committing suicide to free the zombie!
Assignee | ||
Comment 21•11 years ago
|
||
The problem isn't confined to a trusted_ui Browser process; kill -9 on any app will cause the segfault and reboot.
Assignee | ||
Comment 22•11 years ago
|
||
Yay, the bug described in Comment 18 is no longer occurring in the latest m-c.
Assignee | ||
Comment 23•11 years ago
|
||
With 100% repeatability, with this patch applied, the Persona Trusted UI will crash if the OTA update notification banner appears as it is loading. If, however, I open a web browser first, and go to some random web page to induce the OTA updates notification to arrive, and *then* I go and open a Persona sign-in flow, the flow works perfectly. STR: - Apply the gaia patch above - make reset-gaia - choose wifi network in settings - go to UI Tests -> navigator.mozId - click 'request' Result: Updates notification arrives just as Persona Sign-In is loading; Trusted UI displays 'Sign-In has crashed' error. Log looks like: I/Gecko (16502): ###!!! [Parent][AsyncChannel] Error: Channel error: cannot send/recv I/GeckoDump(16502): trusted_ui: handleEvent: mozbrowsererror I/GeckoDump(16502): trusted_ui: handleEvent: appterminated Alternately, STR to make it not crash: - As above, but before going to navigator.mozId tests, visit some other web page first. - Wait for OTA banner to come and go - Then go to navigator.mozId tests Result: things work nicely. Persona login does not say it has crashed. Fernando, do you have any idea what might be causing this? Am I somehow catching a mozbrowsererror event that's not intended for me?
Flags: needinfo?(ferjmoreno)
Assignee | ||
Comment 24•11 years ago
|
||
Having spoken to :fabrice on IRC, I've opened bug 920851 for the OTA banner issue described in Comment 23.
Flags: needinfo?(ferjmoreno)
Assignee | ||
Comment 25•11 years ago
|
||
As Bug 920851 Comment 12 notes, we probably need to be listening for these error events on the frame within the trusted ui, not the trusted ui itself. I will update the patch.
Assignee | ||
Comment 26•11 years ago
|
||
I've updated the patch; once the PR in Bug 920851 is merged, I'll rebase and re-submit this.
Assignee | ||
Comment 28•10 years ago
|
||
Oh wow. That is a blast from the past. Apologies that this fell off my radar. Rebased and pushed the PR again. I'll ask the good Fernando for a review. Thanks!
Flags: needinfo?(jparsons)
Assignee | ||
Comment 29•10 years ago
|
||
Comment on attachment 796821 [details]
Clean up Trusted UI on mozbrowsererror
Hi, Fernando, thanks for looking at this again after all this time!
j
Attachment #796821 -
Flags: review?(ferjmoreno)
Comment 30•10 years ago
|
||
Comment on attachment 796821 [details]
Clean up Trusted UI on mozbrowsererror
I am getting this error after applying the patch:
[JavaScript Error: "SyntaxError: property name handleBrowserEvent appears more than once in object literal" {file: "app://system.gaiamobile.org/js/trusted_ui.js" line: 461}]
Attachment #796821 -
Flags: review?(ferjmoreno)
Assignee | ||
Comment 31•10 years ago
|
||
Oh? Ok, taking a look now. Thanks, ferjm.
Assignee | ||
Comment 33•10 years ago
|
||
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #32) > Any luck with comment 31? Sorry, I've been underwater with 1.4 blockers. I will try to get to this as soon as I can. I expect by the end of the week.
Flags: needinfo?(jparsons)
Assignee | ||
Updated•10 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 34•10 years ago
|
||
Comment on attachment 796821 [details]
Clean up Trusted UI on mozbrowsererror
Fixed and rebased
I've tested on device with today's m-c and gaia master as follows:
- in a browser, visit 123done.org
- click sign in
- when persona dialog appears, kill it via adb shell
mozbrowsererror is caught and error dialog appears as expected.
Closing the error dialog and attempting to sign in again works as expected.
Thanks again for your review, ferjm!
Attachment #796821 -
Flags: review?(ferjmoreno)
Comment 35•10 years ago
|
||
Comment on attachment 796821 [details]
Clean up Trusted UI on mozbrowsererror
Thanks Jed!
Attachment #796821 -
Flags: review?(ferjmoreno) → review+
Assignee | ||
Comment 36•10 years ago
|
||
Thanks, ferjm. There were Travis build errors due to the analog clock app not adapting correctly to orientation changes. Is there a way to "star" things like that for b2g, as one would with the try builder? Anyway, merging the PR. Cheers j
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Comment 37•10 years ago
|
||
Why is there no new tests with this commit?
Assignee | ||
Comment 38•10 years ago
|
||
Good point, :rik, there should be. I've opened follow-up Bug 976103 to add tests for this.
Comment 39•10 years ago
|
||
This patch should not have landed without new tests. Reviewers, please pay attention to this.
Depends on: 976103
You need to log in
before you can comment on or make changes to this bug.
Description
•