Closed Bug 1173484 Opened 5 years ago Closed 5 years ago

Fix and re-enable test_storageAreaListener.html on B2G debug builds

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed
b2g-v2.2 --- unaffected
b2g-master --- fixed

People

(Reporter: RyanVM, Assigned: dhylands)

Details

Attachments

(1 file)

Today, a large patch landed which shuffled around the order of the DOM mochitests. This caused the devicemanager tests to be split across two different chunks instead of all within one. As a result, test_storageAreaListener.html began timing out about 40% of the time as shown in the log below. In order to get the trees open again, I'm disabling the test for the time-being.

https://treeherder.mozilla.org/logviewer.html#?job_id=10611007&repo=mozilla-inbound

11:09:17 INFO - 36 INFO TEST-START | dom/devicestorage/test/test_storageAreaListener.html
11:09:32 INFO - [Parent 761] WARNING: pipe error (72): Connection reset by peer: file /builds/slave/b2g_m-in_emu-d_dep-00000000000/build/gecko/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 459
11:09:32 INFO - [Parent 761] WARNING: pipe error: Broken pipe: file /builds/slave/b2g_m-in_emu-d_dep-00000000000/build/gecko/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 760
11:09:32 INFO - [Parent 761] WARNING: pipe error: Broken pipe: file /builds/slave/b2g_m-in_emu-d_dep-00000000000/build/gecko/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 760
11:09:32 INFO - [Parent 761] WARNING: pipe error: Broken pipe: file /builds/slave/b2g_m-in_emu-d_dep-00000000000/build/gecko/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 760
11:09:32 INFO - [Parent 761] WARNING: pipe error (73): Connection reset by peer: file /builds/slave/b2g_m-in_emu-d_dep-00000000000/build/gecko/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 459
11:09:32 INFO - ############ ErrorPage.js
11:09:32 INFO - [Parent 761] WARNING: RemoveObserver() called for unregistered observer: file ../../gecko/hal/Hal.cpp, line 205
11:09:32 INFO - [Parent 761] WARNING: RemoveObserver() called for unregistered observer: file ../../gecko/hal/Hal.cpp, line 205
11:09:32 INFO - [Parent 761] WARNING: RemoveObserver() called for unregistered observer: file ../../gecko/hal/Hal.cpp, line 205
11:09:32 INFO - [Parent 761] WARNING: RemoveObserver() called for unregistered observer: file ../../gecko/hal/Hal.cpp, line 205
11:09:32 INFO - [Parent 761] ###!!! ASSERTION: unknown process type: 'Error', file /builds/slave/b2g_m-in_emu-d_dep-00000000000/build/gecko/dom/ipc/CrashReporterParent.cpp, line 124
11:09:32 INFO - #01: ???[libxul.so +0x1281446]
11:09:32 INFO - #02: ???[libxul.so +0x1292376]
11:09:32 INFO - #03: ???[libxul.so +0x716cf8]
11:09:32 INFO - #04: ???[libxul.so +0x718080]
11:09:32 INFO - #05: ???[libxul.so +0x12914b2]
11:09:32 INFO - #06: ???[libxul.so +0x5c4398]
11:09:32 INFO - #07: ???[libxul.so +0x5c4416]
11:09:32 INFO - #08: ???[libxul.so +0x3a61c6]
11:09:32 INFO - #09: ???[libxul.so +0x5a7c5c]
11:09:32 INFO - #10: ???[libxul.so +0x5aaf36]
11:09:32 INFO - #11: ???[libxul.so +0x5acde8]
11:09:32 INFO - #12: ???[libxul.so +0x5b8eba]
11:09:32 INFO - #13: ???[libxul.so +0x3e48da]
11:09:32 INFO - #14: ???[libxul.so +0x3fde70]
11:09:32 INFO - #15: ???[libxul.so +0x5bdccc]
11:09:32 INFO - #16: ???[libxul.so +0x5a85ec]
11:09:32 INFO - #17: ???[libxul.so +0x5a8606]
11:09:32 INFO - #18: ???[libxul.so +0x13ba70a]
11:09:32 INFO - #19: ???[libxul.so +0x185abe4]
11:09:32 INFO - #20: ???[libxul.so +0x189569e]
11:09:32 INFO - #21: ???[libxul.so +0x18959cc]
11:09:32 INFO - #22: XRE_main[libxul.so +0x1895b9a]
11:09:32 INFO - #23: ???[/system/b2g/b2g +0x10e1e]
11:09:32 INFO - #24: ???[/system/b2g/b2g +0x10f90]
11:09:32 INFO - #25: ???[/system/b2g/b2g +0x10ca0]
11:09:32 INFO - #26: __libc_init[libc.so +0x16722]
11:09:32 INFO - [Parent 761] WARNING: NS_ENSURE_TRUE(mCallback) failed: file ../../../gecko/dom/base/nsFrameMessageManager.cpp, line 805
11:09:32 INFO - JavaScript error: chrome://specialpowers/content/SpecialPowersObserver.js, line 106: NS_ERROR_NOT_INITIALIZED: Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]
11:10:33 INFO - [Parent 761] WARNING: A control runnable was posted to a worker that is already shutting down!: file /builds/slave/b2g_m-in_emu-d_dep-00000000000/build/gecko/dom/workers/WorkerPrivate.cpp, line 2873
11:10:33 INFO - [Parent 761] WARNING: A control runnable was posted to a worker that is already shutting down!: file /builds/slave/b2g_m-in_emu-d_dep-00000000000/build/gecko/dom/workers/WorkerPrivate.cpp, line 2873
11:18:27 INFO - DeviceRunner TEST-UNEXPECTED-FAIL | dom/devicestorage/test/test_storageAreaListener.html | application timed out after 450.0 seconds with no output
11:18:27 WARNING - PROCESS-CRASH | dom/devicestorage/test/test_storageAreaListener.html | application crashed [@ mozilla::DOMEventTargetHelper::AddRef]
11:18:27 INFO - Crash dump filename: /tmp/tmphStbYR/2cea7dd8-0ee2-e384-461d1683-79d1fdda.dmp
11:18:27 INFO - Operating system: Android
11:18:27 INFO - 0.0.0 Linux 2.6.29-g41a03df #22 Thu Jun 26 10:59:09 CST 2014 armv7l Android/full/generic:4.0.4.0.4.0.4/OPENMASTER/eng.cltbld.20150610.130031:eng/test-keys
11:18:27 INFO - CPU: arm
11:18:27 INFO - 0 CPUs
11:18:27 INFO - Crash reason: SIGSEGV
11:18:27 INFO - Crash address: 0x14
11:18:27 INFO - Thread 0 (crashed)
11:18:27 INFO - 0 libxul.so!mozilla::DOMEventTargetHelper::AddRef [nsISupportsImpl.h : 125 + 0x0]
11:18:27 INFO - r4 = 0x00000000 r5 = 0x00000000 r6 = 0x402c1e30 r7 = 0xbef9f314
11:18:27 INFO - r8 = 0x00000001 r9 = 0xbef9f288 r10 = 0xbef9f314 fp = 0x466a0240
11:18:27 INFO - sp = 0xbef9f1f0 lr = 0x417680b5 pc = 0x4178313c
11:18:27 INFO - Found by: given as instruction pointer in context
11:18:27 INFO - 1 libxul.so!nsDOMDeviceStorage::AddRef [nsDeviceStorage.cpp:fcfdee109765 : 3367 + 0x5]
11:18:27 INFO - r4 = 0xbef9f210 r5 = 0x00000000 r6 = 0x402c1e30 r7 = 0xbef9f314
11:18:27 INFO - r8 = 0x00000001 r9 = 0xbef9f288 r10 = 0xbef9f314 fp = 0x466a0240
11:18:27 INFO - sp = 0xbef9f200 pc = 0x417680b5
11:18:27 INFO - Found by: call frame info
11:18:27 INFO - 2 libxul.so!nsDOMDeviceStorage::CreateDeviceStorageByNameAndType [nsDeviceStorage.cpp:fcfdee109765 : 3609 + 0x5]
11:18:27 INFO - r4 = 0xbef9f210 r5 = 0xbef9f23c r6 = 0x402c1e30 r7 = 0xbef9f314
11:18:27 INFO - r8 = 0x00000001 r9 = 0xbef9f288 r10 = 0xbef9f314 fp = 0x466a0240
11:18:27 INFO - sp = 0xbef9f210 pc = 0x41775d1b
11:18:27 INFO - Found by: call frame info
11:18:27 INFO - 3 libxul.so!mozilla::dom::Navigator::GetDeviceStorageByNameAndType [Navigator.cpp:fcfdee109765 : 987 + 0x7]
11:18:27 INFO - r4 = 0xbef9f23c r5 = 0x402c1e30 r6 = 0x466a0240 r7 = 0xbef9f314
11:18:27 INFO - r8 = 0xbef9f288 r9 = 0xbef9f3cc r10 = 0xbef9f314 fp = 0x466a0240
11:18:27 INFO - sp = 0xbef9f238 pc = 0x4122eb9d
11:18:27 INFO - Found by: call frame info
11:18:27 INFO - 4 libxul.so!mozilla::dom::NavigatorBinding::getDeviceStorageByNameAndType [NavigatorBinding.cpp : 1416 + 0x3]
11:18:27 INFO - r4 = 0xbef9f270 r5 = 0x00000001 r6 = 0x458dfac0 r7 = 0x00000000
11:18:27 INFO - r8 = 0xbef9f288 r9 = 0xbef9f3cc r10 = 0xbef9f314 fp = 0x466a0240
11:18:27 INFO - sp = 0xbef9f258 pc = 0x41419003
11:18:27 INFO - Found by: call frame info
11:18:27 INFO - 5 libxul.so!mozilla::dom::GenericBindingMethod [BindingUtils.cpp:fcfdee109765 : 2599 + 0x3]
11:18:27 INFO - r4 = 0x458dfac0 r5 = 0x43bfdbd8 r6 = 0xbef9f3e8 r7 = 0x41418f81
11:18:27 INFO - r8 = 0x00000192 r9 = 0xbef9f3cc r10 = 0x00000000 fp = 0x46667800
11:18:27 INFO - sp = 0xbef9f3c8 pc = 0x416e84bf
11:18:27 INFO - Found by: call frame info
11:18:27 INFO - 6 libxul.so!js::CallJSNative [jscntxtinlines.h:fcfdee109765 : 235 + 0x3]
11:18:27 INFO - r4 = 0x45939080 r5 = 0x458dfac0 r6 = 0xbef9f854 r7 = 0x45939078
11:18:27 INFO - r8 = 0x00000000 r9 = 0xbef9f41c r10 = 0x416e83f5 fp = 0x46667800
11:18:27 INFO - sp = 0xbef9f418 pc = 0x424a3a03
11:18:27 INFO - Found by: call frame info
https://hg.mozilla.org/integration/mozilla-inbound/rev/bc91c5cd4c94
Whiteboard: [test disabled on B2G debug][leave open]
While investigating this bug, I discovered 2 problems:

1 - In CreateDeviceStorageByNameAndType, if GetStorageByNameAndType returns nullptr (because the named storage, or storage type is invalid), then a segfault would occur.

I added a call to navigator.getDeviceStorageByNameAndType to the test, and pre-patchy this causes a segfault 100% of the time.

2 - Once nsDOMDeviceStorage::GetOrdeedVolumes determines an ordered list, it caches it. If the volumes have already been cached, then it won't ever see the newly added volume. Calling navigator.getDeviceStorageByNameAndType (in the test) would cause the cache to be primed, and it would never see the new volume and this would fall over the segfault.

I added a hook that causes the cache to be invalidated whenever a new volume is added or removed.

I also had to rename GetDiskFreeSpace to GetStorageFreeSpace in order to avoid conflicts with Win32's GetDiskFreeSpace macro.
Attachment #8622706 - Flags: review?(aosmond)
Comment on attachment 8622706 [details] [diff] [review]
Fix crash caused by adding new volumes

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

LGTM.
Attachment #8622706 - Flags: review?(aosmond) → review+
https://hg.mozilla.org/mozilla-central/rev/15f9071b4551
Status: NEW → RESOLVED
Closed: 5 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [test disabled on B2G debug][leave open]
Target Milestone: --- → mozilla41
Is this something we might want on b2g37 as well? If there's an underlying timebomb here, I'd lean in favor if the risk isn't too high.
status-b2g-v2.2: --- → ?
Flags: needinfo?(dhylands)
Comment on attachment 8622706 [details] [diff] [review]
Fix crash caused by adding new volumes

NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 1126694
User impact if declined: b2g crash
Testing completed: Added test which trips 100% pre-patch
Risk to taking this patch (and alternatives if risky): low
String or UUID changes made by this patch:none
Flags: needinfo?(dhylands)
Attachment #8622706 - Flags: approval-mozilla-b2g37?
Bug 1126694 landed on Gecko 40, so I guess this doesn't affect v2.2?
Comment on attachment 8622706 [details] [diff] [review]
Fix crash caused by adding new volumes

Doh - As Ryan points out, the affecting bug landed in gecko 40, so this can't be uplifted prior to that.
Attachment #8622706 - Flags: approval-mozilla-b2g37?
You need to log in before you can comment on or make changes to this bug.