calling enumerate() in DeviceStorage API causes device to crash/reboot

VERIFIED FIXED in Firefox 24



DOM: Device Interfaces
5 years ago
5 years ago


(Reporter: zac, Assigned: dhylands)


({crash, regression, stackwanted})

Gonk (Firefox OS)
crash, regression, stackwanted
Bug Flags:
in-testsuite ?
in-moztrap -

Firefox Tracking Flags

(blocking-b2g:leo+, firefox22 wontfix, firefox23 wontfix, firefox24 fixed, b2g18 fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 wontfix)


(Whiteboard: [fromAutomation][fixed-in-birch], crash signature)


(1 attachment, 1 obsolete attachment)



5 years ago
Since bug 858416 was merged into v1-train calling enumerate on the DeviceStorage object is causing the device to crash and reboot.

This is blocking all of our automated tests as they rely on DeviceStorage and enumerate to gather a list of media files on the device.

Replicated on:
Gaia   23cec618ba1ad9f39da1fc5dfa2a4df2b2d5f933
BuildID 20130513230207
Version 18.0

Here is a test case:

------------test case
    var mediaTypes = ['pictures'];
    mediaTypes.forEach(function (aType) {
        console.log('getting', aType);
        var storage = navigator.getDeviceStorage(aType);


5 years ago
Blocks: 858416
Keywords: crash, regression


5 years ago
Component: General → DOM: Device Interfaces
Product: Boot2Gecko → Core
Version: unspecified → Trunk
We need a stack here.

Zac - Can you get a crash report URL from a phone that is causing the crash?
Keywords: stackwanted


5 years ago
Crash Signature: [@ InitCursorEvent::Run ]

Comment 3

5 years ago
I'll investigate this.
Assignee: nobody → dhylands

Comment 4

5 years ago
Which device are you seeing the crashes on?

Comment 5

5 years ago
Unagi using b2g18/v1-train. I haven't tested any other devices with v1-train today.

Comment 6

5 years ago
Created attachment 749364 [details] [diff] [review]
Add an if check around mFile->mFile

Adds a missing if check. I wasn't able to reproduce the crash, so Marionette must be setting up the environment a little differently than non-marionette.

It's perfectly legal for mFile->mFile to be NULL when using a composite device (because composite devices don't have a real root directory).

Comment 7

5 years ago
Comment on attachment 749364 [details] [diff] [review]
Add an if check around mFile->mFile

Review of attachment 749364 [details] [diff] [review]:

r+'d by kanru on IRC
Attachment #749364 - Flags: review+

Comment 9

5 years ago
I'm going to change this from leo? to leo+ since this is a regression introduced by bug 858416 (which was leo+) and I really want this to land on b2g18 today, so tomorrows sanity tests won't continue to be tripped up.
blocking-b2g: leo? → leo+


5 years ago
Whiteboard: [fromAutomation] → [fromAutomation][fixed-in-birch]

Based on comment 0, it seems that we could actually test this?
Last Resolved: 5 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
status-b2g18: --- → fixed
status-b2g18-v1.0.0: --- → wontfix
status-b2g18-v1.0.1: --- → wontfix
status-firefox22: --- → wontfix
status-firefox23: --- → wontfix
status-firefox24: --- → fixed

Comment 12

5 years ago
Created attachment 749485 [details]
python script to run storage.enumerate

Dave, it might be too late but here is a python script using marionette to run the script I gave in the first comment.

You will need an engineering build that has marionette on it (all of the PVT builds do by default).

Comment 13

5 years ago
Hey zac,

I'm still interested in reproducing the problem, so what do I need to run? I can undo my change locally and run the python script.

I'm trying to understand why the marionette test triggers the problem but why none of the xpcshell tests or the test app trigger the problem.


5 years ago
Attachment #749485 - Attachment is obsolete: true

Comment 14

5 years ago
I had to obsolete that python script as it didn't seem to replicate outside the context of our gaiatest/gaia-ui-tests.

I have a more detailed replication script but you have to do a bit of checking out and what not to run it. Best step now is probably to to CC Jgriffin in here as he knows the guts of Marionette and he may be able to shed some light on the execution difference. If he can't then we can fall back to the other replication script.

Also setting Verified-fixed because our automation suite is back up and running. Thanks!
Flags: needinfo?(jgriffin)
It's hard to say, but one issue may be that the Python script is executing this in the top-level process, and in gaia, this API will likely be exercised in the context of child processes.  You might need to launch an app, switch to its frame, and then try enumerating the storage object.
Flags: needinfo?(jgriffin)


5 years ago
Flags: in-moztrap-
You need to log in before you can comment on or make changes to this bug.