Assertion in mozilla::dom::indexedDB::IndexedDBParent::Disconnect

RESOLVED FIXED in mozilla26

Status

()

defect
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: tzimmermann, Unassigned)

Tracking

Trunk
mozilla26
ARM
Gonk (Firefox OS)
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

An assertion in mozilla::dom::indexedDB::IndexedDBParent::Disconnect fails. This bug first appeared a few days ago. It only happens after you complete the FTU app. Regular booting works fine. The stack trace is shown below.

Gecko rev: 9ff2fa888c04

STR:

  - build with debugging enabled
  - flash images to device
  - go through FTU app

Expected result
 - home screen gets displayed

Actual results:
 - Gecko crashes

>>>>

mozilla@barney:~/Projects/mozilla/src/B2G-master-unagi$ ./run-gdb.sh attach 109
Attached; pid = 109
Listening on port 11111
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-gdb -x /tmp/b2g.gdbinit.mozilla.27212 /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/dist/bin/b2g
GNU gdb (GDB) 7.1-android-gg2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-linux-gnu --target=arm-elf-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/dist/bin/b2g...done.
Remote debugging from host 127.0.0.1
syscall () at bionic/libc/arch-arm/bionic/syscall.S:50
50	    ldmfd   sp!, {r4, r5, r6, r7}
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x41581c80 in mozilla::dom::indexedDB::IndexedDBParent::Disconnect (this=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/indexedDB/ipc/IndexedDBParent.cpp:86
86	  MOZ_ASSERT(!mDisconnected);
(gdb) bt
#0  0x41581c80 in mozilla::dom::indexedDB::IndexedDBParent::Disconnect (this=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/indexedDB/ipc/IndexedDBParent.cpp:86
#1  0x4199ae1a in mozilla::dom::ContentParent::ShutDownProcess (this=0x456ae000, aCloseWithError=true)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/ipc/ContentParent.cpp:838
#2  0x4199b6c0 in mozilla::dom::ContentParent::ActorDestroy (this=0x456ae000, why=mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>::NormalShutdown)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/ipc/ContentParent.cpp:1073
#3  0x41a34cf2 in mozilla::dom::PContentParent::DestroySubtree (this=0x456ae000, why=mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>::NormalShutdown)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/ipc/ipdl/PContentParent.cpp:3918
#4  0x41a34e4e in mozilla::dom::PContentParent::OnChannelClose (this=0x428d02e2)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/ipc/ipdl/PContentParent.cpp:3670
#5  0x419c3cc2 in mozilla::ipc::AsyncChannel::NotifyChannelClosed (this=0x456ae010) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/glue/AsyncChannel.cpp:560
#6  0x419c4dce in mozilla::ipc::AsyncChannel::Close (this=0x456ae010) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/glue/AsyncChannel.cpp:432
#7  0x41a2c9e8 in mozilla::dom::PContentParent::Close (this=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/ipc/ipdl/PContentParent.cpp:289
#8  0x4199ae36 in mozilla::dom::ContentParent::ShutDownProcess (this=0x456ae000, aCloseWithError=false)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/ipc/ContentParent.cpp:849
#9  0x419953a8 in DispatchToMethod<mozilla::dom::ContentParent, void (mozilla::dom::ContentParent::*)(bool), bool> (this=0x1)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/tuple.h:393
#10 RunnableMethod<mozilla::dom::ContentParent, void (mozilla::dom::ContentParent::*)(bool), Tuple1<bool> >::Run (this=0x1)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/task.h:307
#11 0x41de8424 in MessageLoop::RunTask (this=0x4043e0c0, task=0x44383500) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:338
#12 0x41de8b1a in MessageLoop::DeferOrRunPendingTask (this=0x0, pending_task=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:346
#13 0x41de9760 in MessageLoop::DoWork (this=0x4043e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:446
#14 0x419c8c6c in mozilla::ipc::DoWorkRunnable::Run (this=<value optimized out>) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/glue/MessagePump.cpp:41
#15 0x41dbb858 in nsThread::ProcessNextEvent (this=0x40402550, mayWait=<value optimized out>, result=0xbefaf727)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/threads/nsThread.cpp:622
#16 0x41d83302 in NS_ProcessNextEvent (thread=0x40402550, mayWait=false)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/xpcom/build/nsThreadUtils.cpp:238
#17 0x419c8e30 in mozilla::ipc::MessagePump::Run (this=0x40401d90, aDelegate=0x4043e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/glue/MessagePump.cpp:81
#18 0x41de892e in MessageLoop::RunInternal (this=0x4043e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:220
#19 0x41de8946 in MessageLoop::RunHandler (this=0x4043e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:213
#20 MessageLoop::Run (this=0x4043e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:187
#21 0x4194f93e in nsBaseAppShell::Run (this=0x44247340) at /home/mozilla/Projects/mozilla/src/mozilla-central/widget/xpwidgets/nsBaseAppShell.cpp:163
#22 0x41860c9e in nsAppStartup::Run (this=0x443f2640) at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/components/startup/nsAppStartup.cpp:269
#23 0x40dca340 in XREMain::XRE_mainRun (this=0xbefaf994) at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/xre/nsAppRunner.cpp:3855
#24 0x40dccd5a in XREMain::XRE_main (this=0xbefaf994, argc=<value optimized out>, argv=<value optimized out>, aAppData=0x217c0)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/xre/nsAppRunner.cpp:3923
#25 0x40dccef0 in XRE_main (argc=1, argv=0xbefb1b84, aAppData=0x217c0, aFlags=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/xre/nsAppRunner.cpp:4125
#26 0x00009b34 in do_main (argc=1, argv=0xbefb1b84) at /home/mozilla/Projects/mozilla/src/mozilla-central/b2g/app/nsBrowserApp.cpp:168
#27 main (argc=1, argv=0xbefb1b84) at /home/mozilla/Projects/mozilla/src/mozilla-central/b2g/app/nsBrowserApp.cpp:261
(gdb) 
#0  0x41581c80 in mozilla::dom::indexedDB::IndexedDBParent::Disconnect (this=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/indexedDB/ipc/IndexedDBParent.cpp:86
#1  0x4199ae1a in mozilla::dom::ContentParent::ShutDownProcess (this=0x456ae000, aCloseWithError=true)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/ipc/ContentParent.cpp:838
#2  0x4199b6c0 in mozilla::dom::ContentParent::ActorDestroy (this=0x456ae000, why=mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>::NormalShutdown)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/ipc/ContentParent.cpp:1073
#3  0x41a34cf2 in mozilla::dom::PContentParent::DestroySubtree (this=0x456ae000, why=mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>::NormalShutdown)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/ipc/ipdl/PContentParent.cpp:3918
#4  0x41a34e4e in mozilla::dom::PContentParent::OnChannelClose (this=0x428d02e2)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/ipc/ipdl/PContentParent.cpp:3670
#5  0x419c3cc2 in mozilla::ipc::AsyncChannel::NotifyChannelClosed (this=0x456ae010) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/glue/AsyncChannel.cpp:560
#6  0x419c4dce in mozilla::ipc::AsyncChannel::Close (this=0x456ae010) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/glue/AsyncChannel.cpp:432
#7  0x41a2c9e8 in mozilla::dom::PContentParent::Close (this=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/ipc/ipdl/PContentParent.cpp:289
#8  0x4199ae36 in mozilla::dom::ContentParent::ShutDownProcess (this=0x456ae000, aCloseWithError=false)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/ipc/ContentParent.cpp:849
#9  0x419953a8 in DispatchToMethod<mozilla::dom::ContentParent, void (mozilla::dom::ContentParent::*)(bool), bool> (this=0x1)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/tuple.h:393
#10 RunnableMethod<mozilla::dom::ContentParent, void (mozilla::dom::ContentParent::*)(bool), Tuple1<bool> >::Run (this=0x1)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/task.h:307
#11 0x41de8424 in MessageLoop::RunTask (this=0x4043e0c0, task=0x44383500) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:338
#12 0x41de8b1a in MessageLoop::DeferOrRunPendingTask (this=0x0, pending_task=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:346
#13 0x41de9760 in MessageLoop::DoWork (this=0x4043e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:446
#14 0x419c8c6c in mozilla::ipc::DoWorkRunnable::Run (this=<value optimized out>) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/glue/MessagePump.cpp:41
#15 0x41dbb858 in nsThread::ProcessNextEvent (this=0x40402550, mayWait=<value optimized out>, result=0xbefaf727)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/threads/nsThread.cpp:622
#16 0x41d83302 in NS_ProcessNextEvent (thread=0x40402550, mayWait=false)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/xpcom/build/nsThreadUtils.cpp:238
#17 0x419c8e30 in mozilla::ipc::MessagePump::Run (this=0x40401d90, aDelegate=0x4043e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/glue/MessagePump.cpp:81
#18 0x41de892e in MessageLoop::RunInternal (this=0x4043e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:220
#19 0x41de8946 in MessageLoop::RunHandler (this=0x4043e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:213
#20 MessageLoop::Run (this=0x4043e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:187
#21 0x4194f93e in nsBaseAppShell::Run (this=0x44247340) at /home/mozilla/Projects/mozilla/src/mozilla-central/widget/xpwidgets/nsBaseAppShell.cpp:163
#22 0x41860c9e in nsAppStartup::Run (this=0x443f2640) at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/components/startup/nsAppStartup.cpp:269
#23 0x40dca340 in XREMain::XRE_mainRun (this=0xbefaf994) at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/xre/nsAppRunner.cpp:3855
#24 0x40dccd5a in XREMain::XRE_main (this=0xbefaf994, argc=<value optimized out>, argv=<value optimized out>, aAppData=0x217c0)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/xre/nsAppRunner.cpp:3923
#25 0x40dccef0 in XRE_main (argc=1, argv=0xbefb1b84, aAppData=0x217c0, aFlags=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/xre/nsAppRunner.cpp:4125
#26 0x00009b34 in do_main (argc=1, argv=0xbefb1b84) at /home/mozilla/Projects/mozilla/src/mozilla-central/b2g/app/nsBrowserApp.cpp:168
#27 main (argc=1, argv=0xbefb1b84) at /home/mozilla/Projects/mozilla/src/mozilla-central/b2g/app/nsBrowserApp.cpp:261
(gdb) 
#0  0x41581c80 in mozilla::dom::indexedDB::IndexedDBParent::Disconnect (this=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/indexedDB/ipc/IndexedDBParent.cpp:86
#1  0x4199ae1a in mozilla::dom::ContentParent::ShutDownProcess (this=0x456ae000, aCloseWithError=true)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/ipc/ContentParent.cpp:838
#2  0x4199b6c0 in mozilla::dom::ContentParent::ActorDestroy (this=0x456ae000, why=mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>::NormalShutdown)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/ipc/ContentParent.cpp:1073
#3  0x41a34cf2 in mozilla::dom::PContentParent::DestroySubtree (this=0x456ae000, why=mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>::NormalShutdown)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/ipc/ipdl/PContentParent.cpp:3918
#4  0x41a34e4e in mozilla::dom::PContentParent::OnChannelClose (this=0x428d02e2)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/ipc/ipdl/PContentParent.cpp:3670
#5  0x419c3cc2 in mozilla::ipc::AsyncChannel::NotifyChannelClosed (this=0x456ae010) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/glue/AsyncChannel.cpp:560
#6  0x419c4dce in mozilla::ipc::AsyncChannel::Close (this=0x456ae010) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/glue/AsyncChannel.cpp:432
#7  0x41a2c9e8 in mozilla::dom::PContentParent::Close (this=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/ipc/ipdl/PContentParent.cpp:289
#8  0x4199ae36 in mozilla::dom::ContentParent::ShutDownProcess (this=0x456ae000, aCloseWithError=false)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/ipc/ContentParent.cpp:849
#9  0x419953a8 in DispatchToMethod<mozilla::dom::ContentParent, void (mozilla::dom::ContentParent::*)(bool), bool> (this=0x1)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/tuple.h:393
#10 RunnableMethod<mozilla::dom::ContentParent, void (mozilla::dom::ContentParent::*)(bool), Tuple1<bool> >::Run (this=0x1)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/task.h:307
#11 0x41de8424 in MessageLoop::RunTask (this=0x4043e0c0, task=0x44383500) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:338
#12 0x41de8b1a in MessageLoop::DeferOrRunPendingTask (this=0x0, pending_task=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:346
#13 0x41de9760 in MessageLoop::DoWork (this=0x4043e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:446
#14 0x419c8c6c in mozilla::ipc::DoWorkRunnable::Run (this=<value optimized out>) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/glue/MessagePump.cpp:41
#15 0x41dbb858 in nsThread::ProcessNextEvent (this=0x40402550, mayWait=<value optimized out>, result=0xbefaf727)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/threads/nsThread.cpp:622
#16 0x41d83302 in NS_ProcessNextEvent (thread=0x40402550, mayWait=false)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/xpcom/build/nsThreadUtils.cpp:238
#17 0x419c8e30 in mozilla::ipc::MessagePump::Run (this=0x40401d90, aDelegate=0x4043e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/glue/MessagePump.cpp:81
#18 0x41de892e in MessageLoop::RunInternal (this=0x4043e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:220
#19 0x41de8946 in MessageLoop::RunHandler (this=0x4043e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:213
#20 MessageLoop::Run (this=0x4043e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:187
#21 0x4194f93e in nsBaseAppShell::Run (this=0x44247340) at /home/mozilla/Projects/mozilla/src/mozilla-central/widget/xpwidgets/nsBaseAppShell.cpp:163
#22 0x41860c9e in nsAppStartup::Run (this=0x443f2640) at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/components/startup/nsAppStartup.cpp:269
#23 0x40dca340 in XREMain::XRE_mainRun (this=0xbefaf994) at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/xre/nsAppRunner.cpp:3855
#24 0x40dccd5a in XREMain::XRE_main (this=0xbefaf994, argc=<value optimized out>, argv=<value optimized out>, aAppData=0x217c0)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/xre/nsAppRunner.cpp:3923
#25 0x40dccef0 in XRE_main (argc=1, argv=0xbefb1b84, aAppData=0x217c0, aFlags=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/xre/nsAppRunner.cpp:4125
#26 0x00009b34 in do_main (argc=1, argv=0xbefb1b84) at /home/mozilla/Projects/mozilla/src/mozilla-central/b2g/app/nsBrowserApp.cpp:168
#27 main (argc=1, argv=0xbefb1b84) at /home/mozilla/Projects/mozilla/src/mozilla-central/b2g/app/nsBrowserApp.cpp:261
(gdb)
Component: General → DOM: IndexedDB
Product: Boot2Gecko → Core
Version: unspecified → Trunk
I debugged this a bit. Disconnect get called two times during the shutdown process of the FTU app. The first time

(gdb) c
Continuing.

Breakpoint 1, mozilla::dom::indexedDB::IndexedDBParent::Disconnect (this=0x45df2a80)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/indexedDB/ipc/IndexedDBParent.cpp:87
warning: Source file is more recent than executable.
87	
(gdb) bt
#0  mozilla::dom::indexedDB::IndexedDBParent::Disconnect (this=0x45df2a80) at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/indexedDB/ipc/IndexedDBParent.cpp:87
#1  0x418cfbf8 in mozilla::dom::TabParent::Destroy (this=0x46184a40) at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/ipc/TabParent.cpp:269
#2  0x4117ed30 in nsFrameLoader::DestroyChild (this=0x475166a0) at /home/mozilla/Projects/mozilla/src/mozilla-central/content/base/src/nsFrameLoader.cpp:1315
#3  0x41182ca6 in nsFrameLoader::Destroy (this=0x475166a0) at /home/mozilla/Projects/mozilla/src/mozilla-central/content/base/src/nsFrameLoader.cpp:1344
#4  0x4127d80e in nsGenericHTMLFrameElement::UnbindFromTree (this=0x45dc47c0, aDeep=true, aNullParent=false)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/content/html/content/src/nsGenericHTMLFrameElement.cpp:220
#5  0x4110befa in mozilla::dom::Element::UnbindFromTree (this=0x47516560, aDeep=<value optimized out>, aNullParent=true)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/content/base/src/Element.cpp:1216
#6  0x4127baa4 in nsGenericHTMLElement::UnbindFromTree (this=0x47516560, aDeep=true, aNullParent=true)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/content/html/content/src/nsGenericHTMLElement.cpp:641
#7  0x4119572e in nsINode::doRemoveChildAt (this=0x47c582e0, aIndex=7, aNotify=true, aKid=0x47516560, aChildArray=...)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/content/base/src/nsINode.cpp:1495
#8  0x41117c34 in mozilla::dom::FragmentOrElement::RemoveChildAt (this=0x47c582e0, aIndex=7, aNotify=true)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/content/base/src/FragmentOrElement.cpp:965
#9  0x41193f2c in nsINode::RemoveChild (this=0x47c582e0, aOldChild=..., aError=...) at /home/mozilla/Projects/mozilla/src/mozilla-central/content/base/src/nsINode.cpp:460
#10 0x41b249da in removeChild (cx=0x474f2970, obj=..., self=0x47c582e0, args=...)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/dom/bindings/NodeBinding.cpp:632
#11 0x41b240f4 in genericMethod (cx=0x474f2970, argc=<value optimized out>, vp=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/dom/bindings/NodeBinding.cpp:1188
#12 0x421658ec in js::CallJSNative (cx=0x474f2970, native=0x41b24041 <genericMethod>, args=...)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/js/src/jscntxtinlines.h:218
#13 0x4216f562 in js::Invoke (cx=0x474f2970, args=..., construct=js::NO_CONSTRUCT) at /home/mozilla/Projects/mozilla/src/mozilla-central/js/src/vm/Interpreter.cpp:489
#14 0x4216ccc6 in Interpret (cx=0x474f2970, state=...) at /home/mozilla/Projects/mozilla/src/mozilla-central/js/src/vm/Interpreter.cpp:2484
#15 0x4216ef80 in js::RunScript (cx=0x474f2970, state=...) at /home/mozilla/Projects/mozilla/src/mozilla-central/js/src/vm/Interpreter.cpp:446
#16 0x4216f4f8 in js::Invoke (cx=0x474f2970, args=..., construct=js::NO_CONSTRUCT) at /home/mozilla/Projects/mozilla/src/mozilla-central/js/src/vm/Interpreter.cpp:508
#17 0x4216fe0e in js::Invoke (cx=0x474f2970, thisv=..., fval=..., argc=0, argv=0xbefa5318, rval=...)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/js/src/vm/Interpreter.cpp:539
#18 0x42237de2 in JS_CallFunctionValue (cx=0x474f2970, objArg=<value optimized out>, fval=..., argc=0, argv=0xbefa5318, rval=0xbefa53a0)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/js/src/jsapi.cpp:5363
#19 0x41a797a0 in mozilla::dom::Function::Call (this=<value optimized out>, cx=0x474f2970, aThisObj=..., arguments=..., aRv=...)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/dom/bindings/FunctionBinding.cpp:38
#20 0x413b8408 in Call<nsCOMPtr<nsISupports> > (this=0x403ff650, aTimeout=<value optimized out>, aScx=<value optimized out>)
    at ../../dist/include/mozilla/dom/FunctionBinding.h:52
#21 nsGlobalWindow::RunTimeoutHandler (this=0x403ff650, aTimeout=<value optimized out>, aScx=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/base/nsGlobalWindow.cpp:10427
#22 0x413b90c2 in nsGlobalWindow::RunTimeout (this=0x403ff650, aTimeout=0x475b91a0) at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/base/nsGlobalWindow.cpp:10665
#23 0x413b9286 in nsGlobalWindow::TimerCallback (aTimer=<value optimized out>, aClosure=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/base/nsGlobalWindow.cpp:10912
#24 0x41ced034 in nsTimerImpl::Fire (this=0x475b91f0) at /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/threads/nsTimerImpl.cpp:544
#25 0x41ced222 in nsTimerEvent::Run (this=0x45771710) at /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/threads/nsTimerImpl.cpp:628
#26 0x41ce9550 in nsThread::ProcessNextEvent (this=0x40302550, mayWait=<value optimized out>, result=0xbefa5727)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/threads/nsThread.cpp:622
---Type <return> to continue, or q <return> to quit---
#27 0x41cb2356 in NS_ProcessNextEvent (thread=0x40302550, mayWait=false)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/xpcom/build/nsThreadUtils.cpp:238
#28 0x418f1f00 in mozilla::ipc::MessagePump::Run (this=0x40301d90, aDelegate=0x4033e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/glue/MessagePump.cpp:81
#29 0x41d156be in MessageLoop::RunInternal (this=0x4033e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:220
#30 0x41d156d6 in MessageLoop::RunHandler (this=0x4033e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:213
#31 MessageLoop::Run (this=0x4033e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:187
#32 0x41879e66 in nsBaseAppShell::Run (this=0x44247340) at /home/mozilla/Projects/mozilla/src/mozilla-central/widget/xpwidgets/nsBaseAppShell.cpp:163
#33 0x4178e47a in nsAppStartup::Run (this=0x443f2640) at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/components/startup/nsAppStartup.cpp:269
#34 0x40d11480 in XREMain::XRE_mainRun (this=0xbefa5994) at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/xre/nsAppRunner.cpp:3855
#35 0x40d13e9a in XREMain::XRE_main (this=0xbefa5994, argc=<value optimized out>, argv=<value optimized out>, aAppData=0x217c0)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/xre/nsAppRunner.cpp:3923
#36 0x40d14030 in XRE_main (argc=1, argv=0xbefa7b84, aAppData=0x217c0, aFlags=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/xre/nsAppRunner.cpp:4125
#37 0x00009b34 in do_main (argc=1, argv=0xbefa7b84) at /home/mozilla/Projects/mozilla/src/mozilla-central/b2g/app/nsBrowserApp.cpp:168
#38 main (argc=1, argv=0xbefa7b84) at /home/mozilla/Projects/mozilla/src/mozilla-central/b2g/app/nsBrowserApp.cpp:261
(gdb) q

and a second time, where the assertion fails:

(gdb) c
Continuing.

Breakpoint 1, mozilla::dom::indexedDB::IndexedDBParent::Disconnect (this=0x44340600)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/indexedDB/ipc/IndexedDBParent.cpp:87
87	
(gdb) bt
#0  mozilla::dom::indexedDB::IndexedDBParent::Disconnect (this=0x44340600) at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/indexedDB/ipc/IndexedDBParent.cpp:87
#1  0x418c4422 in mozilla::dom::ContentParent::ShutDownProcess (this=0x45240400, aCloseWithError=false)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/ipc/ContentParent.cpp:838
#2  0x418beaa0 in DispatchToMethod<mozilla::dom::ContentParent, void (mozilla::dom::ContentParent::*)(bool), bool> (this=0x1)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/tuple.h:393
#3  RunnableMethod<mozilla::dom::ContentParent, void (mozilla::dom::ContentParent::*)(bool), Tuple1<bool> >::Run (this=0x1)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/task.h:307
#4  0x41d151b4 in MessageLoop::RunTask (this=0x4033e0c0, task=0x47ca0a40) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:338
#5  0x41d158aa in MessageLoop::DeferOrRunPendingTask (this=0x44340600, pending_task=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:346
#6  0x41d164f0 in MessageLoop::DoWork (this=0x4033e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:446
#7  0x418f1d3c in mozilla::ipc::DoWorkRunnable::Run (this=<value optimized out>) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/glue/MessagePump.cpp:41
#8  0x41ce9550 in nsThread::ProcessNextEvent (this=0x40302550, mayWait=<value optimized out>, result=0xbefa54e7)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/threads/nsThread.cpp:622
#9  0x41cb2356 in NS_ProcessNextEvent (thread=0x40302550, mayWait=true)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/xpcom/build/nsThreadUtils.cpp:238
#10 0x41cea2ba in nsThread::Shutdown (this=0x45d18c50) at /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/threads/nsThread.cpp:463
#11 0x40d7ce9c in nsRunnableMethodImpl<unsigned int (mozilla::net::BackgroundFileSaverStreamListener::*)(), true>::Run (this=<value optimized out>)
    at ../../../dist/include/nsThreadUtils.h:356
#12 0x41ce9550 in nsThread::ProcessNextEvent (this=0x40302550, mayWait=<value optimized out>, result=0xbefa55a7)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/threads/nsThread.cpp:622
#13 0x41cb2356 in NS_ProcessNextEvent (thread=0x40302550, mayWait=true)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/xpcom/build/nsThreadUtils.cpp:238
#14 0x41cea2ba in nsThread::Shutdown (this=0x458c12e0) at /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/threads/nsThread.cpp:463
#15 0x40d7ce9c in nsRunnableMethodImpl<unsigned int (mozilla::net::BackgroundFileSaverStreamListener::*)(), true>::Run (this=<value optimized out>)
    at ../../../dist/include/nsThreadUtils.h:356
#16 0x41ce9550 in nsThread::ProcessNextEvent (this=0x40302550, mayWait=<value optimized out>, result=0xbefa5667)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/threads/nsThread.cpp:622
#17 0x41cb2356 in NS_ProcessNextEvent (thread=0x40302550, mayWait=true)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/xpcom/build/nsThreadUtils.cpp:238
#18 0x41cea2ba in nsThread::Shutdown (this=0x457f3630) at /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/threads/nsThread.cpp:463
#19 0x40d7ce9c in nsRunnableMethodImpl<unsigned int (mozilla::net::BackgroundFileSaverStreamListener::*)(), true>::Run (this=<value optimized out>)
    at ../../../dist/include/nsThreadUtils.h:356
#20 0x41ce9550 in nsThread::ProcessNextEvent (this=0x40302550, mayWait=<value optimized out>, result=0xbefa5727)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/xpcom/threads/nsThread.cpp:622
#21 0x41cb2356 in NS_ProcessNextEvent (thread=0x40302550, mayWait=false)
    at /home/mozilla/Projects/mozilla/src/B2G-master-unagi/objdir-gecko-debug/xpcom/build/nsThreadUtils.cpp:238
#22 0x418f1f00 in mozilla::ipc::MessagePump::Run (this=0x40301d90, aDelegate=0x4033e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/glue/MessagePump.cpp:81
#23 0x41d156be in MessageLoop::RunInternal (this=0x4033e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:220
#24 0x41d156d6 in MessageLoop::RunHandler (this=0x4033e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:213
#25 MessageLoop::Run (this=0x4033e0c0) at /home/mozilla/Projects/mozilla/src/mozilla-central/ipc/chromium/src/base/message_loop.cc:187
#26 0x41879e66 in nsBaseAppShell::Run (this=0x44247340) at /home/mozilla/Projects/mozilla/src/mozilla-central/widget/xpwidgets/nsBaseAppShell.cpp:163
---Type <return> to continue, or q <return> to quit---
#27 0x4178e47a in nsAppStartup::Run (this=0x443f2640) at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/components/startup/nsAppStartup.cpp:269
#28 0x40d11480 in XREMain::XRE_mainRun (this=0xbefa5994) at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/xre/nsAppRunner.cpp:3855
#29 0x40d13e9a in XREMain::XRE_main (this=0xbefa5994, argc=<value optimized out>, argv=<value optimized out>, aAppData=0x217c0)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/xre/nsAppRunner.cpp:3923
#30 0x40d14030 in XRE_main (argc=1, argv=0xbefa7b84, aAppData=0x217c0, aFlags=<value optimized out>)
    at /home/mozilla/Projects/mozilla/src/mozilla-central/toolkit/xre/nsAppRunner.cpp:4125
#31 0x00009b34 in do_main (argc=1, argv=0xbefa7b84) at /home/mozilla/Projects/mozilla/src/mozilla-central/b2g/app/nsBrowserApp.cpp:168
#32 main (argc=1, argv=0xbefa7b84) at /home/mozilla/Projects/mozilla/src/mozilla-central/b2g/app/nsBrowserApp.cpp:261
(gdb)
This is probably related to the recent ShutdownProcess changes.
I think this started around 2 weeks ago. Do you have a bug number?
This might have side effects, but it works if I remove the call at

> #1  0x418c4422 in mozilla::dom::ContentParent::ShutDownProcess (this=0x45240400, aCloseWithError=false)
>    at /home/mozilla/Projects/mozilla/src/mozilla-central/dom/ipc/ContentParent.cpp:838
Hey,

You made the patch that seems to have introduced this bug. Any ideas?
Flags: needinfo?(justin.lebar+bug)
Posted patch 01_fix_disconnect.patch (obsolete) — Splinter Review
This fixes the problem for me.
Comment on attachment 792176 [details] [diff] [review]
01_fix_disconnect.patch

This seems sensible to me, but bent should double-check it, because I obviously don't understand this code.
Attachment #792176 - Flags: review?(bent.mozilla)
Attachment #792176 - Flags: feedback+
Comment on attachment 792176 [details] [diff] [review]
01_fix_disconnect.patch

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

::: dom/ipc/ContentParent.cpp
@@ +837,5 @@
>      for (uint32_t i = 0; i < idbParents.Length(); ++i) {
> +        IndexedDBParent* idbParent =
> +            static_cast<IndexedDBParent*>(idbParents[i]);
> +        if (!idbParent->IsDisconnected()) {
> +            idbParent->Disconnect();

This works and is fine but I think I'd prefer us to just change IndexedDBParent::Disconnect to just not assert and bail out if it is called twice.

The assertion just meant that, at the time when I wrote it, it wasn't possible to be called twice. Now it can, so let's just remove it and handle the case.
Attachment #792176 - Flags: review?(bent.mozilla) → review-
Flags: needinfo?(justin.lebar+bug)
Attachment #792176 - Attachment is obsolete: true
Attachment #792715 - Flags: review?(bent.mozilla)
Comment on attachment 792715 [details] [diff] [review]
[01] Bug 904637: Only disconnect IndexDBParents once (v2)

Thanks!
Attachment #792715 - Flags: review?(bent.mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/8709555732ea
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.