Open Bug 1437323 Opened 2 years ago Updated 2 years ago

Thunderbird shutdown crash in debug builds: Storage connection not closed: blist.sqlite - Hit MOZ_CRASH() at [snip]/storage/mozStorageService.cpp:810

Categories

(Thunderbird :: General, defect)

defect
Not set

Tracking

(Not tracked)

People

(Reporter: jorgk, Unassigned)

Details

Storage connection not closed: blist.sqlite
Hit MOZ_CRASH() at c:/mozilla-source/comm-central/mozilla/storage/mozStorageService.cpp:810
#01: mozilla::storage::Service::Observe (c:\mozilla-source\comm-central\mozilla\storage\mozstorageservice.cpp:810)
#02: nsObserverList::NotifyObservers (c:\mozilla-source\comm-central\mozilla\xpcom\ds\nsobserverlist.cpp:112)
#03: nsObserverService::NotifyObservers (c:\mozilla-source\comm-central\mozilla\xpcom\ds\nsobserverservice.cpp:300)
#04: mozilla::ShutdownXPCOM (c:\mozilla-source\comm-central\mozilla\xpcom\build\xpcominit.cpp:881)
#05: ScopedXPCOMStartup::~ScopedXPCOMStartup (c:\mozilla-source\comm-central\mozilla\toolkit\xre\nsapprunner.cpp:1509)
#06: mozilla::DefaultDelete<ScopedXPCOMStartup>::operator() (c:\mozilla-source\comm-central\obj-i686-pc-mingw32\dist\include\mozilla\uniqueptr.h:528)
#07: XREMain::XRE_main (c:\mozilla-source\comm-central\mozilla\toolkit\xre\nsapprunner.cpp:4839)
#08: XRE_main (c:\mozilla-source\comm-central\mozilla\toolkit\xre\nsapprunner.cpp:4900)
#09: mozilla::BootstrapImpl::XRE_main (c:\mozilla-source\comm-central\mozilla\toolkit\xre\bootstrap.cpp:49)
#10: do_main (c:\mozilla-source\comm-central\mail\app\nsmailapp.cpp:233)
#11: NS_internal_main (c:\mozilla-source\comm-central\mail\app\nsmailapp.cpp:306)
#12: wmain (c:\mozilla-source\comm-central\mozilla\toolkit\xre\nswindowswmain.cpp:115)
#13: __scrt_common_main_seh (f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253)
#14: BaseThreadInitThunk[C:\Windows\syswow64\kernel32.dll +0x1343d]
#15: RtlInitializeExceptionChain[C:\Windows\SysWOW64\ntdll.dll +0x39832]
#16: RtlInitializeExceptionChain[C:\Windows\SysWOW64\ntdll.dll +0x39805]

This is happening an awful lot lately, like in the last day or so. "blist" is blocklist?

Marco, something wrong we're (not) doing in TB?
Flags: needinfo?(mak77)
The assertion indicates that by the time we reach xpcom-shutdown nobody tried to close that connection.
Does this happen in xpcshell-tests? Are those tests invoking at least once do_get_profile (if they are xpcshell)?

I can find blist.sqlite in comm-central/chat/components/src/imContacts.js
it opens a connection to the database in getDBConnection(), that is pretty much used by its DBConn() lazy getter.
This add a profile-before-change observer to close the connection before shutdown, if the test doesn't initialize the profile, this notification may not happen.
Another possibility is that this service is created very late in the shutdown process, maybe after profile-before-change fired.
Flags: needinfo?(mak77)
Thanks for looking into it, Marco. I've only seen the crash when running a debug version, not in Xpcshell tests. And the crash doesn't show on treeherder.

I assumed that blist.sqlite is something from M-C, but yes, it's from chat. I'm not familiar with chat, so I'll see whether I can get help elsewhere. This also reminds me of bug 1344902.

Martin, could you please take a look.
Flags: needinfo?(martin)
I cannot reproduce this locally, so not really in a position to track it down, sorry.
Flags: needinfo?(martin)
You need to log in before you can comment on or make changes to this bug.