Closed Bug 1062770 Opened 10 years ago Closed 2 years ago

In most cases, my debug build crashes at shutting down (MOZ_CRASH() in LateWriteObserver::Observe())

Categories

(Core :: XPCOM, defect)

x86_64
Windows 8.1
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: masayuki, Unassigned)

References

Details

(Keywords: crash)

> Hit MOZ_CRASH() at a:\mozilla\mc-c\src\xpcom\build\LateWriteChecks.cpp:119
> `anonymous namespace'::PerThreadData::CallObservers+0x000000C6 [xul +0x000000000027D836] (a:\mozilla\mc-c\src\xpcom\build\iointerposer.cpp, line 139)
> mozilla::IOInterposer::Report+0x00000051 [xul +0x0000000000281CEB] (a:\mozilla\mc-c\src\xpcom\build\iointerposer.cpp, line 508)
> mozilla::IOInterposeObserver::Observation::Report+0x0000002D [xul +0x00000000002823C4] (a:\mozilla\mc-c\src\xpcom\build\iointerposer.cpp, line 415)
> `anonymous namespace'::WinIOAutoObservation::~WinIOAutoObservation+0x0000000E [xul +0x0000000000276773] (a:\mozilla\mc-c\src\xpcom\build\poisoniointerposerwin.cpp, line 177)
> WriteFile+0x0000005C [KERNELBASE +0x000000000000D40A]
> fflush_nolock+0x00000163 [MSVCR100 +0x000000000001F0B7]
> write+0x00000074 [MSVCR100 +0x000000000001ECE1]
> _unDNameEx+0x0000027D [MSVCR100 +0x0000000000021948]
> fwrite+0x00000045 [MSVCR100 +0x0000000000021356]
> PR_LogFlush+0x00000064 [nss3 +0x00000000002536C4] (a:\mozilla\mc-c\src\nsprpub\pr\src\io\prlog.c, line 530)
> mozilla::IMEStateManager::Shutdown+0x00000029 [xul +0x000000000151CDC7] (a:\mozilla\mc-c\src\dom\events\imestatemanager.cpp, line 220)
> nsComponentManagerImpl::Shutdown+0x00000085 [xul +0x0000000000251377] (a:\mozilla\mc-c\src\xpcom\components\nscomponentmanager.cpp, line 891)
> ScopedXPCOMStartup::~ScopedXPCOMStartup+0x0000006D [xul +0x0000000002365164] (a:\mozilla\mc-c\src\toolkit\xre\nsapprunner.cpp, line 1248)
> XREMain::XRE_main+0x0000023C [xul +0x000000000236B953] (a:\mozilla\mc-c\src\toolkit\xre\nsapprunner.cpp, line 4197)
> XRE_main+0x00000034 [xul +0x000000000236BB6D] (a:\mozilla\mc-c\src\toolkit\xre\nsapprunner.cpp, line 4386)
> do_main+0x00000378 [firefox +0x00000000000026C6] (a:\mozilla\mc-c\src\browser\app\nsbrowserapp.cpp, line 282)
> NS_internal_main+0x00000146 [firefox +0x000000000000292D] (a:\mozilla\mc-c\src\browser\app\nsbrowserapp.cpp, line 643)
> wmain+0x000000FE [firefox +0x0000000000002A9D] (a:\mozilla\mc-c\src\toolkit\xre\nswindowswmain.cpp, line 120)
> __tmainCRTStartup+0x0000010B [firefox +0x0000000000004EF9] (f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c, line 278)
> BaseThreadInitThunk+0x0000000E [KERNEL32 +0x000000000001919F]
> RtlInitializeExceptionChain+0x00000084 [ntdll +0x000000000004A22B]
> RtlInitializeExceptionChain+0x0000005A [ntdll +0x000000000004A201]

http://mxr.mozilla.org/mozilla-central/source/xpcom/build/LateWriteChecks.cpp?rev=4399b34c5259#119

This is not a recent regression. I've seen this crash for long time.

My environment is, Win 8.1 (Ja) with Visual Studio 2010.

My debug build's mozconfig:

> ac_add_options --enable-debug
> ac_add_options --enable-tests
> ac_add_options --enable-logging
> ac_add_options --enable-crashreporter
> ac_add_options --disable-installer
> ac_add_options --disable-updater

And I usually logs with NSPR_LOG.

The STR is just launch Firefox and shutdown it.
Vladan who owns late-write checking now? It looks like this is NSPR logging which should be whitelisted.
Flags: needinfo?(vdjeric)
(In reply to Benjamin Smedberg  [:bsmedberg] from comment #1)
> Vladan who owns late-write checking now? It looks like this is NSPR logging
> which should be whitelisted.

Late-writes has been on the backburner since Rafael left. Once some of the higher-priority projects are cleared, we'll revisit late writes again.

In the meanwhile, it's fairly straightforward to whitelist a file descriptor, e.g. http://hg.mozilla.org/mozilla-central/annotate/da04cf3f8a06/xpcom/base/nsTraceRefcnt.cpp#l757

Masayuki, do you want to write this patch? Or I can write a patch myself tomorrow
Flags: needinfo?(vdjeric)
:vladan

I'm not familiar with around there. So, please write it. Thanks!
vladan: ping
Flags: needinfo?(vdjeric)
I can probably do it this week. How reliably do you get this shutdown crash in debug builds with NSPR options?
Assignee: nobody → vdjeric
Flags: needinfo?(vdjeric)
Yeah, I still reproduce this bug.
I'm hitting this real hard on some of my try jobs. Adding a printf_stderr call in the wrong place seems to be enough to cause *every test suite* on Windows to hit this.
Flags: needinfo?(vdjeric)
Assignee: vdjeric → aklotz
Flags: needinfo?(vdjeric)
Whitelisting is a bit more complicated in the NSPR case. The quickest way to fix this is probably to compare the fully qualified path of the fd with the path in NSPR_LOG_FILE, if present.
See Also: → 1632740
Assignee: aklotz → nobody

I don't reproduce this bug anymore in these days.
-> WFM

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.