During app installation, Homescreen app crashed by assertion failure in debug build

RESOLVED FIXED

Status

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dhylands, Assigned: swu)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Reporter

Description

5 years ago
I was running the latest FirefoxOS (2.1) on b2g-inbound.

I had B2G_DEBUG=1

I tried to install the Notes App using Marketplace, and HomeScreen crashed. The last few lines of logcat looked like:

> 07:36:13.295 281/281                 GeckoDump  I   XXX FIXME : Got a mozContentEvent: webapps-install-granted
> 07:36:13.445 989/989                     Gecko  I   [Child 989] WARNING: Transparent content with displayports can be expensive.: file ../../../b2g-inbound/layout/base/nsDisplayList.cpp, line 1311
> 07:36:13.445 989/989              GeckoConsole  E   Content JS LOG at https://marketplace.cdn.mozilla.net/media/fireplace/js/include.js?b=1407883299729:6 in s/<: [installer] App install request for Notes
> 07:36:13.585 1024/1024              GeckoConsole  E   [JavaScript Warning: "reference to undefined property DOMApplicationRegistry.webapps[aId][prop]" {file: "resource://gre/modules/AppsServiceChild.jsm" line: 252}]
> 07:36:13.665 989/989                     Gecko  I   [Child 989] WARNING: Transparent content with displayports can be expensive.: file ../../../b2g-inbound/layout/base/nsDisplayList.cpp, line 1311
> 07:36:13.745 281/281                 GeckoDump  I   XXX FIXME : Got a mozContentEvent: inputmethod-update-layouts
> 07:36:13.775 281/281                     Gecko  I   RemoteOpenFileParent: file '/data/local/webapps/{a3d2e6cb-5309-4c45-91de-0f3b59fff8ee}/application.zip' was not found!
> 07:36:13.845 989/989                     Gecko  I   [Child 989] WARNING: Transparent content with displayports can be expensive.: file ../../../b2g-inbound/layout/base/nsDisplayList.cpp, line 1311
> 07:36:13.945 920/920                     Gecko  I   IPDL protocol error: [PRemoteOpenFileChild] Received an invalid file descriptor!
> 07:36:13.955 920/920                MOZ_Assert  F   Assertion failure: mHandleCreatedByOtherProcessWasUsed, at ../../../b2g-inbound/ipc/glue/FileDescriptor.cpp:69

I tried a second time (reflash and install Notes from Marketplace) and got:

> 01:39:59.307 309/309                     Gecko  I   RemoteOpenFileParent: file '/data/local/webapps/{93f4b5a2-be95-4015-a69d-922afcd46473}/application.zip' was not found!
> 01:39:59.307 975/975                     Gecko  I   IPDL protocol error: [PRemoteOpenFileChild] Received an invalid file descriptor!
> 01:39:59.307 975/975                MOZ_Assert  F   Assertion failure: mHandleCreatedByOtherProcessWasUsed, at ../../../b2g-inbound/ipc/glue/FileDescriptor.cpp:69

Comment 1

5 years ago
Well then I guess this comment :bent added is a lie :)

  http://mxr.mozilla.org/mozilla-central/source/netwerk/ipc/RemoteOpenFileParent.cpp#55

I was assured that invalid fd's were safe to send across IPDL, but apparently not.

That said, I suspect the underlying error here is that the application.zip is not getting installed.  Is Notes an unusual app in any way?  Does this happen with any other apps?  I'm not familiar with the app install codepath, but it sounds like someone needs to trace through and see where the zip file is getting lost.
Flags: needinfo?(bent.mozilla)

Updated

5 years ago
Summary: Assertion failure: mHandleCreatedByOtherProcessWasUsed, at ../../../b2g-inbound/ipc/glue/FileDescriptor.cpp:69 → Notes app fails to install, crashes Homescreen

Updated

5 years ago
Component: Networking: File → General
Product: Core → Firefox OS
Reporter

Comment 2

5 years ago
(In reply to Jason Duell (:jduell) from comment #1)
> Well then I guess this comment :bent added is a lie :)
> 
>  
> http://mxr.mozilla.org/mozilla-central/source/netwerk/ipc/
> RemoteOpenFileParent.cpp#55
> 
> I was assured that invalid fd's were safe to send across IPDL, but
> apparently not.
> 
> That said, I suspect the underlying error here is that the application.zip
> is not getting installed.  Is Notes an unusual app in any way?  Does this
> happen with any other apps?  I'm not familiar with the app install codepath,
> but it sounds like someone needs to trace through and see where the zip file
> is getting lost.

The Notes app actually gets installed properly and shows up in the Homescreen as well (Hmm. I should verify that on a debug build - I'm using a non-debug build right now).

I'm just installing it from MarketPlace, so I don't know anything about how usual or unusual it is.

I'll get my debug build ruinning and try installing some other apps to see what happens with them.
Assignee

Comment 3

5 years ago
I encountered same issue days ago and filed bug 1054224.
It happens on debug build only, and seems reproducible on every app I installed.  The installation is successful, just we'll see the homescreen crash.
Assignee

Updated

5 years ago
Duplicate of this bug: 1054224
Yeah, looks like I changed that in bug 831307. Sorry!
Flags: needinfo?(bent.mozilla)
Assignee

Comment 6

5 years ago
During packaged app installation, the Homescreen app tries to open the icon in application.zip, however application.zip is not yet available at that moment.

(gdb) fr 0
#0  mozilla::net::RemoteOpenFileChild::AsyncRemoteFileOpen (this=0xaa2d9fb0, aFlags=1, aListener=0xb0a58d3c, 
    aTabChild=0xb0453150, aLoadContext=0xb0453920) at ../../../netwerk/ipc/RemoteOpenFileChild.cpp:245
245	  gNeckoChild->SendPRemoteOpenFileConstructor(this, loadContext, uri, appUri);
(gdb) p mURI->mSpec
$12 = {<nsACString_internal> = {
    mData = 0xadc156a8 "file:///data/local/webapps/%7Bf9110ca5-001f-4b82-b347-e21d8070892e%7D/application.zip", mLength = 85, mFlags = 5}, <No data fields>}
(gdb) p mAppURI->mSpec
$13 = {<nsACString_internal> = {
    mData = 0xaa2d9e78 "app://{f9110ca5-001f-4b82-b347-e21d8070892e}/icon_128x128.png", mLength = 61, 
    mFlags = 5}, <No data fields>}
(gdb) p PrintJSStack()
$14 = 0xad8e3000 "0 anonymous(accept = [function], reject = [function]) [\"app://verticalhome.gaiamobile.org/shared/elements/gaia_grid/js/items/grid_item.js\":32]\n1 fetchBlob(uri = \"app://{f9110ca5-001f-4b82-b347-e21d807"...
(gdb)
Assignee

Updated

5 years ago
Component: General → Gaia::Homescreen
Summary: Notes app fails to install, crashes Homescreen → During app installation, Homescreen app crashed by assertion failure in debug build
Assignee

Comment 7

5 years ago
Since mHandleCreatedByOtherProcessWasUsed is used to ensure that we don't leak the file descriptor, the assertion should not be necessary when file descriptor is invalid because it won't be dupped in such condition.
Attachment #8482618 - Flags: review?(bent.mozilla)
Comment on attachment 8482618 [details] [diff] [review]
Patch: Don't assert when invalid file descriptor received.

Benjamin, can you take this review?  bent is chasing fallout from an important-but-presently-backed-out IndexedDB change.
Attachment #8482618 - Flags: review?(bent.mozilla) → review?(benjamin)
Flags: needinfo?(benjamin)

Comment 9

5 years ago
Comment on attachment 8482618 [details] [diff] [review]
Patch: Don't assert when invalid file descriptor received.

Review of attachment 8482618 [details] [diff] [review]:
-----------------------------------------------------------------

I hope I'm not going too far out on a limb here, but I know this code a bit and the change is small and looks fine, so I'm taking the liberty of +r'ing it.
Attachment #8482618 - Flags: review?(benjamin) → review+

Updated

5 years ago
Flags: needinfo?(benjamin)
Assignee

Updated

5 years ago
Blocks: 1069786
Assignee

Comment 10

5 years ago
Filed bug 1069786 for potential problem in comment 6.
Assignee

Updated

5 years ago
Assignee: nobody → swu
Status: NEW → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/3473082f0de4
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.