Closed
Bug 752171
Opened 13 years ago
Closed 13 years ago
Yep, it can be 0 --- "###!!! ASSERTION: This should never be 0!: 'depth', file indexedDB/IDBTransaction.cpp, line 150"
Categories
(Core :: Storage: IndexedDB, defect)
Core
Storage: IndexedDB
Tracking
()
RESOLVED
DUPLICATE
of bug 672667
People
(Reporter: cjones, Unassigned)
References
Details
This happens when loading the b2g browser app out of process, in the parent process (apparently after an event is fired back to the parent while the child is loading).
The problem is that we're creating a transaction in response to an IPC message, which doesn't go through XPCOM event dispatch.
I'm not sure what this assertion is supposed to be guarding against, but I think the only other way we could get an IDB transaction created with depth == 0 is for the construction of an object from a static or non-event-looped thread context, which will be totally broken anyway. I'll post a patch to normalize 0 to 1 with a comment to that effect.
Backtrace is below
(gdb) bt
#0 mozilla::dom::indexedDB::IDBTransaction::Create (aDatabase=0x4350e200, aObjectStoreNames=..., aMode=mozilla::dom::indexedDB::IDBTransaction::READ_WRITE, aDispatchDelayed=false) at /home/cjones/mozilla/jl-mc/dom/indexedDB/IDBTransaction.cpp:152
#1 0x40ff2f8e in mozilla::dom::indexedDB::IDBDatabase::Transaction (this=0x4350e200, aStoreNames=..., aMode=..., aCx=0x4483f0b0, aOptionalArgCount=1 '\001', _retval=0xbeed3abc) at /home/cjones/mozilla/jl-mc/dom/indexedDB/IDBDatabase.cpp:660
#2 0x413c2ba6 in nsIIDBDatabase_Transaction (cx=0x4483f0b0, argc=2, vp=0x43e00358) at /home/cjones/mozilla/b2g/objdir-gecko/js/xpconnect/src/dom_quickstubs.cpp:27066
#3 0x41f14c56 in js::CallJSNative (cx=0x4483f0b0, native=0x413c299d <nsIIDBDatabase_Transaction(JSContext*, unsigned int, jsval*)>, args=...) at /home/cjones/mozilla/jl-mc/js/src/jscntxtinlines.h:314
#4 0x41f1a7ae in js::InvokeKernel (cx=0x4483f0b0, args=..., construct=js::NO_CONSTRUCT) at /home/cjones/mozilla/jl-mc/js/src/jsinterp.cpp:519
#5 0x41f2862a in js::Interpret (cx=0x4483f0b0, entryFrame=0x43e00130, interpMode=js::JSINTERP_NORMAL) at /home/cjones/mozilla/jl-mc/js/src/jsinterp.cpp:2757
#6 0x41f1a562 in js::RunScript (cx=0x4483f0b0, script=0x446c7dd0, fp=0x43e00130) at /home/cjones/mozilla/jl-mc/js/src/jsinterp.cpp:475
#7 0x41f1a84e in js::InvokeKernel (cx=0x4483f0b0, args=..., construct=js::NO_CONSTRUCT) at /home/cjones/mozilla/jl-mc/js/src/jsinterp.cpp:535
#8 0x41e8e84c in js::Invoke (cx=0x4483f0b0, args=..., construct=js::NO_CONSTRUCT) at /home/cjones/mozilla/jl-mc/js/src/jsinterp.h:172
#9 0x41f1a9f4 in js::Invoke (cx=0x4483f0b0, thisv=..., fval=..., argc=1, argv=0xbeed46f0, rval=0xbeed4810) at /home/cjones/mozilla/jl-mc/js/src/jsinterp.cpp:567
#10 0x41e8538c in JS_CallFunctionValue (cx=0x4483f0b0, obj=0x446d00d0, fval=..., argc=1, argv=0xbeed46f0, rval=0xbeed4810) at /home/cjones/mozilla/jl-mc/js/src/jsapi.cpp:5416
#11 0x413494d0 in nsXPCWrappedJSClass::CallMethod (this=0x44a82940, wrapper=0x4b1f8b40, methodIndex=3, info=0x43aab6d0, nativeParams=0xbeed4a60) at /home/cjones/mozilla/jl-mc/js/xpconnect/src/XPCWrappedJSClass.cpp:1509
#12 0x41341864 in nsXPCWrappedJS::CallMethod (this=0x4b1f8b40, methodIndex=3, info=0x43aab6d0, params=0xbeed4a60) at /home/cjones/mozilla/jl-mc/js/xpconnect/src/XPCWrappedJS.cpp:617
#13 0x4199c2be in PrepareAndDispatch (self=<value optimized out>, methodIndex=<value optimized out>, args=0xbeed4b1c) at /home/cjones/mozilla/jl-mc/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp:138
#14 0x4199b8f4 in SharedStub () from libxul.so
#15 0x40d3204e in nsEventListenerManager::HandleEventSubType (this=0x4bc631f0, aListenerStruct=0x449f8ba8, aListener=0x4b339170, aDOMEvent=0x44a63e80, aCurrentTarget=0x4bb2c700, aPhaseFlags=6, aPusher=0xbeed4c98) at /home/cjones/mozilla/jl-mc/content/events/src/nsEventListenerManager.cpp:818
#16 0x40d3222a in nsEventListenerManager::HandleEventInternal (this=0x4bc631f0, aPresContext=0x498a4400, aEvent=0x44a69880, aDOMEvent=0xbeed4cac, aCurrentTarget=0x4bb2c700, aFlags=6, aEventStatus=0xbeed4cb0, aPusher=0xbeed4c98) at /home/cjones/mozilla/jl-mc/content/events/src/nsEventListenerManager.cpp:875
#17 0x40d573c8 in nsEventListenerManager::HandleEvent (this=0x4bc631f0, aPresContext=0x498a4400, aEvent=0x44a69880, aDOMEvent=0xbeed4cac, aCurrentTarget=0x4bb2c700, aFlags=6, aEventStatus=0xbeed4cb0, aPusher=0xbeed4c98) at /home/cjones/mozilla/jl-mc/content/events/src/nsEventListenerManager.h:169
#18 0x40d57936 in nsEventTargetChainItem::HandleEvent (this=0x49651220, aVisitor=..., aFlags=6, aMayHaveNewListenerManagers=false, aPusher=0xbeed4c98) at /home/cjones/mozilla/jl-mc/content/events/src/nsEventDispatcher.cpp:217
#19 0x40d57d46 in nsEventTargetChainItem::HandleEventTargetChain (this=0x49651040, aVisitor=..., aFlags=6, aCallback=0x0, aMayHaveNewListenerManagers=false, aPusher=0xbeed4c98) at /home/cjones/mozilla/jl-mc/content/events/src/nsEventDispatcher.cpp:349
#20 0x40d58be8 in nsEventDispatcher::Dispatch (aTarget=0x4bb2c700, aPresContext=0x498a4400, aEvent=0x44a69880, aDOMEvent=0x44a63e80, aEventStatus=0xbeed4d94, aCallback=0x0, aTargets=0x0) at /home/cjones/mozilla/jl-mc/content/events/src/nsEventDispatcher.cpp:675
#21 0x40d58edc in nsEventDispatcher::DispatchDOMEvent (aTarget=0x4bb2c700, aEvent=0x0, aDOMEvent=0x44a63e80, aPresContext=0x498a4400, aEventStatus=0xbeed4d94) at /home/cjones/mozilla/jl-mc/content/events/src/nsEventDispatcher.cpp:738
#22 0x40c44558 in nsINode::DispatchEvent (this=0x4bb2c700, aEvent=0x44a63e80, aRetVal=0xbeed4e90) at /home/cjones/mozilla/jl-mc/content/base/src/nsGenericElement.cpp:1165
#23 0x4199b8de in NS_InvokeByIndex_P (that=0x4bb2c700, methodIndex=7, paramCount=<value optimized out>, params=<value optimized out>) at /home/cjones/mozilla/jl-mc/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp:194
#24 0x41353810 in CallMethodHelper::Invoke (this=0xbeed4e58) at /home/cjones/mozilla/jl-mc/js/xpconnect/src/XPCWrappedNative.cpp:3111
#25 0x41351d7c in CallMethodHelper::Call (this=0xbeed4e58) at /home/cjones/mozilla/jl-mc/js/xpconnect/src/XPCWrappedNative.cpp:2442
#26 0x41351c4c in XPCWrappedNative::CallMethod (ccx=..., mode=XPCWrappedNative::CALL_METHOD) at /home/cjones/mozilla/jl-mc/js/xpconnect/src/XPCWrappedNative.cpp:2408
#27 0x4135c6ea in XPC_WN_CallMethod (cx=0x4483f0b0, argc=1, vp=0x43e000f0) at /home/cjones/mozilla/jl-mc/js/xpconnect/src/XPCWrappedNativeJSOps.cpp:1549
#28 0x41f14c56 in js::CallJSNative (cx=0x4483f0b0, native=0x4135c505 <XPC_WN_CallMethod(JSContext*, unsigned int, jsval*)>, args=...) at /home/cjones/mozilla/jl-mc/js/src/jscntxtinlines.h:314
#29 0x41f1a7ae in js::InvokeKernel (cx=0x4483f0b0, args=..., construct=js::NO_CONSTRUCT) at /home/cjones/mozilla/jl-mc/js/src/jsinterp.cpp:519
#30 0x41f2862a in js::Interpret (cx=0x4483f0b0, entryFrame=0x43e00088, interpMode=js::JSINTERP_NORMAL) at /home/cjones/mozilla/jl-mc/js/src/jsinterp.cpp:2757
#31 0x41f1a562 in js::RunScript (cx=0x4483f0b0, script=0x4442c430, fp=0x43e00088) at /home/cjones/mozilla/jl-mc/js/src/jsinterp.cpp:475
#32 0x41f1a84e in js::InvokeKernel (cx=0x4483f0b0, args=..., construct=js::NO_CONSTRUCT) at /home/cjones/mozilla/jl-mc/js/src/jsinterp.cpp:535
#33 0x41e8e84c in js::Invoke (cx=0x4483f0b0, args=..., construct=js::NO_CONSTRUCT) at /home/cjones/mozilla/jl-mc/js/src/jsinterp.h:172
#34 0x41ed59b6 in js::CallOrConstructBoundFunction (cx=0x4483f0b0, argc=1, vp=0x43e00050) at /home/cjones/mozilla/jl-mc/js/src/jsfun.cpp:840
#35 0x41f14c56 in js::CallJSNative (cx=0x4483f0b0, native=0x41ed581d <js::CallOrConstructBoundFunction(JSContext*, unsigned int, JS::Value*)>, args=...) at /home/cjones/mozilla/jl-mc/js/src/jscntxtinlines.h:314
#36 0x41f1a7ae in js::InvokeKernel (cx=0x4483f0b0, args=..., construct=js::NO_CONSTRUCT) at /home/cjones/mozilla/jl-mc/js/src/jsinterp.cpp:519
#37 0x41e8e84c in js::Invoke (cx=0x4483f0b0, args=..., construct=js::NO_CONSTRUCT) at /home/cjones/mozilla/jl-mc/js/src/jsinterp.h:172
#38 0x41f1a9f4 in js::Invoke (cx=0x4483f0b0, thisv=..., fval=..., argc=1, argv=0xbeed5c38, rval=0xbeed5c78) at /home/cjones/mozilla/jl-mc/js/src/jsinterp.cpp:567
#39 0x41e8538c in JS_CallFunctionValue (cx=0x4483f0b0, obj=0x4b58a860, fval=..., argc=1, argv=0xbeed5c38, rval=0xbeed5c78) at /home/cjones/mozilla/jl-mc/js/src/jsapi.cpp:5416
#40 0x40cb587c in nsFrameMessageManager::ReceiveMessage (this=0x4b117280, aTarget=0x4bb2c754, aMessage=..., aSync=false, aJSON=..., aObjectsArray=0x446cb740, aJSONRetVal=0x0, aContext=0x0) at /home/cjones/mozilla/jl-mc/content/base/src/nsFrameMessageManager.cpp:498
#41 0x417d1ad6 in mozilla::dom::TabParent::ReceiveMessage (this=0x4a054030, aMessage=..., aSync=false, aJSON=..., aJSONRetVal=0x0) at /home/cjones/mozilla/jl-mc/dom/ipc/TabParent.cpp:684
#42 0x417d0dd0 in mozilla::dom::TabParent::RecvAsyncMessage (this=0x4a054030, aMessage=..., aJSON=...) at /home/cjones/mozilla/jl-mc/dom/ipc/TabParent.cpp:347
#43 0x4183b7f2 in mozilla::dom::PBrowserParent::OnMessageReceived (this=0x4a054030, __msg=...) at /home/cjones/mozilla/b2g/objdir-gecko/ipc/ipdl/PBrowserParent.cpp:794
#44 0x4184791a in mozilla::dom::PContentParent::OnMessageReceived (this=0x49d1d800, __msg=...) at /home/cjones/mozilla/b2g/objdir-gecko/ipc/ipdl/PContentParent.cpp:1065
#45 0x417f9a1a in mozilla::ipc::AsyncChannel::OnDispatchMessage (this=0x49d1d808, msg=...) at /home/cjones/mozilla/jl-mc/ipc/glue/AsyncChannel.cpp:495
#46 0x4180118e in mozilla::ipc::RPCChannel::OnMaybeDequeueOne (this=0x49d1d808) at /home/cjones/mozilla/jl-mc/ipc/glue/RPCChannel.cpp:434
#47 0x417d9fca in DispatchToMethod<mozilla::plugins::ChildTimer, void (mozilla::plugins::ChildTimer::*)()> (obj=0x49d1d808, method=(void (mozilla::plugins::ChildTimer::*)(mozilla::plugins::ChildTimer *)) 0x41800fd5 <mozilla::ipc::RPCChannel::OnMaybeDequeueOne()>, arg=...) at /home/cjones/mozilla/jl-mc/ipc/chromium/src/base/tuple.h:383
#48 0x417e1e34 in RunnableMethod<mozilla::plugins::PluginInstanceChild, void (mozilla::plugins::PluginInstanceChild::*)(), Tuple0>::Run (this=0x43da95a0) at /home/cjones/mozilla/jl-mc/ipc/chromium/src/base/task.h:307
#49 0x417ffc9c in mozilla::ipc::RPCChannel::RefCountedTask::Run (this=0x43d6fa68) at ../../dist/include/mozilla/ipc/RPCChannel.h:462
#50 0x417ffd80 in mozilla::ipc::RPCChannel::DequeueTask::Run (this=0x43d75940) at ../../dist/include/mozilla/ipc/RPCChannel.h:485
#51 0x419ce73c in MessageLoop::RunTask (this=0x4351a0e0, task=0x43d75940) at /home/cjones/mozilla/jl-mc/ipc/chromium/src/base/message_loop.cc:318
#52 0x419ce792 in MessageLoop::DeferOrRunPendingTask (this=0x4351a0e0, pending_task=...) at /home/cjones/mozilla/jl-mc/ipc/chromium/src/base/message_loop.cc:326
#53 0x419ceafa in MessageLoop::DoWork (this=0x4351a0e0) at /home/cjones/mozilla/jl-mc/ipc/chromium/src/base/message_loop.cc:426
#54 0x417fe7d0 in mozilla::ipc::MessagePump::Run (this=0x4350f220, aDelegate=0x4351a0e0) at /home/cjones/mozilla/jl-mc/ipc/glue/MessagePump.cpp:114
#55 0x419ce378 in MessageLoop::RunInternal (this=0x4351a0e0) at /home/cjones/mozilla/jl-mc/ipc/chromium/src/base/message_loop.cc:208
#56 0x419ce312 in MessageLoop::RunHandler (this=0x4351a0e0) at /home/cjones/mozilla/jl-mc/ipc/chromium/src/base/message_loop.cc:201
#57 0x419ce2ba in MessageLoop::Run (this=0x4351a0e0) at /home/cjones/mozilla/jl-mc/ipc/chromium/src/base/message_loop.cc:175
#58 0x416e27e2 in nsBaseAppShell::Run (this=0x4350d860) at /home/cjones/mozilla/jl-mc/widget/xpwidgets/nsBaseAppShell.cpp:189
#59 0x414cd7e8 in nsAppStartup::Run (this=0x43dac850) at /home/cjones/mozilla/jl-mc/toolkit/components/startup/nsAppStartup.cpp:295
#60 0x406a75ac in XREMain::XRE_mainRun (this=0xbeed69b4) at /home/cjones/mozilla/jl-mc/toolkit/xre/nsAppRunner.cpp:3780
#61 0x406a77ba in XREMain::XRE_main (this=0xbeed69b4, argc=1, argv=0xbeed8bc4, aAppData=0xd2e0) at /home/cjones/mozilla/jl-mc/toolkit/xre/nsAppRunner.cpp:3857
#62 0x406a7966 in XRE_main (argc=1, argv=0xbeed8bc4, aAppData=0xd2e0) at /home/cjones/mozilla/jl-mc/toolkit/xre/nsAppRunner.cpp:3933
#63 0x00008cb8 in do_main (argc=1, argv=0xbeed8bc4) at /home/cjones/mozilla/jl-mc/b2g/app/nsBrowserApp.cpp:186
#64 0x00008f2c in main (argc=1, argv=0xbeed8bc4) at /home/cjones/mozilla/jl-mc/b2g/app/nsBrowserApp.cpp:269
Reporter | ||
Comment 1•13 years ago
|
||
This will also be a serious pain point for non-main-thread IDB.
Blocks: 666693
Let's deal with this in the existing bug.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•