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

VERIFIED FIXED in Firefox 24

Status

()

Core
DOM: Device Interfaces
--
blocker
VERIFIED FIXED
5 years ago
5 years ago

People

(Reporter: zac, Assigned: dhylands)

Tracking

({crash, regression, stackwanted})

Trunk
mozilla24
Other
Gonk (Firefox OS)
crash, regression, stackwanted
Points:
---
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)

Details

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

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

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:
Gecko  http://hg.mozilla.org/releases/mozilla-b2g18/rev/606c4fa198c2
Gaia   23cec618ba1ad9f39da1fc5dfa2a4df2b2d5f933
BuildID 20130513230207
Version 18.0



Here is a test case:

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

Updated

5 years ago
Blocks: 858416
Keywords: crash, regression

Updated

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

Updated

5 years ago
Crash Signature: [@ InitCursorEvent::Run ]
(Assignee)

Comment 3

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

Comment 4

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

Comment 5

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

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).
(Assignee)

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+
(Assignee)

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+
(Assignee)

Updated

5 years ago
Whiteboard: [fromAutomation] → [fromAutomation][fixed-in-birch]
https://hg.mozilla.org/mozilla-central/rev/1ff1f234ed00

Based on comment 0, it seems that we could actually test this?
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
https://hg.mozilla.org/releases/mozilla-b2g18/rev/ad04d81b3eeb
status-b2g18: --- → fixed
status-b2g18-v1.0.0: --- → wontfix
status-b2g18-v1.0.1: --- → wontfix
status-firefox22: --- → wontfix
status-firefox23: --- → wontfix
status-firefox24: --- → fixed
(Reporter)

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).
(Assignee)

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.
(Reporter)

Updated

5 years ago
Attachment #749485 - Attachment is obsolete: true
(Reporter)

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!
Status: RESOLVED → VERIFIED
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)

Updated

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