Open Bug 1616633 Opened 4 years ago Updated 2 years ago

Late-write MOZ_CRASH with `MOZ_LOG=nsChannelClassifier:5` during shutdown

Categories

(Core :: XPCOM, defect)

defect

Tracking

()

ASSIGNED

People

(Reporter: mayhemer, Assigned: alexical)

References

(Regression)

Details

(Keywords: regression)

Win, debug, m-c@b0b5ea1916c5 (Feb 13)

 	xul.dll!LateWriteObserver::Observe({...}) Line 107	C++
 	xul.dll!`anonymous namespace'::PerThreadData::CallObservers({...}) Line 127	C++
 	xul.dll!mozilla::IOInterposer::Report({...}) Line 477	C++
 	xul.dll!mozilla::IOInterposeObserver::Observation::Report() Line 385	C++
 	xul.dll!`anonymous namespace'::WinIOAutoObservation::~WinIOAutoObservation() Line 148	C++
 	xul.dll!`anonymous namespace'::InterposedNtWriteFile(0x00000000000002b4, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x000000c3389fcdc0, 0x000000c3389fce20, 143, 0x0000000000000000, 0x0000000000000000) Line 275	C++
 	KernelBase.dll!WriteFile()	Unknown
 	ucrtbase.dll!write_text_ansi_nolock()	Unknown
 	ucrtbase.dll!_write_nolock()	Unknown
 	ucrtbase.dll!_write()	Unknown
 	ucrtbase.dll!__acrt_stdio_flush_nolock()	Unknown
 	ucrtbase.dll!_fflush_nolock()	Unknown
 	ucrtbase.dll!__crt_seh_guarded_call<int>::operator()<<lambda_c376a267cfb53b6959b3b692ec76b120>,<lambda_9a32fed5bf61b6b509b2d3f6003082a1> &,<lambda_572fbb9fa0ab338edf41edfd4b5fcc8d> >()	Unknown
 	ucrtbase.dll!fflush()	Unknown
>	xul.dll!mozilla::LogModuleManager::Print(0x000001cbf020a460, Info, 0x0000000000000000, 0x00007fff5321264c, 0x000000c3389fee48) Line 517	C++
 	xul.dll!mozilla::LogModuleManager::Print(0x000001cbf020a460, Info, 0x00007fff5321264c, 0x000000c3389fee48) Line 389	C++
 	xul.dll!mozilla::LogModule::Printv(Info, 0x00007fff5321264c, 0x000000c3389fee48) Line 641	C++
 	xul.dll!mozilla::detail::log_print(0x000001cbf0202270, Info, 0x00007fff5321264c, ...) Line 57	C++
 	xul.dll!mozilla::net::UrlClassifierFeatureCryptominingAnnotation::MaybeShutdown() Line 74	C++
 	xul.dll!mozilla::net::UrlClassifierFeatureFactory::Shutdown() Line 36	C++
 	xul.dll!nsLayoutStatics::Shutdown() Line 424	C++
 	xul.dll!nsLayoutStatics::Release() Line 45	C++
 	xul.dll!Shutdown() Line 128	C++
 	xul.dll!nsLayoutModuleDtor() Line 262	C++
 	xul.dll!mozilla::xpcom::CallUnloadFuncs() Line 8263	C++
 	xul.dll!mozilla::xpcom::StaticComponents::Shutdown() Line 11557	C++
 	xul.dll!nsComponentManagerImpl::Shutdown() Line 935	C++
 	xul.dll!mozilla::ShutdownXPCOM(0x0000000000000000) Line 725	C++
 	xul.dll!NS_ShutdownXPCOM(0x000001cbf0250328) Line 569	C++
 	xul.dll!ScopedXPCOMStartup::~ScopedXPCOMStartup() Line 1230	C++
 	xul.dll!mozilla::DefaultDelete<ScopedXPCOMStartup>::operator()(0x000001cbf02027e0) Line 487	C++
 	xul.dll!mozilla::UniquePtr<ScopedXPCOMStartup,mozilla::DefaultDelete<ScopedXPCOMStartup> >::reset(0x0000000000000000) Line 326	C++
 	xul.dll!mozilla::UniquePtr<ScopedXPCOMStartup,mozilla::DefaultDelete<ScopedXPCOMStartup> >::operator=(0x0000000000000000) Line 297	C++
 	xul.dll!XREMain::XRE_main(4, 0x000001cbf02090a0, {...}) Line 4718	C++
 	xul.dll!XRE_main(4, 0x000001cbf02090a0, {...}) Line 4752	C++

Ehsan, do you know who should look into this?

Flags: needinfo?(ehsan)

Right. Various code logs various messages during shutdown. It is unreasonable to file bugs against every single place in the code where that happens, we will not try to remove such log messages, that's not a productive use of time.

Based on the history of the code this looks like a regression from bug 1606880 which made the late write checks crash unconditionally in debug builds it seems (though I could be wrong). Moving this bug to XPCOM for now. Even if I'm wrong here the proper solution to this bug is to make it possible to use MOZ_LOG when shutting down in debug builds somehow...

Component: Privacy: Anti-Tracking → XPCOM
Flags: needinfo?(ehsan)
Regressed by: 1606880
Has Regression Range: --- → yes

Ah - I think at least in part, https://phabricator.services.mozilla.com/D63216 is needed. Thanks for finding this!

Assignee: nobody → dothayer
Status: NEW → ASSIGNED

(Working on the proper fix - in the mean time if this is annoying you, setting toolkit.shutdown.lateWriteChecksStage to 0 should resolve this.)

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.