Bug 1035454, part 2 - Paper over late shutdown failures on B2G and Windows in debug content processes by exiting XPCOM early. r=bsmedberg

On B2G, there are crashes very late in shutdown on content processes. On Windows XP,
there is an intermittent test failure. We work around both of these by calling exit(0)
during XPCOM shutdown prior to the points where these errors occur. This enables us to
land part 4, that stops us from crashing in content processes when the xpcom-shutdown
message is sent, and enables leak checking in content processes on Linux.
This commit is contained in:
Andrew McCreight 2014-10-15 20:04:32 -07:00
parent 33e272fd3a
commit 68f162e5b0

View File

@ -949,6 +949,18 @@ ShutdownXPCOM(nsIServiceManager* aServMgr)
NS_ShutdownNativeCharsetUtils();
#endif
#if defined(XP_WIN)
// This exit(0) call is intended to be temporary, to get shutdown leak
// checking working on Linux.
// On Windows XP debug, there are intermittent failures in
// dom/media/tests/mochitest/test_peerConnection_basicH264Video.html
// if we don't exit early in a child process. See bug 1073310.
if (XRE_GetProcessType() == GeckoProcessType_Content) {
NS_WARNING("Exiting child process early!");
exit(0);
}
#endif
// Shutdown xpcom. This will release all loaders and cause others holding
// a refcount to the component manager to release it.
if (nsComponentManagerImpl::gComponentManager) {
@ -1026,6 +1038,17 @@ ShutdownXPCOM(nsIServiceManager* aServMgr)
NS_LogTerm();
#if defined(MOZ_WIDGET_GONK)
// This exit(0) call is intended to be temporary, to get shutdown leak
// checking working on Linux.
// On debug B2G, the child process crashes very late. Instead, just
// give up so at least we exit cleanly. See bug 1071866.
if (XRE_GetProcessType() == GeckoProcessType_Content) {
NS_WARNING("Exiting child process early!");
exit(0);
}
#endif
return NS_OK;
}