Closed Bug 1648423 Opened 6 years ago Closed 5 years ago

ASSERTION: missing ordering entry: 'proposed' in DeadlockDetector.h

Categories

(Core :: XPCOM, defect, P2)

defect

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox-esr78 --- wontfix
firefox89 --- wontfix
firefox90 --- wontfix
firefox91 --- fixed

People

(Reporter: michal, Assigned: KrisWright)

References

Details

(Keywords: csectype-uaf, sec-moderate)

The 'proposed' cannot be found because it's not valid anymore:

Thread 4 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 2869385.2869460]
0x0000561becf3feb0 in mozalloc_abort (
    msg=0x7fb0f3cf1428 "[2869385, StreamTrans #18] ###!!! ASSERTION: missing ordering entry: 'proposed', file /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/mozilla/DeadlockDetector.h, line 218") at /mnt/work/opt/moz/hg-central-2/memory/mozalloc/mozalloc_abort.cpp:33
33	  MOZ_CRASH();

(rr) bt
#0  0x0000561becf3feb0 in mozalloc_abort(char const*)
    (msg=0x7fb0f3cf1428 "[2869385, StreamTrans #18] ###!!! ASSERTION: missing ordering entry: 'proposed', file /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/mozilla/DeadlockDetector.h, line 218") at /mnt/work/opt/moz/hg-central-2/memory/mozalloc/mozalloc_abort.cpp:33
#1  0x00007fb1225da3b2 in Abort(char const*)
    (aMsg=0x7fb0f3cf1428 "[2869385, StreamTrans #18] ###!!! ASSERTION: missing ordering entry: 'proposed', file /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/mozilla/DeadlockDetector.h, line 218") at /mnt/work/opt/moz/hg-central-2/xpcom/base/nsDebugImpl.cpp:445
#2  0x00007fb1225d9fb4 in NS_DebugBreak(uint32_t, char const*, char const*, char const*, int32_t)
    (aSeverity=1, aStr=0x7fb11d172376 "missing ordering entry", aExpr=0x7fb11d4561a1 "proposed", aFile=0x7fb11d0dc244 "/mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/mozilla/DeadlockDetector.h", aLine=218) at /mnt/work/opt/moz/hg-central-2/xpcom/base/nsDebugImpl.cpp:433
#3  0x00007fb1227dfbe7 in mozilla::DeadlockDetector<mozilla::BlockingResourceBase>::CheckAcquisition(mozilla::BlockingResourceBase const*, mozilla::BlockingResourceBase const*) (this=0x7fb116b099a0, aLast=0x7fb0fbe14820, aProposed=0x7fb116bc9bb8)
    at /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/mozilla/DeadlockDetector.h:218
#4  0x00007fb1227ce6a1 in mozilla::BlockingResourceBase::CheckAcquire() (this=0x7fb116bc9bb8)
    at /mnt/work/opt/moz/hg-central-2/xpcom/threads/BlockingResourceBase.cpp:224
#5  0x00007fb1227ced56 in mozilla::OffTheBooksMutex::Lock() (this=0x7fb116bc9b90)
    at /mnt/work/opt/moz/hg-central-2/xpcom/threads/BlockingResourceBase.cpp:317
#6  0x00007fb12254ab58 in mozilla::Monitor::Lock() (this=0x7fb116bc9b90)
    at /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/mozilla/Monitor.h:31
#7  0x00007fb122549503 in mozilla::MonitorAutoLock::MonitorAutoLock(mozilla::Monitor&) (this=0x7fb0f3cf1a40, aMonitor=...)
    at /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/mozilla/Monitor.h:66
#8  0x00007fb122806016 in TimerThread::RemoveTimer(nsTimerImpl*) (this=0x7fb116bc9b50, aTimer=0x7fb0fbe147c0)
    at /mnt/work/opt/moz/hg-central-2/xpcom/threads/TimerThread.cpp:532
#9  0x00007fb12281b94b in nsTimerImpl::CancelImpl(bool) (this=0x7fb0fbe147c0, aClearITimer=false)
    at /mnt/work/opt/moz/hg-central-2/xpcom/threads/nsTimerImpl.cpp:403
#10 0x00007fb122804c77 in nsTimerImpl::Cancel() (this=0x7fb0fbe147c0) at /mnt/work/opt/moz/hg-central-2/xpcom/threads/nsTimerImpl.cpp:392
#11 0x00007fb12282fdea in nsTimer::Cancel() (this=0x7fb103740120) at /mnt/work/opt/moz/hg-central-2/xpcom/threads/nsTimerImpl.h:235
#12 0x00007fb123679213 in mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) (this=0x7fb10592f7c0, aDelegate=0x7fb0f3cf1d38)
    at /mnt/work/opt/moz/hg-central-2/ipc/glue/MessagePump.cpp:335
#13 0x00007fb123568e77 in MessageLoop::RunInternal() (this=0x7fb0f3cf1d38) at /mnt/work/opt/moz/hg-central-2/ipc/chromium/src/base/message_loop.cc:315
#14 0x00007fb123568df5 in MessageLoop::RunHandler() (this=0x7fb0f3cf1d38) at /mnt/work/opt/moz/hg-central-2/ipc/chromium/src/base/message_loop.cc:308
#15 0x00007fb123568db3 in MessageLoop::Run() (this=0x7fb0f3cf1d38) at /mnt/work/opt/moz/hg-central-2/ipc/chromium/src/base/message_loop.cc:290
#16 0x00007fb12280a609 in nsThread::ThreadFunc(void*) (aArg=0x7ffc230d0830) at /mnt/work/opt/moz/hg-central-2/xpcom/threads/nsThread.cpp:447
#17 0x00007fb13278945e in _pt_root (arg=0x7fb1037a4160) at /mnt/work/opt/moz/hg-central-2/nsprpub/pr/src/pthreads/ptthread.c:201
#18 0x00007fb1327994e2 in start_thread (arg=<optimized out>) at pthread_create.c:479
#19 0x00007fb117fbf6a3 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

(rr) f 3
#3  0x00007fb1227dfbe7 in mozilla::DeadlockDetector<mozilla::BlockingResourceBase>::CheckAcquisition (this=0x7fb116b099a0, aLast=0x7fb0fbe14820, 
    aProposed=0x7fb116bc9bb8) at /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/mozilla/DeadlockDetector.h:218
218	    NS_ASSERTION(proposed, "missing ordering entry");
(rr) p aProposed
$9 = (const mozilla::BlockingResourceBase *) 0x7fb116bc9bb8
(rr) p *aProposed
$10 = {static kResourceTypeName = 0x7fb131d79490 <mozilla::BlockingResourceBase::kResourceTypeName>, mChainPrev = 0xe5e5e5e5e5e5e5e5, 
  mName = 0xe5e5e5e5e5e5e5e5 <error: Cannot access memory at address 0xe5e5e5e5e5e5e5e5>, mType = 3857049061, mAcquired = 229, static sCallOnce = {
    initialized = 1, inProgress = 1, status = PR_SUCCESS}, 
  static sResourceAcqnChainFront = {<mozilla::detail::ThreadLocalNativeStorage<mozilla::BlockingResourceBase*>> = {
      mValue = 0x7fb0fbe14820}, <No data fields>}, static sDeadlockDetector = 0x7fb116b099a0}

It was freed on main thread during shutdown:

(rr) reverse-continue 
Continuing.

Thread 1 hit Hardware watchpoint 1: -location mMonitor->mMutex.mName

Old value = 0xe5e5e5e5e5e5e5e5 <error: Cannot access memory at address 0xe5e5e5e5e5e5e5e5>
New value = 0x7fb11d330581 "TimerThread.mMonitor"
__memset_avx2_unaligned_erms () at ../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S:207
207		VMOVU	%VEC(0), (VEC_SIZE * 3)(%rdi)

(rr) bt
#0  __memset_avx2_unaligned_erms () at ../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S:207
#1  0x0000561becf02368 in arena_t::DallocSmall(arena_chunk_t*, void*, arena_chunk_map_t*)
    (this=0x7fb116c00000, aChunk=0x7fb116b00000, aPtr=0x7fb116bc9b50, aMapElm=0x7fb116b012f8)
    at /mnt/work/opt/moz/hg-central-2/memory/build/mozjemalloc.cpp:3290
#2  0x0000561becef6f00 in arena_dalloc(void*, unsigned long, arena_t*) (aPtr=0x7fb116bc9b50, aOffset=826192, aArena=0x0)
    at /mnt/work/opt/moz/hg-central-2/memory/build/mozjemalloc.cpp:3376
#3  0x0000561becf07275 in BaseAllocator::free(void*) (this=0x7ffc230d0f70, aPtr=0x7fb116bc9b50)
    at /mnt/work/opt/moz/hg-central-2/memory/build/mozjemalloc.cpp:4148
#4  0x0000561becf04755 in Allocator<MozJemallocBase>::free(void*) (arg1=0x7fb116bc9b50) at /mnt/work/opt/moz/hg-central-2/memory/build/malloc_decls.h:54
#5  0x0000561becf3b716 in PageFree(mozilla::Maybe<unsigned long> const&, void*) (aArenaId=..., aPtr=0x7fb116bc9b50)
    at /mnt/work/opt/moz/hg-central-2/memory/replace/phc/PHC.cpp:1276
#6  0x0000561becf3bee6 in replace_free(void*) (aPtr=0x7fb116bc9b50) at /mnt/work/opt/moz/hg-central-2/memory/replace/phc/PHC.cpp:1312
#7  0x0000561becefa9a7 in Allocator<ReplaceMallocBase>::free(void*) (arg1=0x7fb116bc9b50)
    at /mnt/work/opt/moz/hg-central-2/memory/build/malloc_decls.h:54
#8  0x0000561becef54d5 in free(void*) (arg1=0x7fb116bc9b50) at /mnt/work/opt/moz/hg-central-2/memory/build/malloc_decls.h:54
#9  0x00007fb12280337d in operator delete(void*) (ptr=0x7fb116bc9b50)
    at /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/mozilla/cxxalloc.h:51
#10 TimerThread::~TimerThread() (this=0x7fb116bc9b50) at /mnt/work/opt/moz/hg-central-2/xpcom/threads/TimerThread.cpp:41
#11 0x00007fb1228025dc in mozilla::Runnable::Release() (this=0x7fb116bc9b50) at /mnt/work/opt/moz/hg-central-2/xpcom/threads/nsThreadUtils.cpp:64
#12 0x00007fb122803126 in TimerThread::Release() (this=0x7fb116bc9b50) at /mnt/work/opt/moz/hg-central-2/xpcom/threads/TimerThread.cpp:29
#13 0x00007fb122614bbc in nsCOMPtr_base::~nsCOMPtr_base() (this=0x7fb10592fdd8) at /mnt/work/opt/moz/hg-central-2/xpcom/base/nsCOMPtr.h:329
#14 0x00007fb122614b58 in nsCOMPtr<nsISupports>::~nsCOMPtr() (this=0x7fb10592fdd8) at /mnt/work/opt/moz/hg-central-2/xpcom/base/nsCOMPtr.h:894
#15 0x00007fb1226d6585 in nsMaybeWeakPtr<nsIObserver>::~nsMaybeWeakPtr() (this=0x7fb10592fdd8)
    at /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/nsMaybeWeakPtr.h:19
#16 0x00007fb1226d6565 in nsTArrayElementTraits<nsMaybeWeakPtr<nsIObserver> >::Destruct(nsMaybeWeakPtr<nsIObserver>*) (aE=0x7fb10592fdd8)
    at /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/nsTArray.h:615
#17 0x00007fb1226d64c2 in nsTArray_Impl<nsMaybeWeakPtr<nsIObserver>, nsTArrayInfallibleAllocator>::DestructRange(unsigned long, unsigned long)
    (this=0x7fb108d9f848, aStart=0, aCount=2) at /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/nsTArray.h:2327
#18 0x00007fb1226d679e in nsTArray_Impl<nsMaybeWeakPtr<nsIObserver>, nsTArrayInfallibleAllocator>::ClearAndRetainStorage() (this=0x7fb108d9f848)
    at /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/nsTArray.h:1420
#19 0x00007fb1226d6730 in nsTArray_Impl<nsMaybeWeakPtr<nsIObserver>, nsTArrayInfallibleAllocator>::~nsTArray_Impl() (this=0x7fb108d9f848)
    at /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/nsTArray.h:982
#20 0x00007fb1226d66f8 in nsTArray<nsMaybeWeakPtr<nsIObserver> >::~nsTArray() (this=0x7fb108d9f848)
    at /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/nsTArray.h:2587
#21 0x00007fb1226d66d8 in CopyableTArray<nsMaybeWeakPtr<nsIObserver> >::~CopyableTArray() (this=0x7fb108d9f848)
    at /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/nsTArray.h:2805
#22 0x00007fb1226d3f18 in nsMaybeWeakPtrArray<nsIObserver>::~nsMaybeWeakPtrArray() (this=0x7fb108d9f848)
    at /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/nsMaybeWeakPtr.h:57
#23 0x00007fb1226f6133 in nsObserverList::~nsObserverList() (this=0x7fb108d9f840) at /mnt/work/opt/moz/hg-central-2/xpcom/ds/nsObserverList.h:31
#24 0x00007fb1226f609c in nsTHashtable<nsObserverList>::s_ClearEntry(PLDHashTable*, PLDHashEntryHdr*) (aTable=0x7fb116b782b8, aEntry=0x7fb108d9f840)
    at /mnt/work/opt/moz/hg-central-2/xpcom/ds/nsTHashtable.h:512
#25 0x00007fb1226c7ef6 in PLDHashTable::~PLDHashTable()::$_0::operator()(PLDHashTable::Slot const&) const (this=0x7ffc230d1448, aSlot=...)
    at /mnt/work/opt/moz/hg-central-2/xpcom/ds/PLDHashTable.cpp:292
#26 0x00007fb1226c7e43 in PLDHashTable::EntryStore::ForEachSlot<PLDHashTable::~ForEachSlot()::$_0>(char*, unsigned int, unsigned int, PLDHashTable::~ForEachSlot()::$_0&&) (aStore=0x7fb108d9f000 "\237\244", <incomplete sequence \335>, aCapacity=128, aEntrySize=16, aFunc=...)
    at /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/PLDHashTable.h:357
#27 0x00007fb1226ba1da in PLDHashTable::EntryStore::ForEachSlot<PLDHashTable::~ForEachSlot()::$_0>(unsigned int, unsigned int, PLDHashTable::~ForEachSlot()::$_0&&) (this=0x7fb116b782c0, aCapacity=128, aEntrySize=16, aFunc=...)
    at /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/PLDHashTable.h:347
#28 0x00007fb1226ba12c in PLDHashTable::~PLDHashTable() (this=0x7fb116b782b8) at /mnt/work/opt/moz/hg-central-2/xpcom/ds/PLDHashTable.cpp:290
#29 0x00007fb1226ba222 in PLDHashTable::ClearAndPrepareForLength(unsigned int) (this=0x7fb116b782b8, aLength=4)
    at /mnt/work/opt/moz/hg-central-2/xpcom/ds/PLDHashTable.cpp:304
#30 0x00007fb1226ba26a in PLDHashTable::Clear() (this=0x7fb116b782b8) at /mnt/work/opt/moz/hg-central-2/xpcom/ds/PLDHashTable.cpp:308
#31 0x00007fb1226f2ea5 in nsTHashtable<nsObserverList>::Clear() (this=0x7fb116b782b8) at /mnt/work/opt/moz/hg-central-2/xpcom/ds/nsTHashtable.h:349
#32 0x00007fb1226dd87f in nsObserverService::Shutdown() (this=0x7fb116b78290) at /mnt/work/opt/moz/hg-central-2/xpcom/ds/nsObserverService.cpp:149
#33 0x00007fb122894e3b in mozilla::ShutdownXPCOM(nsIServiceManager*) (aServMgr=0x0) at /mnt/work/opt/moz/hg-central-2/xpcom/build/XPCOMInit.cpp:655
#34 0x00007fb122894ae5 in NS_ShutdownXPCOM(nsIServiceManager*) (aServMgr=0x0) at /mnt/work/opt/moz/hg-central-2/xpcom/build/XPCOMInit.cpp:568
#35 0x00007fb12413870b in XRE_XPCShellMain(int, char**, char**, XREShellData const*)
    (argc=23, argv=0x7ffc230d1de0, envp=0x7fb116b38800, aShellData=0x7ffc230d1ca0)
    at /mnt/work/opt/moz/hg-central-2/js/xpconnect/src/XPCShellImpl.cpp:1377
#36 0x00007fb12be8c1ff in mozilla::BootstrapImpl::XRE_XPCShellMain(int, char**, char**, XREShellData const*)
    (this=0x7fb116b02730, argc=30, argv=0x7ffc230d1da8, envp=0x7fb116b38800, aShellData=0x7ffc230d1ca0)
    at /mnt/work/opt/moz/hg-central-2/toolkit/xre/Bootstrap.cpp:54
#37 0x0000561beceef1b1 in main(int, char**, char**) (argc=30, argv=0x7ffc230d1da8, envp=0x7fb116b38800)
    at /mnt/work/opt/moz/hg-central-2/js/xpconnect/shell/xpcshell.cpp:66

And callstack of the main thread in the time of the crash is:

(rr) bt
#0  0x0000000070000002 in  ()
#1  0x00007fb1328045c7 in _raw_syscall () at /opt/moz/rr/rr/src/preload/raw_syscall.S:120
#2  0x00007fb1328004de in traced_raw_syscall (call=call@entry=0x681fffa0) at /opt/moz/rr/rr/src/preload/syscallbuf.c:229
#3  0x00007fb132801b88 in sys_fcntl (call=<optimized out>) at /opt/moz/rr/rr/src/preload/syscallbuf.c:1286
#4  syscall_hook_internal (call=0x681fffa0) at /opt/moz/rr/rr/src/preload/syscallbuf.c:2845
#5  syscall_hook (call=0x681fffa0) at /opt/moz/rr/rr/src/preload/syscallbuf.c:2977
#6  0x00007fb1328003ba in _syscall_hook_trampoline () at /opt/moz/rr/rr/src/preload/syscall_hook.S:282
#7  0x00007fb1328003ea in __morestack () at /opt/moz/rr/rr/src/preload/syscall_hook.S:417
#8  0x00007fb132800405 in _syscall_hook_trampoline_48_3d_00_f0_ff_ff () at /opt/moz/rr/rr/src/preload/syscall_hook.S:428
#9  0x00007fb13279fd4b in futex_wait_cancelable (private=0, expected=0, futex_word=0x7fb116b70100) at ../sysdeps/unix/sysv/linux/futex-internal.h:80
#10 __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x7fb116b70070, cond=0x7fb116b700d8) at pthread_cond_wait.c:508
#11 __pthread_cond_wait (cond=0x7fb116b700d8, mutex=0x7fb116b70070) at pthread_cond_wait.c:638
#12 0x0000561becfe710a in mozilla::detail::ConditionVariableImpl::wait(mozilla::detail::MutexImpl&) (this=0x7fb116b700d8, lock=...)
    at /mnt/work/opt/moz/hg-central-2/mozglue/misc/ConditionVariable_posix.cpp:108
#13 0x0000561becfe71e0 in mozilla::detail::ConditionVariableImpl::wait_for(mozilla::detail::MutexImpl&, mozilla::BaseTimeDuration<mozilla::TimeDurationValueCalculator> const&) (this=0x7fb116b700d8, lock=..., a_rel_time=...) at /mnt/work/opt/moz/hg-central-2/mozglue/misc/ConditionVariable_posix.cpp:115
#14 0x00007fb1227cfb5b in mozilla::OffTheBooksCondVar::Wait(mozilla::BaseTimeDuration<mozilla::TimeDurationValueCalculator>)
    (this=0x7fb116b700b8, aDuration=...) at /mnt/work/opt/moz/hg-central-2/xpcom/threads/BlockingResourceBase.cpp:529
#15 0x00007fb1227cfa01 in mozilla::OffTheBooksCondVar::Wait() (this=0x7fb116b700b8)
    at /mnt/work/opt/moz/hg-central-2/xpcom/threads/BlockingResourceBase.cpp:508
#16 0x00007fb1228248f2 in mozilla::ThreadEventQueue<mozilla::PrioritizedEventQueue>::GetEvent(bool, mozilla::EventQueuePriority*, mozilla::BaseTimeDuration<mozilla::TimeDurationValueCalculator>*) (this=0x7fb116b70040, aMayWait=true, aPriority=0x7ffc230d0d4c, aLastEventDelay=0x7fb116b9d0d0)
    at /mnt/work/opt/moz/hg-central-2/xpcom/threads/ThreadEventQueue.cpp:213
#17 0x00007fb12280debc in nsThread::ProcessNextEvent(bool, bool*) (this=0x7fb116b9d030, aMayWait=true, aResult=0x7ffc230d1307)
    at /mnt/work/opt/moz/hg-central-2/xpcom/threads/nsThread.cpp:1150
#18 0x00007fb122814407 in NS_ProcessNextEvent(nsIThread*, bool) (aThread=0x7fb116b9d030, aMayWait=true)
    at /mnt/work/opt/moz/hg-central-2/xpcom/threads/nsThreadUtils.cpp:501
#19 0x00007fb12280cb73 in mozilla::SpinEventLoopUntil<(mozilla::ProcessFailureBehavior)0, nsThread::WaitForAllAsynchronousShutdowns()::$_1>(nsThread::WaitForAllAsynchronousShutdowns()::$_1&&, nsIThread*) (aPredicate=..., aThread=0x7fb116b9d030)
    at /mnt/work/opt/moz/hg-central-2/_obj-browser-release-tb-fp-dbg/dist/include/nsThreadUtils.h:360
#20 0x00007fb12280acad in nsThread::WaitForAllAsynchronousShutdowns() (this=0x7fb116b9d030)
    at /mnt/work/opt/moz/hg-central-2/xpcom/threads/nsThread.cpp:881
#21 0x00007fb122813118 in nsThreadManager::Shutdown() (this=0x7fb1326462f8 <nsThreadManager::get()::sInstance>)
    at /mnt/work/opt/moz/hg-central-2/xpcom/threads/nsThreadManager.cpp:478
#22 0x00007fb122894e52 in mozilla::ShutdownXPCOM(nsIServiceManager*) (aServMgr=0x0) at /mnt/work/opt/moz/hg-central-2/xpcom/build/XPCOMInit.cpp:667
#23 0x00007fb122894ae5 in NS_ShutdownXPCOM(nsIServiceManager*) (aServMgr=0x0) at /mnt/work/opt/moz/hg-central-2/xpcom/build/XPCOMInit.cpp:568
#24 0x00007fb12413870b in XRE_XPCShellMain(int, char**, char**, XREShellData const*)
    (argc=23, argv=0x7ffc230d1de0, envp=0x7fb116b38800, aShellData=0x7ffc230d1ca0)
    at /mnt/work/opt/moz/hg-central-2/js/xpconnect/src/XPCShellImpl.cpp:1377
#25 0x00007fb12be8c1ff in mozilla::BootstrapImpl::XRE_XPCShellMain(int, char**, char**, XREShellData const*)
    (this=0x7fb116b02730, argc=30, argv=0x7ffc230d1da8, envp=0x7fb116b38800, aShellData=0x7ffc230d1ca0)
    at /mnt/work/opt/moz/hg-central-2/toolkit/xre/Bootstrap.cpp:54
#26 0x0000561beceef1b1 in main(int, char**, char**) (argc=30, argv=0x7ffc230d1da8, envp=0x7fb116b38800)
    at /mnt/work/opt/moz/hg-central-2/js/xpconnect/shell/xpcshell.cpp:66

I hit this while trying to reproduce another issue. Marking s-s because of the poison value in the report above.

A Pernosco session is available here: https://pernos.co/debug/PCn2eI28L8b513M0YqhaCg/index.html

Group: core-security
Group: core-security → dom-core-security
Assignee: nobody → kwright
Priority: -- → P2

This may be related to bug 1683404.

Getting a better look at this, I see what's happening now:

  • A call to RemoveTimer comes from nsTimerImpl::CancelImpl
  • At the same time, we've shut down the timer thread from the main thread and cleared it. If this happened at any other point nsTimerImpl would have noticed that there's nothing in gThread.
  • We get stuck waiting for nsTimerImpl::RemoveTimer on a shutdown timer thread, where DeadlockDetector seems to catch it.

This was able to happen because shutting down the timer thread at the time wasn't thread safe. We've since fixed this, so I can't see any way this issue is going to happen anymore. Marking this as resolved unless we come across the issue again.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED

Was bug 1683404 what fixed this?

Flags: needinfo?(kwright)

(In reply to Ryan VanderMeulen [:RyanVM] from comment #5)

Was bug 1683404 what fixed this?

Yes, bug 1683404 fixed it :)

Flags: needinfo?(kwright)
Group: dom-core-security → core-security-release
Target Milestone: --- → 91 Branch

Is sec-high an appropriate severity rating for this bug? If so, we're probably going to need to do something for ESR78 here still...

Flags: needinfo?(kwright)

If this is purely a thread shutdown issue, it could be sec-moderate.

(In reply to Andrew McCreight [:mccr8] from comment #8)

If this is purely a thread shutdown issue, it could be sec-moderate.

This race only happens during timer thread shutdown, so I agree. Personally I don't think we need to put the changes on ESR78 but if we do need to then it wouldn't affect any of the browser's behavior (except patch out the occasional shutdown hang that caused this bug)

Flags: needinfo?(kwright)
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.