diff --git a/Makefile.in b/Makefile.in index 26267ca495..849c96a7ae 100644 --- a/Makefile.in +++ b/Makefile.in @@ -222,39 +222,8 @@ SYMBOL_INDEX_NAME = \ $(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_TARGET)-$(BUILDID)-$(CPU_ARCH)$(EXTRA_BUILDID)-symbols.txt buildsymbols: -ifdef MOZ_CRASHREPORTER - echo building symbol store - $(RM) -r $(DIST)/crashreporter-symbols - $(RM) '$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip' - $(RM) '$(DIST)/$(SYMBOL_FULL_ARCHIVE_BASENAME).zip' - $(NSINSTALL) -D $(DIST)/crashreporter-symbols - OBJCOPY='$(OBJCOPY)' \ - $(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \ - $(MAKE_SYM_STORE_ARGS) \ - $(foreach dir,$(SYM_STORE_SOURCE_DIRS),-s $(dir)) \ - $(DUMP_SYMS_BIN) \ - $(DIST)/crashreporter-symbols \ - $(MAKE_SYM_STORE_PATH) | grep -iv test > \ - $(DIST)/crashreporter-symbols/$(SYMBOL_INDEX_NAME) - echo packing symbols - $(NSINSTALL) -D $(DIST)/$(PKG_PATH) - cd $(DIST)/crashreporter-symbols && \ - zip -r9D '../$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip' . -x '*test*' -x '*Test*' - cd $(DIST)/crashreporter-symbols && \ - grep 'sym' $(SYMBOL_INDEX_NAME) > $(SYMBOL_INDEX_NAME).tmp && \ - mv $(SYMBOL_INDEX_NAME).tmp $(SYMBOL_INDEX_NAME) - cd $(DIST)/crashreporter-symbols && \ - zip -r9D '../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip' . -i '*.sym' -i '*.txt' -x '*test*' -x '*Test*' -endif # MOZ_CRASHREPORTER uploadsymbols: -ifdef MOZ_CRASHREPORTER -ifdef SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE - $(PYTHON) -u $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.py '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip' -else - $(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh $(SYMBOL_INDEX_NAME) '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip' -endif -endif # MOZ_SOURCE_STAMP is defined in package-name.mk with a deferred assignment. # exporting it makes make run its $(shell) command for each invoked submake, diff --git a/accessible/base/nsAccessibilityService.cpp b/accessible/base/nsAccessibilityService.cpp index 3582039170..5b28455fef 100644 --- a/accessible/base/nsAccessibilityService.cpp +++ b/accessible/base/nsAccessibilityService.cpp @@ -52,10 +52,6 @@ #include "Logging.h" #endif -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif - #include "nsImageFrame.h" #include "nsIObserverService.h" #include "nsLayoutUtils.h" @@ -1122,12 +1118,6 @@ nsAccessibilityService::Init() gApplicationAccessible = new ApplicationAccessibleWrap(); NS_ADDREF(gApplicationAccessible); // will release in Shutdown() -#ifdef MOZ_CRASHREPORTER - CrashReporter:: - AnnotateCrashReport(NS_LITERAL_CSTRING("Accessibility"), - NS_LITERAL_CSTRING("Active")); -#endif - #ifdef XP_WIN sPendingPlugins = new nsTArray >; sPluginTimers = new nsTArray >; diff --git a/accessible/windows/msaa/IUnknownImpl.cpp b/accessible/windows/msaa/IUnknownImpl.cpp index 4a9fa5383b..1baba63871 100644 --- a/accessible/windows/msaa/IUnknownImpl.cpp +++ b/accessible/windows/msaa/IUnknownImpl.cpp @@ -9,10 +9,6 @@ #include "nsDebug.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif - namespace mozilla { namespace a11y { @@ -41,12 +37,6 @@ int FilterExceptions(unsigned int aCode, EXCEPTION_POINTERS* aExceptionInfo) { if (aCode == EXCEPTION_ACCESS_VIOLATION) { -#ifdef MOZ_CRASHREPORTER - // MSAA swallows crashes (because it is COM-based) but we still need to - // learn about those crashes so we can fix them. Make sure to pass them to - // the crash reporter. - CrashReporter::WriteMinidumpForException(aExceptionInfo); -#endif } else { NS_NOTREACHED("We should only be catching crash exceptions"); } diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index 9a85d2f45f..2aba9ac5a6 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -83,25 +83,13 @@ function debug(str) { dump(' -*- Shell.js: ' + str + '\n'); } -#ifdef MOZ_CRASHREPORTER -function debugCrashReport(aStr) { - dump('Crash reporter : ' + aStr); -} -#else function debugCrashReport(aStr) {} -#endif var shell = { get CrashSubmit() { delete this.CrashSubmit; -#ifdef MOZ_CRASHREPORTER - Cu.import("resource://gre/modules/CrashSubmit.jsm", this); - return this.CrashSubmit; -#else - dump('Crash reporter : disabled at build time.'); return this.CrashSubmit = null; -#endif }, onlineForCrashReport: function shell_onlineForCrashReport() { diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in index 368da87685..d2576e4176 100644 --- a/b2g/installer/package-manifest.in +++ b/b2g/installer/package-manifest.in @@ -821,22 +821,6 @@ bin/libfreebl_32int64_3.so #endif #endif -; [Crash Reporter] -; -#ifdef MOZ_CRASHREPORTER -#ifdef XP_MACOSX -@BINPATH@/crashreporter.app/ -#else -@BINPATH@/crashreporter@BIN_SUFFIX@ -@BINPATH@/crashreporter.crt -@BINPATH@/crashreporter.ini -#ifdef XP_UNIX -@BINPATH@/Throbber-small.gif -#endif -#endif -@BINPATH@/crashreporter-override.ini -#endif - [b2g] #ifndef MOZ_WIDGET_GONK #ifdef XP_WIN32 diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index ff700b4a32..79aee8f5ff 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -825,27 +825,6 @@ bin/libfreebl_32int64_3.so @BINPATH@/maintenanceservice_installer.exe #endif -; [Crash Reporter] -; -#ifdef MOZ_CRASHREPORTER -@BINPATH@/components/CrashService.manifest -@BINPATH@/components/CrashService.js -@BINPATH@/components/toolkit_crashservice.xpt -#ifdef XP_MACOSX -@BINPATH@/crashreporter.app/ -#else -@BINPATH@/crashreporter@BIN_SUFFIX@ -@BINPATH@/crashreporter.ini -#ifdef XP_UNIX -@BINPATH@/Throbber-small.gif -#endif -#endif -@BINPATH@/browser/crashreporter-override.ini -#ifdef MOZ_CRASHREPORTER_INJECTOR -@BINPATH@/breakpadinjector.dll -#endif -#endif - #ifdef MOZ_WEBAPP_RUNTIME [WebappRuntime] #ifdef XP_WIN diff --git a/build/application.ini b/build/application.ini index 812870b75f..975b2ec934 100644 --- a/build/application.ini +++ b/build/application.ini @@ -51,9 +51,3 @@ MaxVersion=@GRE_MILESTONE@ #ifdef MOZ_PROFILE_MIGRATOR EnableProfileMigrator=1 #endif - -#if MOZ_CRASHREPORTER -[Crash Reporter] -Enabled=1 -ServerURL=https://crash-reports.mozilla.com/submit?id=@MOZ_APP_ID@&version=@MOZ_APP_VERSION@&buildid=@APP_BUILDID@ -#endif diff --git a/build/automation-build.mk b/build/automation-build.mk index 94b88b40fd..07dc67e207 100644 --- a/build/automation-build.mk +++ b/build/automation-build.mk @@ -48,11 +48,7 @@ else AUTOMATION_PPARGS += -DIS_DEBUG_BUILD=0 endif -ifdef MOZ_CRASHREPORTER -AUTOMATION_PPARGS += -DCRASHREPORTER=1 -else AUTOMATION_PPARGS += -DCRASHREPORTER=0 -endif ifdef MOZ_ASAN AUTOMATION_PPARGS += -DIS_ASAN=1 diff --git a/docshell/base/nsAboutRedirector.cpp b/docshell/base/nsAboutRedirector.cpp index e34764ab16..7c4602541d 100644 --- a/docshell/base/nsAboutRedirector.cpp +++ b/docshell/base/nsAboutRedirector.cpp @@ -45,9 +45,6 @@ static RedirEntry kRedirMap[] = { }, { "plugins", "chrome://global/content/plugins.html", 0 }, { "config", "chrome://global/content/config.xul", 0 }, -#ifdef MOZ_CRASHREPORTER - { "crashes", "chrome://global/content/crashes.xhtml", 0 }, -#endif { "logo", "chrome://branding/content/about.png", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 1c7c3281f6..f54cba61b7 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -2404,12 +2404,6 @@ nsDocShell::GetUseRemoteTabs(bool* aUseRemoteTabs) NS_IMETHODIMP nsDocShell::SetRemoteTabs(bool aUseRemoteTabs) { -#ifdef MOZ_CRASHREPORTER - if (aUseRemoteTabs) { - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("DOMIPCEnabled"), - NS_LITERAL_CSTRING("1")); - } -#endif mUseRemoteTabs = aUseRemoteTabs; return NS_OK; diff --git a/docshell/build/nsDocShellModule.cpp b/docshell/build/nsDocShellModule.cpp index c24d5b64d8..14ce06488e 100644 --- a/docshell/build/nsDocShellModule.cpp +++ b/docshell/build/nsDocShellModule.cpp @@ -156,9 +156,6 @@ const mozilla::Module::ContractIDEntry kDocShellContracts[] = { { NS_ABOUT_MODULE_CONTRACTID_PREFIX "", &kNS_ABOUT_REDIRECTOR_MODULE_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "about", &kNS_ABOUT_REDIRECTOR_MODULE_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "config", &kNS_ABOUT_REDIRECTOR_MODULE_CID }, -#ifdef MOZ_CRASHREPORTER - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "crashes", &kNS_ABOUT_REDIRECTOR_MODULE_CID }, -#endif { NS_ABOUT_MODULE_CONTRACTID_PREFIX "credits", &kNS_ABOUT_REDIRECTOR_MODULE_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "plugins", &kNS_ABOUT_REDIRECTOR_MODULE_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "mozilla", &kNS_ABOUT_REDIRECTOR_MODULE_CID }, diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index c403c1d8e4..d81d1e3f9d 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -622,11 +622,6 @@ ContentChild::Init(MessageLoop* aIOLoop, SendBackUpXResources(FileDescriptor(xSocketFd)); #endif -#ifdef MOZ_CRASHREPORTER - SendPCrashReporterConstructor(CrashReporter::CurrentThreadId(), - XRE_GetProcessType()); -#endif - GetCPOWManager(); SendGetProcessAttributes(&mID, &mIsForApp, &mIsForBrowser); @@ -1380,11 +1375,7 @@ PCrashReporterChild* ContentChild::AllocPCrashReporterChild(const mozilla::dom::NativeThreadId& id, const uint32_t& processType) { -#ifdef MOZ_CRASHREPORTER - return new CrashReporterChild(); -#else return nullptr; -#endif } bool @@ -1858,16 +1849,6 @@ ContentChild::ProcessingError(Result aCode, const char* aReason) NS_RUNTIMEABORT("not reached"); } -#if defined(MOZ_CRASHREPORTER) && !defined(MOZ_B2G) - if (ManagedPCrashReporterChild().Length() > 0) { - CrashReporterChild* crashReporter = - static_cast(ManagedPCrashReporterChild()[0]); - nsDependentCString reason(aReason); - crashReporter->SendAnnotateCrashReport( - NS_LITERAL_CSTRING("ipc_channel_error"), - reason); - } -#endif NS_RUNTIMEABORT("Content child abort due to IPC error"); } diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index b7010c9b40..b65058b71c 100755 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -217,9 +217,6 @@ static const char* sClipboardTextFlavors[] = { kUnicodeMime }; using base::ChildPrivileges; using base::KillProcess; -#ifdef MOZ_CRASHREPORTER -using namespace CrashReporter; -#endif using namespace mozilla::dom::bluetooth; using namespace mozilla::dom::cellbroadcast; using namespace mozilla::dom::devicestorage; @@ -1855,40 +1852,6 @@ ContentParent::ActorDestroy(ActorDestroyReason why) props->SetPropertyAsBool(NS_LITERAL_STRING("abnormal"), true); -#ifdef MOZ_CRASHREPORTER - // There's a window in which child processes can crash - // after IPC is established, but before a crash reporter - // is created. - if (ManagedPCrashReporterParent().Length() > 0) { - CrashReporterParent* crashReporter = - static_cast(ManagedPCrashReporterParent()[0]); - - // If we're an app process, always stomp the latest URI - // loaded in the child process with our manifest URL. We - // would rather associate the crashes with apps than - // random child windows loaded in them. - // - // XXX would be nice if we could get both ... - if (!mAppManifestURL.IsEmpty()) { - crashReporter->AnnotateCrashReport(NS_LITERAL_CSTRING("URL"), - NS_ConvertUTF16toUTF8(mAppManifestURL)); - } - - if (mCreatedPairedMinidumps) { - // We killed the child with KillHard, so two minidumps should already - // exist - one for the content process, and one for the browser process. - // The "main" minidump of this crash report is the content processes, - // and we use GenerateChildData to annotate our crash report with - // information about the child process. - crashReporter->GenerateChildData(nullptr); - } else { - crashReporter->GenerateCrashReport(this, nullptr); - } - - nsAutoString dumpID(crashReporter->ChildDumpID()); - props->SetPropertyAsAString(NS_LITERAL_STRING("dumpID"), dumpID); - } -#endif } obs->NotifyObservers((nsIPropertyBag2*) props, "ipc:content-shutdown", nullptr); } @@ -3185,40 +3148,6 @@ ContentParent::KillHard(const char* aReason) mCalledKillHard = true; mForceKillTask = nullptr; -#if defined(MOZ_CRASHREPORTER) && !defined(MOZ_B2G) - if (ManagedPCrashReporterParent().Length() > 0) { - CrashReporterParent* crashReporter = - static_cast(ManagedPCrashReporterParent()[0]); - - // We're about to kill the child process associated with this - // ContentParent. Something has gone wrong to get us here, - // so we generate a minidump to be potentially submitted in - // a crash report. ContentParent::ActorDestroy is where the - // actual report gets generated, once the child process has - // finally died. - if (crashReporter->GeneratePairedMinidump(this)) { - mCreatedPairedMinidumps = true; - // GeneratePairedMinidump created two minidumps for us - the main - // one is for the content process we're about to kill, and the other - // one is for the main browser process. That second one is the extra - // minidump tagging along, so we have to tell the crash reporter that - // it exists and is being appended. - nsAutoCString additionalDumps("browser"); - crashReporter->AnnotateCrashReport( - NS_LITERAL_CSTRING("additional_minidumps"), - additionalDumps); - if (IsKillHardAnnotationSet()) { - crashReporter->AnnotateCrashReport( - NS_LITERAL_CSTRING("kill_hard"), - GetKillHardAnnotation()); - } - nsDependentCString reason(aReason ? aReason : ""); - crashReporter->AnnotateCrashReport( - NS_LITERAL_CSTRING("ipc_channel_error"), - reason); - } - } -#endif if (!KillProcess(OtherProcess(), 1, false)) { NS_WARNING("failed to kill subprocess!"); } @@ -3269,11 +3198,7 @@ PCrashReporterParent* ContentParent::AllocPCrashReporterParent(const NativeThreadId& tid, const uint32_t& processType) { -#ifdef MOZ_CRASHREPORTER - return new CrashReporterParent(); -#else return nullptr; -#endif } bool diff --git a/dom/ipc/CrashReporterParent.cpp b/dom/ipc/CrashReporterParent.cpp index 576fbf7ff5..b799dbf2fe 100644 --- a/dom/ipc/CrashReporterParent.cpp +++ b/dom/ipc/CrashReporterParent.cpp @@ -10,13 +10,6 @@ #include "mozilla/Telemetry.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#include "nsICrashService.h" -#include "mozilla/SyncRunnable.h" -#include "nsThreadUtils.h" -#endif - namespace mozilla { namespace dom { @@ -24,9 +17,6 @@ void CrashReporterParent::AnnotateCrashReport(const nsCString& key, const nsCString& data) { -#ifdef MOZ_CRASHREPORTER - mNotes.Put(key, data); -#endif } void @@ -46,35 +36,12 @@ mozilla::ipc::IProtocol* CrashReporterParent::CloneProtocol(Channel* aChannel, mozilla::ipc::ProtocolCloneContext* aCtx) { -#ifdef MOZ_CRASHREPORTER - ContentParent* contentParent = aCtx->GetContentParent(); - CrashReporter::ThreadId childThreadId = contentParent->Pid(); - GoannaProcessType childProcessType = - contentParent->Process()->GetProcessType(); - - nsAutoPtr actor( - contentParent->AllocPCrashReporterParent(childThreadId, - childProcessType) - ); - if (!actor || - !contentParent->RecvPCrashReporterConstructor(actor, - childThreadId, - childThreadId)) { - return nullptr; - } - - return actor.forget(); -#else MOZ_CRASH("Not Implemented"); return nullptr; -#endif } CrashReporterParent::CrashReporterParent() : -#ifdef MOZ_CRASHREPORTER - mNotes(4), -#endif mStartTime(::time(nullptr)) , mInitialized(false) { @@ -95,113 +62,5 @@ CrashReporterParent::SetChildData(const NativeThreadId& tid, mProcessType = processType; } -#ifdef MOZ_CRASHREPORTER -bool -CrashReporterParent::GenerateCrashReportForMinidump(nsIFile* minidump, - const AnnotationTable* processNotes) -{ - if (!CrashReporter::GetIDFromMinidump(minidump, mChildDumpID)) - return false; - return GenerateChildData(processNotes); -} - -bool -CrashReporterParent::GenerateChildData(const AnnotationTable* processNotes) -{ - MOZ_ASSERT(mInitialized); - - nsAutoCString type; - switch (mProcessType) { - case GoannaProcessType_Content: - type = NS_LITERAL_CSTRING("content"); - break; - case GoannaProcessType_Plugin: - case GoannaProcessType_GMPlugin: - type = NS_LITERAL_CSTRING("plugin"); - break; - default: - NS_ERROR("unknown process type"); - break; - } - mNotes.Put(NS_LITERAL_CSTRING("ProcessType"), type); - - char startTime[32]; - sprintf(startTime, "%lld", static_cast(mStartTime)); - mNotes.Put(NS_LITERAL_CSTRING("StartupTime"), nsDependentCString(startTime)); - - if (!mAppNotes.IsEmpty()) - mNotes.Put(NS_LITERAL_CSTRING("Notes"), mAppNotes); - - bool ret = CrashReporter::AppendExtraData(mChildDumpID, mNotes); - if (ret && processNotes) - ret = CrashReporter::AppendExtraData(mChildDumpID, *processNotes); - if (!ret) - NS_WARNING("problem appending child data to .extra"); - - nsCOMPtr mainThread = do_GetMainThread(); - class NotifyOnMainThread : public nsRunnable - { - public: - explicit NotifyOnMainThread(CrashReporterParent* aCR) - : mCR(aCR) - { } - - NS_IMETHOD Run() { - mCR->NotifyCrashService(); - return NS_OK; - } - private: - CrashReporterParent* mCR; - }; - SyncRunnable::DispatchToThread(mainThread, new NotifyOnMainThread(this)); - return ret; -} - -void -CrashReporterParent::NotifyCrashService() -{ - MOZ_ASSERT(NS_IsMainThread()); - - nsCOMPtr crashService = - do_GetService("@mozilla.org/crashservice;1"); - if (!crashService) { - return; - } - - int32_t processType; - int32_t crashType = nsICrashService::CRASH_TYPE_CRASH; - - nsCString telemetryKey; - - switch (mProcessType) { - case GoannaProcessType_Content: - processType = nsICrashService::PROCESS_TYPE_CONTENT; - telemetryKey.AssignLiteral("content"); - break; - case GoannaProcessType_Plugin: { - processType = nsICrashService::PROCESS_TYPE_PLUGIN; - telemetryKey.AssignLiteral("plugin"); - nsAutoCString val; - if (mNotes.Get(NS_LITERAL_CSTRING("PluginHang"), &val) && - val.Equals(NS_LITERAL_CSTRING("1"))) { - crashType = nsICrashService::CRASH_TYPE_HANG; - telemetryKey.AssignLiteral("pluginhang"); - } - break; - } - case GoannaProcessType_GMPlugin: - processType = nsICrashService::PROCESS_TYPE_GMPLUGIN; - telemetryKey.AssignLiteral("gmplugin"); - break; - default: - NS_ERROR("unknown process type"); - return; - } - - crashService->AddCrash(processType, crashType, mChildDumpID); - Telemetry::Accumulate(Telemetry::SUBPROCESS_CRASHES_WITH_DUMP, telemetryKey, 1); -} -#endif - } // namespace dom } // namespace mozilla diff --git a/dom/ipc/CrashReporterParent.h b/dom/ipc/CrashReporterParent.h index 44ea3b3a7b..d8c28acec4 100644 --- a/dom/ipc/CrashReporterParent.h +++ b/dom/ipc/CrashReporterParent.h @@ -10,10 +10,6 @@ #include "mozilla/dom/PCrashReporterParent.h" #include "mozilla/dom/TabMessageUtils.h" #include "nsIFile.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#include "nsDataHashtable.h" -#endif namespace mozilla { namespace dom { @@ -22,46 +18,10 @@ class ProcessReporter; class CrashReporterParent : public PCrashReporterParent { -#ifdef MOZ_CRASHREPORTER - typedef CrashReporter::AnnotationTable AnnotationTable; -#endif public: CrashReporterParent(); virtual ~CrashReporterParent(); -#ifdef MOZ_CRASHREPORTER - /* Attempt to generate a parent/child pair of minidumps from the given - toplevel actor in the event of a hang. Returns true if successful, - false otherwise. - */ - template - bool - GeneratePairedMinidump(Toplevel* t); - - /* Attempt to create a bare-bones crash report, along with extra process- - specific annotations present in the given AnnotationTable. Returns true if - successful, false otherwise. - */ - template - bool - GenerateCrashReport(Toplevel* t, const AnnotationTable* processNotes); - - /** - * Add the .extra data for an existing crash report. - */ - bool - GenerateChildData(const AnnotationTable* processNotes); - - bool - GenerateCrashReportForMinidump(nsIFile* minidump, - const AnnotationTable* processNotes); - - /* Instantiate a new crash reporter actor from a given parent that manages - the protocol. - */ - template - static bool CreateCrashReporter(Toplevel* actor); -#endif /* Initialize this reporter with data from the child process */ void SetChildData(const NativeThreadId& id, const uint32_t& processType); @@ -90,14 +50,6 @@ public: CloneProtocol(Channel* aChannel, mozilla::ipc::ProtocolCloneContext *aCtx) override; -#ifdef MOZ_CRASHREPORTER - void - NotifyCrashService(); -#endif - -#ifdef MOZ_CRASHREPORTER - AnnotationTable mNotes; -#endif nsCString mAppNotes; nsString mChildDumpID; NativeThreadId mMainThread; @@ -106,61 +58,6 @@ public: bool mInitialized; }; -#ifdef MOZ_CRASHREPORTER -template -inline bool -CrashReporterParent::GeneratePairedMinidump(Toplevel* t) -{ - CrashReporter::ProcessHandle child; -#ifdef XP_MACOSX - child = t->Process()->GetChildTask(); -#else - child = t->OtherProcess(); -#endif - nsCOMPtr childDump; - if (CrashReporter::CreatePairedMinidumps(child, - mMainThread, - getter_AddRefs(childDump)) && - CrashReporter::GetIDFromMinidump(childDump, mChildDumpID)) { - return true; - } - return false; -} - -template -inline bool -CrashReporterParent::GenerateCrashReport(Toplevel* t, - const AnnotationTable* processNotes) -{ - nsCOMPtr crashDump; - if (t->TakeMinidump(getter_AddRefs(crashDump), nullptr) && - CrashReporter::GetIDFromMinidump(crashDump, mChildDumpID)) { - return GenerateChildData(processNotes); - } - return false; -} - -template -/* static */ bool -CrashReporterParent::CreateCrashReporter(Toplevel* actor) -{ -#ifdef MOZ_CRASHREPORTER - NativeThreadId id; - uint32_t processType; - PCrashReporterParent* p = - actor->CallPCrashReporterConstructor(&id, &processType); - if (p) { - static_cast(p)->SetChildData(id, processType); - } else { - NS_ERROR("Error creating crash reporter actor"); - } - return !!p; -#endif - return false; -} - -#endif - } // namespace dom } // namespace mozilla diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index af460d2291..1123e5bda5 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -37,9 +37,6 @@ #include "nsDocShell.h" #include "nsEmbedCID.h" #include -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif #include "nsFilePickerProxy.h" #include "mozilla/dom/Element.h" #include "nsIBaseWindow.h" @@ -1689,10 +1686,6 @@ TabChild::RecvLoadURL(const nsCString& aURI, NS_WARNING("WebNavigation()->LoadURI failed. Eating exception, what else can I do?"); } -#ifdef MOZ_CRASHREPORTER - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("URL"), aURI); -#endif - nsRefPtr swm = ServiceWorkerManager::GetInstance(); MOZ_ASSERT(swm); swm->LoadRegistrations(aConfiguration.serviceWorkerRegistrations()); diff --git a/dom/ipc/TabMessageUtils.h b/dom/ipc/TabMessageUtils.h index 76d568adff..a9d4d9e928 100644 --- a/dom/ipc/TabMessageUtils.h +++ b/dom/ipc/TabMessageUtils.h @@ -12,10 +12,6 @@ #include "nsIDOMEvent.h" #include "nsCOMPtr.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif - namespace mozilla { namespace dom { struct RemoteDOMEvent @@ -27,12 +23,8 @@ struct RemoteDOMEvent bool ReadRemoteEvent(const IPC::Message* aMsg, void** aIter, mozilla::dom::RemoteDOMEvent* aResult); -#ifdef MOZ_CRASHREPORTER -typedef CrashReporter::ThreadId NativeThreadId; -#else // unused in this case typedef int32_t NativeThreadId; -#endif } } diff --git a/dom/media/gmp/GMPChild.cpp b/dom/media/gmp/GMPChild.cpp index 48db7bca16..7b0ddbca4e 100644 --- a/dom/media/gmp/GMPChild.cpp +++ b/dom/media/gmp/GMPChild.cpp @@ -261,10 +261,6 @@ GMPChild::Init(const std::string& aPluginPath, return false; } -#ifdef MOZ_CRASHREPORTER - SendPCrashReporterConstructor(CrashReporter::CurrentThreadId()); -#endif - mPluginPath = aPluginPath; mVoucherPath = aVoucherPath; return true; diff --git a/dom/media/gmp/GMPParent.cpp b/dom/media/gmp/GMPParent.cpp index 6479c99392..74ff5c4ec2 100644 --- a/dom/media/gmp/GMPParent.cpp +++ b/dom/media/gmp/GMPParent.cpp @@ -25,11 +25,6 @@ #include "mozilla/dom/CrashReporterParent.h" using mozilla::dom::CrashReporterParent; -#ifdef MOZ_CRASHREPORTER -using CrashReporter::AnnotationTable; -using CrashReporter::GetIDFromMinidump; -#endif - #include "mozilla/Telemetry.h" namespace mozilla { @@ -636,80 +631,10 @@ GMPParent::GetGMPVideoEncoder(GMPVideoEncoderParent** aGMPVE) return NS_OK; } -#ifdef MOZ_CRASHREPORTER -void -GMPParent::WriteExtraDataForMinidump(CrashReporter::AnnotationTable& notes) -{ - notes.Put(NS_LITERAL_CSTRING("GMPPlugin"), NS_LITERAL_CSTRING("1")); - notes.Put(NS_LITERAL_CSTRING("PluginFilename"), - NS_ConvertUTF16toUTF8(mName)); - notes.Put(NS_LITERAL_CSTRING("PluginName"), mDisplayName); - notes.Put(NS_LITERAL_CSTRING("PluginVersion"), mVersion); -} - -void -GMPParent::GetCrashID(nsString& aResult) -{ - CrashReporterParent* cr = nullptr; - if (ManagedPCrashReporterParent().Length() > 0) { - cr = static_cast(ManagedPCrashReporterParent()[0]); - } - if (NS_WARN_IF(!cr)) { - return; - } - - AnnotationTable notes(4); - WriteExtraDataForMinidump(notes); - nsCOMPtr dumpFile; - TakeMinidump(getter_AddRefs(dumpFile), nullptr); - if (!dumpFile) { - NS_WARNING("GMP crash without crash report"); - aResult = mName; - aResult += '-'; - AppendUTF8toUTF16(mVersion, aResult); - return; - } - GetIDFromMinidump(dumpFile, aResult); - cr->GenerateCrashReportForMinidump(dumpFile, ¬es); -} - -static void -GMPNotifyObservers(const nsACString& aPluginId, const nsACString& aPluginName, const nsAString& aPluginDumpId) -{ - nsCOMPtr obs = mozilla::services::GetObserverService(); - if (obs) { - nsString id; - AppendUTF8toUTF16(aPluginId, id); - id.Append(NS_LITERAL_STRING(" ")); - AppendUTF8toUTF16(aPluginName, id); - id.Append(NS_LITERAL_STRING(" ")); - id.Append(aPluginDumpId); - obs->NotifyObservers(nullptr, "gmp-plugin-crash", id.Data()); - } - - nsRefPtr service = - gmp::GoannaMediaPluginService::GetGoannaMediaPluginService(); - if (service) { - service->RunPluginCrashCallbacks(aPluginId, aPluginName, aPluginDumpId); - } -} -#endif void GMPParent::ActorDestroy(ActorDestroyReason aWhy) { LOGD(("%s::%s: %p (%d)", __CLASS__, __FUNCTION__, this, (int) aWhy)); -#ifdef MOZ_CRASHREPORTER - if (AbnormalShutdown == aWhy) { - Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT, - NS_LITERAL_CSTRING("gmplugin"), 1); - nsString dumpID; - GetCrashID(dumpID); - // NotifyObservers is mainthread-only - NS_DispatchToMainThread(WrapRunnableNM(&GMPNotifyObservers, - mPluginId, mDisplayName, dumpID), - NS_DISPATCH_NORMAL); - } -#endif // warn us off trying to close again mState = GMPStateClosing; mAbnormalShutdownInProgress = true; @@ -734,9 +659,6 @@ GMPParent::ActorDestroy(ActorDestroyReason aWhy) mozilla::dom::PCrashReporterParent* GMPParent::AllocPCrashReporterParent(const NativeThreadId& aThread) { -#ifndef MOZ_CRASHREPORTER - MOZ_ASSERT(false, "Should only be sent if crash reporting is enabled."); -#endif CrashReporterParent* cr = new CrashReporterParent(); cr->SetChildData(aThread, GoannaProcessType_GMPlugin); return cr; diff --git a/dom/media/gmp/GMPParent.h b/dom/media/gmp/GMPParent.h index a014307d94..28a8fea497 100644 --- a/dom/media/gmp/GMPParent.h +++ b/dom/media/gmp/GMPParent.h @@ -26,17 +26,6 @@ class nsILineInputStream; class nsIThread; -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" - -namespace mozilla { -namespace dom { -class PCrashReporterParent; -class CrashReporterParent; -} -} -#endif - namespace mozilla { namespace gmp { @@ -148,10 +137,6 @@ private: nsRefPtr mService; bool EnsureProcessLoaded(); nsresult ReadGMPMetaData(); -#ifdef MOZ_CRASHREPORTER - void WriteExtraDataForMinidump(CrashReporter::AnnotationTable& notes); - void GetCrashID(nsString& aResult); -#endif virtual void ActorDestroy(ActorDestroyReason aWhy) override; virtual PCrashReporterParent* AllocPCrashReporterParent(const NativeThreadId& aThread) override; diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index 2e02dab104..03b8b33700 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -104,10 +104,6 @@ #define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GoannaPlugins" , ## args) #endif -#if MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif - using namespace mozilla; using mozilla::TimeStamp; using mozilla::plugins::PluginTag; @@ -956,12 +952,6 @@ nsPluginHost::TrySetUpPluginInstance(const char *aMimeType, NS_ASSERTION(pluginTag, "Must have plugin tag here!"); -#if defined(MOZ_WIDGET_ANDROID) && defined(MOZ_CRASHREPORTER) - if (pluginTag->mIsFlashPlugin) { - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("FlashVersion"), pluginTag->mVersion); - } -#endif - nsRefPtr instance = new nsNPAPIPluginInstance(); // This will create the owning reference. The connection must be made between the diff --git a/dom/plugins/base/nsPluginsDirDarwin.cpp b/dom/plugins/base/nsPluginsDirDarwin.cpp index a72470a99a..c0cf18502e 100644 --- a/dom/plugins/base/nsPluginsDirDarwin.cpp +++ b/dom/plugins/base/nsPluginsDirDarwin.cpp @@ -25,9 +25,6 @@ #include "nsILocalFileMac.h" #include "nsCocoaFeatures.h" -#if defined(MOZ_CRASHREPORTER) -#include "nsExceptionHandler.h" -#endif #include #include @@ -487,14 +484,6 @@ nsresult nsPluginFile::GetPluginInfo(nsPluginInfo& info, PRLibrary **outLibrary) NS_WARNING(msg.get()); return NS_ERROR_FAILURE; } -#if defined(MOZ_CRASHREPORTER) - // The block above assumes that "fbplugin" is the filename of the plugin - // to be blocked, or that the filename starts with "fbplugin_". But we - // don't yet know for sure if this is always true. So for the time being - // record extra information in our crash logs. - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Bug_1086977"), - fileName); -#endif } // It's possible that our plugin has 2 entry points that'll give us mime type @@ -504,14 +493,6 @@ nsresult nsPluginFile::GetPluginInfo(nsPluginInfo& info, PRLibrary **outLibrary) // Sadly we have to load the library for this to work. rv = LoadPlugin(outLibrary); -#if defined(MOZ_CRASHREPORTER) - if (nsCocoaFeatures::OnYosemiteOrLater()) { - // If we didn't crash in LoadPlugin(), change the previous annotation so we - // don't sow confusion. - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Bug_1086977"), - NS_LITERAL_CSTRING("Didn't crash, please ignore")); - } -#endif if (NS_FAILED(rv)) return rv; diff --git a/dom/plugins/ipc/PluginMessageUtils.h b/dom/plugins/ipc/PluginMessageUtils.h index ce24815b02..5d0cd35181 100644 --- a/dom/plugins/ipc/PluginMessageUtils.h +++ b/dom/plugins/ipc/PluginMessageUtils.h @@ -22,9 +22,6 @@ #include "nsTArray.h" #include "prlog.h" #include "nsHashKeys.h" -#ifdef MOZ_CRASHREPORTER -# include "nsExceptionHandler.h" -#endif #ifdef XP_MACOSX #include "PluginInterposeOSX.h" #else diff --git a/dom/plugins/ipc/PluginModuleChild.cpp b/dom/plugins/ipc/PluginModuleChild.cpp index c0eb486c1a..487554932e 100644 --- a/dom/plugins/ipc/PluginModuleChild.cpp +++ b/dom/plugins/ipc/PluginModuleChild.cpp @@ -816,10 +816,6 @@ PluginModuleChild::AnswerPCrashReporterConstructor( mozilla::dom::NativeThreadId* id, uint32_t* processType) { -#ifdef MOZ_CRASHREPORTER - *id = CrashReporter::CurrentThreadId(); - *processType = XRE_GetProcessType(); -#endif return true; } diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp index 206c4a40ef..e053424efb 100755 --- a/dom/plugins/ipc/PluginModuleParent.cpp +++ b/dom/plugins/ipc/PluginModuleParent.cpp @@ -64,12 +64,6 @@ using namespace mozilla; using namespace mozilla::plugins; using namespace mozilla::plugins::parent; -#ifdef MOZ_CRASHREPORTER -#include "mozilla/dom/CrashReporterParent.h" - -using namespace CrashReporter; -#endif - static const char kContentTimeoutPref[] = "dom.ipc.plugins.contentTimeoutSecs"; static const char kChildTimeoutPref[] = "dom.ipc.plugins.timeoutSecs"; static const char kParentTimeoutPref[] = "dom.ipc.plugins.parentTimeoutSecs"; @@ -459,22 +453,6 @@ PluginModuleChromeParent::OnProcessLaunched(const bool aSucceeded) Preferences::RegisterCallback(TimeoutChanged, kHangUIMinDisplayPref, this); #endif -#ifdef MOZ_CRASHREPORTER - // If this fails, we're having IPC troubles, and we're doomed anyways. - if (!CrashReporterParent::CreateCrashReporter(this)) { - mShutdown = true; - Close(); - OnInitFailure(); - return; - } -#ifdef XP_WIN - { // Scope for lock - mozilla::MutexAutoLock lock(mCrashReporterMutex); - mCrashReporter = CrashReporter(); - } -#endif -#endif - #ifdef XP_WIN if (!mIsBlocklisted && mIsFlashPlugin && Preferences::GetBool("dom.ipc.plugins.flash.disable-protected-mode", false)) { @@ -576,14 +554,6 @@ PluginModuleChromeParent::PluginModuleChromeParent(const char* aFilePath, uint32 , mHangUIParent(nullptr) , mHangUIEnabled(true) , mIsTimerReset(true) -#ifdef MOZ_CRASHREPORTER - , mCrashReporterMutex("PluginModuleParent::mCrashReporterMutex") - , mCrashReporter(nullptr) -#endif -#endif -#ifdef MOZ_CRASHREPORTER_INJECTOR - , mFlashProcess1(0) - , mFlashProcess2(0) #endif , mInitOnAsyncConnect(false) , mAsyncInitRv(NS_ERROR_NOT_INITIALIZED) @@ -626,13 +596,6 @@ PluginModuleChromeParent::~PluginModuleChromeParent() mSubprocess = nullptr; } -#ifdef MOZ_CRASHREPORTER_INJECTOR - if (mFlashProcess1) - UnregisterInjectorCallback(mFlashProcess1); - if (mFlashProcess2) - UnregisterInjectorCallback(mFlashProcess2); -#endif - UnregisterSettingsCallbacks(); Preferences::UnregisterCallback(TimeoutChanged, kChildTimeoutPref, this); @@ -650,52 +613,6 @@ PluginModuleChromeParent::~PluginModuleChromeParent() mozilla::HangMonitor::UnregisterAnnotator(*this); } -#ifdef MOZ_CRASHREPORTER -void -PluginModuleChromeParent::WriteExtraDataForMinidump(AnnotationTable& notes) -{ -#ifdef XP_WIN - // mCrashReporterMutex is already held by the caller - mCrashReporterMutex.AssertCurrentThreadOwns(); -#endif - typedef nsDependentCString CS; - - // Get the plugin filename, try to get just the file leafname - const std::string& pluginFile = mSubprocess->GetPluginFilePath(); - size_t filePos = pluginFile.rfind(FILE_PATH_SEPARATOR); - if (filePos == std::string::npos) - filePos = 0; - else - filePos++; - notes.Put(NS_LITERAL_CSTRING("PluginFilename"), CS(pluginFile.substr(filePos).c_str())); - - notes.Put(NS_LITERAL_CSTRING("PluginName"), mPluginName); - notes.Put(NS_LITERAL_CSTRING("PluginVersion"), mPluginVersion); - - CrashReporterParent* crashReporter = CrashReporter(); - if (crashReporter) { -#ifdef XP_WIN - if (mPluginCpuUsageOnHang.Length() > 0) { - notes.Put(NS_LITERAL_CSTRING("NumberOfProcessors"), - nsPrintfCString("%d", PR_GetNumberOfProcessors())); - - nsCString cpuUsageStr; - cpuUsageStr.AppendFloat(std::ceil(mPluginCpuUsageOnHang[0] * 100) / 100); - notes.Put(NS_LITERAL_CSTRING("PluginCpuUsage"), cpuUsageStr); - -#ifdef MOZ_CRASHREPORTER_INJECTOR - for (uint32_t i=1; iAnnotateCrashReport(NS_LITERAL_CSTRING("PluginHang"), - NS_LITERAL_CSTRING("1")); -#ifdef XP_WIN - if (mHangUIParent) { - unsigned int hangUIDuration = mHangUIParent->LastShowDurationMs(); - if (hangUIDuration) { - nsPrintfCString strHangUIDuration("%u", hangUIDuration); - crashReporter->AnnotateCrashReport( - NS_LITERAL_CSTRING("PluginHangUIDuration"), - strHangUIDuration); - } - } -#endif // XP_WIN - if (crashReporter->GeneratePairedMinidump(this)) { - mPluginDumpID = crashReporter->ChildDumpID(); - PLUGIN_LOG_DEBUG( - ("generated paired browser/plugin minidumps: %s)", - NS_ConvertUTF16toUTF8(mPluginDumpID).get())); - - nsAutoCString additionalDumps("browser"); - -#ifdef MOZ_CRASHREPORTER_INJECTOR - nsCOMPtr pluginDumpFile; - - if (GetMinidumpForID(mPluginDumpID, getter_AddRefs(pluginDumpFile)) && - pluginDumpFile) { - nsCOMPtr childDumpFile; - - if (CreateFlashMinidump(mFlashProcess1, 0, pluginDumpFile, - NS_LITERAL_CSTRING("flash1"))) { - additionalDumps.AppendLiteral(",flash1"); - } - if (CreateFlashMinidump(mFlashProcess2, 0, pluginDumpFile, - NS_LITERAL_CSTRING("flash2"))) { - additionalDumps.AppendLiteral(",flash2"); - } - } -#endif - - crashReporter->AnnotateCrashReport( - NS_LITERAL_CSTRING("additional_minidumps"), - additionalDumps); - } else { - NS_WARNING("failed to capture paired minidumps from hang"); - } -#endif - #ifdef XP_WIN // collect cpu usage for plugin processes @@ -1008,18 +845,6 @@ PluginModuleChromeParent::TerminateChildProcess(MessageLoop* aMsgLoop) processHandles.AppendElement(OtherProcess()); -#ifdef MOZ_CRASHREPORTER_INJECTOR - { - base::ProcessHandle handle; - if (mFlashProcess1 && base::OpenProcessHandle(mFlashProcess1, &handle)) { - processHandles.AppendElement(handle); - } - if (mFlashProcess2 && base::OpenProcessHandle(mFlashProcess2, &handle)) { - processHandles.AppendElement(handle); - } - } -#endif - if (!GetProcessCpuUsage(processHandles, mPluginCpuUsageOnHang)) { mPluginCpuUsageOnHang.Clear(); } @@ -1154,102 +979,6 @@ PluginModuleChromeParent::OnHangUIContinue() } #endif // XP_WIN -#ifdef MOZ_CRASHREPORTER -CrashReporterParent* -PluginModuleChromeParent::CrashReporter() -{ - return static_cast(ManagedPCrashReporterParent()[0]); -} - -#ifdef MOZ_CRASHREPORTER_INJECTOR -static void -RemoveMinidump(nsIFile* minidump) -{ - if (!minidump) - return; - - minidump->Remove(false); - nsCOMPtr extraFile; - if (GetExtraFileForMinidump(minidump, - getter_AddRefs(extraFile))) { - extraFile->Remove(true); - } -} -#endif // MOZ_CRASHREPORTER_INJECTOR - -void -PluginModuleChromeParent::ProcessFirstMinidump() -{ -#ifdef XP_WIN - mozilla::MutexAutoLock lock(mCrashReporterMutex); -#endif - CrashReporterParent* crashReporter = CrashReporter(); - if (!crashReporter) - return; - - AnnotationTable notes(4); - WriteExtraDataForMinidump(notes); - - if (!mPluginDumpID.IsEmpty()) { - crashReporter->GenerateChildData(¬es); - return; - } - - uint32_t sequence = UINT32_MAX; - nsCOMPtr dumpFile; - nsAutoCString flashProcessType; - TakeMinidump(getter_AddRefs(dumpFile), &sequence); - -#ifdef MOZ_CRASHREPORTER_INJECTOR - nsCOMPtr childDumpFile; - uint32_t childSequence; - - if (mFlashProcess1 && - TakeMinidumpForChild(mFlashProcess1, - getter_AddRefs(childDumpFile), - &childSequence)) { - if (childSequence < sequence) { - RemoveMinidump(dumpFile); - dumpFile = childDumpFile; - sequence = childSequence; - flashProcessType.AssignLiteral("Broker"); - } - else { - RemoveMinidump(childDumpFile); - } - } - if (mFlashProcess2 && - TakeMinidumpForChild(mFlashProcess2, - getter_AddRefs(childDumpFile), - &childSequence)) { - if (childSequence < sequence) { - RemoveMinidump(dumpFile); - dumpFile = childDumpFile; - sequence = childSequence; - flashProcessType.AssignLiteral("Sandbox"); - } - else { - RemoveMinidump(childDumpFile); - } - } -#endif - - if (!dumpFile) { - NS_WARNING("[PluginModuleParent::ActorDestroy] abnormal shutdown without minidump!"); - return; - } - - PLUGIN_LOG_DEBUG(("got child minidump: %s", - NS_ConvertUTF16toUTF8(mPluginDumpID).get())); - - GetIDFromMinidump(dumpFile, mPluginDumpID); - if (!flashProcessType.IsEmpty()) { - notes.Put(NS_LITERAL_CSTRING("FlashProcessDump"), flashProcessType); - } - crashReporter->GenerateCrashReportForMinidump(dumpFile, ¬es); -} -#endif - void PluginModuleParent::ActorDestroy(ActorDestroyReason why) { @@ -1278,9 +1007,6 @@ void PluginModuleChromeParent::ActorDestroy(ActorDestroyReason why) { if (why == AbnormalShutdown) { -#ifdef MOZ_CRASHREPORTER - ProcessFirstMinidump(); -#endif Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT, NS_LITERAL_CSTRING("plugin"), 1); } @@ -2009,9 +1735,6 @@ PluginModuleChromeParent::RecvNP_InitializeResult(const NPError& aError) } #endif -#ifdef MOZ_CRASHREPORTER_INJECTOR - InitializeInjector(); -#endif } return PluginModuleParent::RecvNP_InitializeResult(aError) && ok; @@ -2451,24 +2174,12 @@ PCrashReporterParent* PluginModuleChromeParent::AllocPCrashReporterParent(mozilla::dom::NativeThreadId* id, uint32_t* processType) { -#ifdef MOZ_CRASHREPORTER - return new CrashReporterParent(); -#else return nullptr; -#endif } bool PluginModuleChromeParent::DeallocPCrashReporterParent(PCrashReporterParent* actor) { -#ifdef MOZ_CRASHREPORTER -#ifdef XP_WIN - mozilla::MutexAutoLock lock(mCrashReporterMutex); - if (actor == static_cast(mCrashReporter)) { - mCrashReporter = nullptr; - } -#endif -#endif delete actor; return true; } @@ -2558,81 +2269,6 @@ PluginModuleChromeParent::RecvNotifyContentModuleDestroyed() return true; } -#ifdef MOZ_CRASHREPORTER_INJECTOR - -// We only add the crash reporter to subprocess which have the filename -// FlashPlayerPlugin* -#define FLASH_PROCESS_PREFIX "FLASHPLAYERPLUGIN" - -static DWORD -GetFlashChildOfPID(DWORD pid, HANDLE snapshot) -{ - PROCESSENTRY32 entry = { - sizeof(entry) - }; - for (BOOL ok = Process32First(snapshot, &entry); - ok; - ok = Process32Next(snapshot, &entry)) { - if (entry.th32ParentProcessID == pid) { - nsString name(entry.szExeFile); - ToUpperCase(name); - if (StringBeginsWith(name, NS_LITERAL_STRING(FLASH_PROCESS_PREFIX))) { - return entry.th32ProcessID; - } - } - } - return 0; -} - -// We only look for child processes of the Flash plugin, NPSWF* -#define FLASH_PLUGIN_PREFIX "NPSWF" - -void -PluginModuleChromeParent::InitializeInjector() -{ - if (!Preferences::GetBool("dom.ipc.plugins.flash.subprocess.crashreporter.enabled", false)) - return; - - nsCString path(Process()->GetPluginFilePath().c_str()); - ToUpperCase(path); - int32_t lastSlash = path.RFindCharInSet("\\/"); - if (kNotFound == lastSlash) - return; - - if (!StringBeginsWith(Substring(path, lastSlash + 1), - NS_LITERAL_CSTRING(FLASH_PLUGIN_PREFIX))) - return; - - TimeStamp th32Start = TimeStamp::Now(); - nsAutoHandle snapshot(CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)); - if (INVALID_HANDLE_VALUE == snapshot) - return; - TimeStamp th32End = TimeStamp::Now(); - mTimeBlocked += (th32End - th32Start); - - DWORD pluginProcessPID = GetProcessId(Process()->GetChildProcessHandle()); - mFlashProcess1 = GetFlashChildOfPID(pluginProcessPID, snapshot); - if (mFlashProcess1) { - InjectCrashReporterIntoProcess(mFlashProcess1, this); - - mFlashProcess2 = GetFlashChildOfPID(mFlashProcess1, snapshot); - if (mFlashProcess2) { - InjectCrashReporterIntoProcess(mFlashProcess2, this); - } - } -} - -void -PluginModuleChromeParent::OnCrash(DWORD processID) -{ - if (!mShutdown) { - GetIPCChannel()->CloseWithError(); - KillProcess(OtherProcess(), 1, false); - } -} - -#endif // MOZ_CRASHREPORTER_INJECTOR - #ifdef MOZ_ENABLE_PROFILER_SPS class PluginProfilerObserver final : public nsIObserver, public nsSupportsWeakReference diff --git a/dom/plugins/ipc/PluginModuleParent.h b/dom/plugins/ipc/PluginModuleParent.h index 9e58baabb4..3f860ed179 100644 --- a/dom/plugins/ipc/PluginModuleParent.h +++ b/dom/plugins/ipc/PluginModuleParent.h @@ -24,10 +24,6 @@ #include "nsHashKeys.h" #include "nsIObserver.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif - class nsPluginTag; namespace mozilla { @@ -67,9 +63,6 @@ class PluginHangUIParent; class PluginModuleParent : public PPluginModuleParent , public PluginLibrary -#ifdef MOZ_CRASHREPORTER_INJECTOR - , public CrashReporter::InjectorCrashCallback -#endif { protected: typedef mozilla::PluginLibrary PluginLibrary; @@ -323,10 +316,6 @@ class PluginModuleContentParent : public PluginModuleParent virtual bool ShouldContinueFromReplyTimeout() override; virtual void OnExitedSyncSend() override; -#ifdef MOZ_CRASHREPORTER_INJECTOR - void OnCrash(DWORD processID) override {} -#endif - static PluginModuleContentParent* sSavedModuleParent; uint32_t mPluginId; @@ -395,11 +384,6 @@ private: virtual bool ShouldContinueFromReplyTimeout() override; -#ifdef MOZ_CRASHREPORTER - void ProcessFirstMinidump(); - void WriteExtraDataForMinidump(CrashReporter::AnnotationTable& notes); -#endif - virtual PCrashReporterParent* AllocPCrashReporterParent(mozilla::dom::NativeThreadId* id, uint32_t* processType) override; @@ -460,17 +444,6 @@ private: PluginHangUIParent *mHangUIParent; bool mHangUIEnabled; bool mIsTimerReset; -#ifdef MOZ_CRASHREPORTER - /** - * This mutex protects the crash reporter when the Plugin Hang UI event - * handler is executing off main thread. It is intended to protect both - * the mCrashReporter variable in addition to the CrashReporterParent object - * that mCrashReporter refers to. - */ - mozilla::Mutex mCrashReporterMutex; - CrashReporterParent* mCrashReporter; -#endif // MOZ_CRASHREPORTER - /** * Launches the Plugin Hang UI. @@ -492,15 +465,6 @@ private: friend class mozilla::dom::CrashReporterParent; friend class mozilla::plugins::PluginAsyncSurrogate; -#ifdef MOZ_CRASHREPORTER_INJECTOR - void InitializeInjector(); - - void OnCrash(DWORD processID) override; - - DWORD mFlashProcess1; - DWORD mFlashProcess2; -#endif - void OnProcessLaunched(const bool aSucceeded); class LaunchedTask : public LaunchCompleteTask diff --git a/gfx/src/gfxCrashReporterUtils.cpp b/gfx/src/gfxCrashReporterUtils.cpp index 1f3f84c228..5d7cc15e77 100644 --- a/gfx/src/gfxCrashReporterUtils.cpp +++ b/gfx/src/gfxCrashReporterUtils.cpp @@ -5,10 +5,6 @@ #include "gfxCrashReporterUtils.h" -#if defined(MOZ_CRASHREPORTER) -#define MOZ_GFXFEATUREREPORTER 1 -#endif - #ifdef MOZ_GFXFEATUREREPORTER #include "gfxCrashReporterUtils.h" #include // for strcmp diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index ae39af7c0f..ed1b2ffdac 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -59,9 +59,6 @@ #include "nsILocaleService.h" #include "nsIObserverService.h" #include "MainThreadUtils.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif #include "nsWeakReference.h" @@ -242,12 +239,7 @@ void CrashStatsLogForwarder::UpdateCrashReport() message << "|[" << (*it).first << "]" << (*it).second; } -#ifdef MOZ_CRASHREPORTER - nsCString reportString(message.str().c_str()); - nsresult annotated = CrashReporter::AnnotateCrashReport(mCrashCriticalKey, reportString); -#else nsresult annotated = NS_ERROR_NOT_IMPLEMENTED; -#endif if (annotated != NS_OK) { printf("Crash Annotation %s: %s", mCrashCriticalKey.get(), message.str().c_str()); diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index 5e5b10cf49..e646e6aff6 100644 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -73,10 +73,6 @@ #include "SurfaceCache.h" #include "gfxPrefs.h" -#if defined(MOZ_CRASHREPORTER) -#include "nsExceptionHandler.h" -#endif - #include "VsyncSource.h" using namespace mozilla; @@ -1688,15 +1684,9 @@ bool DoesD3D11DeviceWork(ID3D11Device *device) gfxWindowsPlatform::GetDLLVersion(L"dlumd32.dll", displayLinkModuleVersionString); uint64_t displayLinkModuleVersion; if (!ParseDriverVersion(displayLinkModuleVersionString, &displayLinkModuleVersion)) { -#if defined(MOZ_CRASHREPORTER) - CrashReporter::AppendAppNotesToCrashReport(NS_LITERAL_CSTRING("DisplayLink: could not parse version\n")); -#endif return false; } if (displayLinkModuleVersion <= V(8,6,1,36484)) { -#if defined(MOZ_CRASHREPORTER) - CrashReporter::AppendAppNotesToCrashReport(NS_LITERAL_CSTRING("DisplayLink: too old version\n")); -#endif return false; } } @@ -1729,9 +1719,6 @@ bool DoesD3D11TextureSharingWork(ID3D11Device *device) gfxInfo->GetAdapterVendorID(vendorID); gfxInfo->GetAdapterVendorID2(vendorID2); if (vendorID.EqualsLiteral("0x8086") && vendorID2.IsEmpty()) { -#if defined(MOZ_CRASHREPORTER) - CrashReporter::AppendAppNotesToCrashReport(NS_LITERAL_CSTRING("Unexpected Intel/AMD dual-GPU setup\n")); -#endif return false; } } @@ -1784,9 +1771,6 @@ bool DoesD3D11TextureSharingWork(ID3D11Device *device) // This if(FAILED()) is the one that actually fails on systems affected by bug 1083071. if (FAILED(device->CreateShaderResourceView(sharedTexture, NULL, byRef(sharedView)))) { -#if defined(MOZ_CRASHREPORTER) - CrashReporter::AppendAppNotesToCrashReport(NS_LITERAL_CSTRING("CreateShaderResourceView failed\n")); -#endif return false; } diff --git a/ipc/glue/GoannaChildProcessHost.cpp b/ipc/glue/GoannaChildProcessHost.cpp index e8980ce397..dcffd3d8f2 100644 --- a/ipc/glue/GoannaChildProcessHost.cpp +++ b/ipc/glue/GoannaChildProcessHost.cpp @@ -257,11 +257,6 @@ uint32_t GoannaChildProcessHost::GetSupportedArchitecturesForProcessType(GoannaP void GoannaChildProcessHost::PrepareLaunch() { -#ifdef MOZ_CRASHREPORTER - if (CrashReporter::GetEnabled()) { - CrashReporter::OOPInit(); - } -#endif #ifdef XP_WIN if (mProcessType == GoannaProcessType_Plugin) { @@ -685,26 +680,6 @@ GoannaChildProcessHost::PerformAsyncLaunchInternal(std::vector& aEx childArgv.push_back(pidstring); -#if defined(MOZ_CRASHREPORTER) -# if defined(OS_LINUX) || defined(OS_BSD) - int childCrashFd, childCrashRemapFd; - if (!CrashReporter::CreateNotificationPipeForChild( - &childCrashFd, &childCrashRemapFd)) - return false; - if (0 <= childCrashFd) { - mFileMap.push_back(std::pair(childCrashFd, childCrashRemapFd)); - // "true" == crash reporting enabled - childArgv.push_back("true"); - } - else { - // "false" == crash reporting disabled - childArgv.push_back("false"); - } -# elif defined(MOZ_WIDGET_COCOA) - childArgv.push_back(CrashReporter::GetChildNotificationPipe()); -# endif // OS_LINUX -#endif - #ifdef MOZ_WIDGET_COCOA // Add a mach port to the command line so the child can communicate its // 'task_t' back to the parent. @@ -870,11 +845,6 @@ GoannaChildProcessHost::PerformAsyncLaunchInternal(std::vector& aEx // Process id cmdLine.AppendLooseValue(UTF8ToWide(pidstring)); -#if defined(MOZ_CRASHREPORTER) - cmdLine.AppendLooseValue( - UTF8ToWide(CrashReporter::GetChildNotificationPipe())); -#endif - // Process type cmdLine.AppendLooseValue(UTF8ToWide(childProcessType)); diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index b0276b011d..2a4305c0c8 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -49,10 +49,6 @@ #include "nsIXULRuntime.h" #include "nsJSPrincipals.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif - using namespace mozilla; using namespace xpc; using namespace JS; @@ -770,11 +766,6 @@ XPCJSRuntime::GCSliceCallback(JSRuntime* rt, if (!self) return; -#ifdef MOZ_CRASHREPORTER - CrashReporter::SetGarbageCollecting(progress == JS::GC_CYCLE_BEGIN || - progress == JS::GC_SLICE_BEGIN); -#endif - if (self->mPrevGCSliceCallback) (*self->mPrevGCSliceCallback)(rt, progress, desc); } diff --git a/js/xpconnect/src/XPCShellImpl.cpp b/js/xpconnect/src/XPCShellImpl.cpp index cbc2607b35..9e8209e45e 100644 --- a/js/xpconnect/src/XPCShellImpl.cpp +++ b/js/xpconnect/src/XPCShellImpl.cpp @@ -52,11 +52,6 @@ #include /* for isatty() */ #endif -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#include "nsICrashReporter.h" -#endif - using namespace mozilla; using namespace JS; @@ -1348,18 +1343,6 @@ XRE_XPCShellMain(int argc, char** argv, char** envp) argv += 2; } -#ifdef MOZ_CRASHREPORTER - const char* val = getenv("MOZ_CRASHREPORTER"); - if (val && *val) { - rv = CrashReporter::SetExceptionHandler(greDir, true); - if (NS_FAILED(rv)) { - printf("CrashReporter::SetExceptionHandler failed!\n"); - return 1; - } - MOZ_ASSERT(CrashReporter::GetEnabled()); - } -#endif - { if (argc > 1 && !strcmp(argv[1], "--greomni")) { nsCOMPtr greOmni; @@ -1550,12 +1533,6 @@ XRE_XPCShellMain(int argc, char** argv, char** envp) dirprovider.ClearPluginDir(); dirprovider.ClearAppFile(); -#ifdef MOZ_CRASHREPORTER - // Shut down the crashreporter service to prevent leaking some strings it holds. - if (CrashReporter::GetEnabled()) - CrashReporter::UnsetExceptionHandler(); -#endif - NS_LogTerm(); return result; diff --git a/media/mtransport/test/mtransport_test_utils.h b/media/mtransport/test/mtransport_test_utils.h index 80c6253cc0..9e0b5cb0c0 100644 --- a/media/mtransport/test/mtransport_test_utils.h +++ b/media/mtransport/test/mtransport_test_utils.h @@ -25,9 +25,6 @@ #include "nsISocketTransportService.h" #include "nsDirectoryServiceUtils.h" #include "nsDirectoryServiceDefs.h" -#ifdef MOZ_CRASHREPORTER -#include "nsICrashReporter.h" -#endif #include "nsPISocketTransportService.h" #include "nsServiceManagerUtils.h" #include "TestHarness.h" @@ -53,27 +50,6 @@ class MtransportTestUtils { sts_ = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv); MOZ_ASSERT(NS_SUCCEEDED(rv)); -#ifdef MOZ_CRASHREPORTER - char *crashreporter = PR_GetEnv("MOZ_CRASHREPORTER"); - if (crashreporter && !strcmp(crashreporter, "1")) { - //TODO: move this to an even-more-common location to use in all - // C++ unittests - crashreporter_ = do_GetService("@mozilla.org/toolkit/crash-reporter;1"); - if (crashreporter_) { - std::cerr << "Setting up crash reporting" << std::endl; - - nsCOMPtr dirsvc = - do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID); - nsCOMPtr cwd; - rv = dirsvc->Get(NS_OS_CURRENT_WORKING_DIR, - NS_GET_IID(nsIFile), - getter_AddRefs(cwd)); - MOZ_ASSERT(NS_SUCCEEDED(rv)); - crashreporter_->SetEnabled(true); - crashreporter_->SetMinidumpPath(cwd); - } - } -#endif } nsCOMPtr sts_target() { return sts_target_; } @@ -83,9 +59,6 @@ class MtransportTestUtils { nsCOMPtr ioservice_; nsCOMPtr sts_target_; nsCOMPtr sts_; -#ifdef MOZ_CRASHREPORTER - nsCOMPtr crashreporter_; -#endif }; diff --git a/mobile/android/base/AndroidManifest.xml.in b/mobile/android/base/AndroidManifest.xml.in index adda8cbf7a..e322ee91d2 100644 --- a/mobile/android/base/AndroidManifest.xml.in +++ b/mobile/android/base/AndroidManifest.xml.in @@ -350,20 +350,6 @@ #include ../search/manifests/SearchAndroidManifest_activities.xml.in #endif -#if MOZ_CRASHREPORTER - - - - - -#endif - cr = - do_GetService("@mozilla.org/toolkit/crash-reporter;1"); - if (cr) { - cr->AnnotateCrashReport(NS_LITERAL_CSTRING("bug836263-size"), - nsPrintfCString("%x", utf8String.Length())); - cr->RegisterAppMemory(uint64_t(utf8String.BeginReading()), - std::min(0x1000U, utf8String.Length())); - } -#endif NS_RUNTIMEABORT("bug836263"); } theString->SetData(wdata); diff --git a/security/sandbox/linux/glue/SandboxCrash.cpp b/security/sandbox/linux/glue/SandboxCrash.cpp index c35e35f733..a8513e21ef 100644 --- a/security/sandbox/linux/glue/SandboxCrash.cpp +++ b/security/sandbox/linux/glue/SandboxCrash.cpp @@ -18,9 +18,6 @@ #include "mozilla/unused.h" #include "mozilla/dom/Exceptions.h" #include "nsContentUtils.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif #include "nsStackWalk.h" #include "nsString.h" #include "nsThreadUtils.h" @@ -105,9 +102,6 @@ SandboxCrash(int nr, siginfo_t *info, void *void_context) pid_t pid = getpid(), tid = syscall(__NR_gettid); bool dumped = false; -#ifdef MOZ_CRASHREPORTER - dumped = CrashReporter::WriteMinidumpForSigInfo(nr, info, void_context); -#endif if (!dumped) { SANDBOX_LOG_ERROR("crash reporter is disabled (or failed);" " trying stack trace:"); diff --git a/services/healthreport/HealthReportComponents.manifest b/services/healthreport/HealthReportComponents.manifest index 56ed646cd9..8dc77890e2 100644 --- a/services/healthreport/HealthReportComponents.manifest +++ b/services/healthreport/HealthReportComponents.manifest @@ -1,9 +1,6 @@ # Register Firefox Health Report providers. category healthreport-js-provider-default AddonsProvider resource://gre/modules/HealthReport.jsm category healthreport-js-provider-default AppInfoProvider resource://gre/modules/HealthReport.jsm -#ifdef MOZ_CRASHREPORTER -category healthreport-js-provider-default CrashesProvider resource://gre/modules/HealthReport.jsm -#endif category healthreport-js-provider-default HealthReportProvider resource://gre/modules/HealthReport.jsm category healthreport-js-provider-default HotfixProvider resource://gre/modules/HealthReport.jsm category healthreport-js-provider-default PlacesProvider resource://gre/modules/HealthReport.jsm diff --git a/services/healthreport/providers.jsm b/services/healthreport/providers.jsm index 12a852ebb9..acd354badb 100644 --- a/services/healthreport/providers.jsm +++ b/services/healthreport/providers.jsm @@ -19,9 +19,6 @@ this.EXPORTED_SYMBOLS = [ "AddonsProvider", "AppInfoProvider", -#ifdef MOZ_CRASHREPORTER - "CrashesProvider", -#endif "HealthReportProvider", "HotfixProvider", "PlacesProvider", @@ -1046,201 +1043,6 @@ AddonsProvider.prototype = Object.freeze({ }, }); -#ifdef MOZ_CRASHREPORTER - -function DailyCrashesMeasurement1() { - Metrics.Measurement.call(this); -} - -DailyCrashesMeasurement1.prototype = Object.freeze({ - __proto__: Metrics.Measurement.prototype, - - name: "crashes", - version: 1, - - fields: { - pending: DAILY_COUNTER_FIELD, - submitted: DAILY_COUNTER_FIELD, - }, -}); - -function DailyCrashesMeasurement2() { - Metrics.Measurement.call(this); -} - -DailyCrashesMeasurement2.prototype = Object.freeze({ - __proto__: Metrics.Measurement.prototype, - - name: "crashes", - version: 2, - - fields: { - mainCrash: DAILY_LAST_NUMERIC_FIELD, - }, -}); - -function DailyCrashesMeasurement3() { - Metrics.Measurement.call(this); -} - -DailyCrashesMeasurement3.prototype = Object.freeze({ - __proto__: Metrics.Measurement.prototype, - - name: "crashes", - version: 3, - - fields: { - "main-crash": DAILY_LAST_NUMERIC_FIELD, - "main-hang": DAILY_LAST_NUMERIC_FIELD, - "content-crash": DAILY_LAST_NUMERIC_FIELD, - "content-hang": DAILY_LAST_NUMERIC_FIELD, - "plugin-crash": DAILY_LAST_NUMERIC_FIELD, - "plugin-hang": DAILY_LAST_NUMERIC_FIELD, - }, -}); - -function DailyCrashesMeasurement4() { - Metrics.Measurement.call(this); -} - -DailyCrashesMeasurement4.prototype = Object.freeze({ - __proto__: Metrics.Measurement.prototype, - - name: "crashes", - version: 4, - - fields: { - "main-crash": DAILY_LAST_NUMERIC_FIELD, - "main-crash-submission-succeeded": DAILY_LAST_NUMERIC_FIELD, - "main-crash-submission-failed": DAILY_LAST_NUMERIC_FIELD, - "main-hang": DAILY_LAST_NUMERIC_FIELD, - "main-hang-submission-succeeded": DAILY_LAST_NUMERIC_FIELD, - "main-hang-submission-failed": DAILY_LAST_NUMERIC_FIELD, - "content-crash": DAILY_LAST_NUMERIC_FIELD, - "content-crash-submission-succeeded": DAILY_LAST_NUMERIC_FIELD, - "content-crash-submission-failed": DAILY_LAST_NUMERIC_FIELD, - "content-hang": DAILY_LAST_NUMERIC_FIELD, - "content-hang-submission-succeeded": DAILY_LAST_NUMERIC_FIELD, - "content-hang-submission-failed": DAILY_LAST_NUMERIC_FIELD, - "plugin-crash": DAILY_LAST_NUMERIC_FIELD, - "plugin-crash-submission-succeeded": DAILY_LAST_NUMERIC_FIELD, - "plugin-crash-submission-failed": DAILY_LAST_NUMERIC_FIELD, - "plugin-hang": DAILY_LAST_NUMERIC_FIELD, - "plugin-hang-submission-succeeded": DAILY_LAST_NUMERIC_FIELD, - "plugin-hang-submission-failed": DAILY_LAST_NUMERIC_FIELD, - }, -}); - -function DailyCrashesMeasurement5() { - Metrics.Measurement.call(this); -} - -DailyCrashesMeasurement5.prototype = Object.freeze({ - __proto__: Metrics.Measurement.prototype, - - name: "crashes", - version: 5, - - fields: { - "main-crash": DAILY_LAST_NUMERIC_FIELD, - "main-crash-submission-succeeded": DAILY_LAST_NUMERIC_FIELD, - "main-crash-submission-failed": DAILY_LAST_NUMERIC_FIELD, - "main-hang": DAILY_LAST_NUMERIC_FIELD, - "main-hang-submission-succeeded": DAILY_LAST_NUMERIC_FIELD, - "main-hang-submission-failed": DAILY_LAST_NUMERIC_FIELD, - "content-crash": DAILY_LAST_NUMERIC_FIELD, - "content-crash-submission-succeeded": DAILY_LAST_NUMERIC_FIELD, - "content-crash-submission-failed": DAILY_LAST_NUMERIC_FIELD, - "content-hang": DAILY_LAST_NUMERIC_FIELD, - "content-hang-submission-succeeded": DAILY_LAST_NUMERIC_FIELD, - "content-hang-submission-failed": DAILY_LAST_NUMERIC_FIELD, - "plugin-crash": DAILY_LAST_NUMERIC_FIELD, - "plugin-crash-submission-succeeded": DAILY_LAST_NUMERIC_FIELD, - "plugin-crash-submission-failed": DAILY_LAST_NUMERIC_FIELD, - "plugin-hang": DAILY_LAST_NUMERIC_FIELD, - "plugin-hang-submission-succeeded": DAILY_LAST_NUMERIC_FIELD, - "plugin-hang-submission-failed": DAILY_LAST_NUMERIC_FIELD, - "gmplugin-crash": DAILY_LAST_NUMERIC_FIELD, - "gmplugin-crash-submission-succeeded": DAILY_LAST_NUMERIC_FIELD, - "gmplugin-crash-submission-failed": DAILY_LAST_NUMERIC_FIELD, - }, -}); - -this.CrashesProvider = function () { - Metrics.Provider.call(this); - - // So we can unit test. - this._manager = Services.crashmanager; -}; - -CrashesProvider.prototype = Object.freeze({ - __proto__: Metrics.Provider.prototype, - - name: "org.mozilla.crashes", - - measurementTypes: [ - DailyCrashesMeasurement1, - DailyCrashesMeasurement2, - DailyCrashesMeasurement3, - DailyCrashesMeasurement4, - DailyCrashesMeasurement5, - ], - - pullOnly: true, - - collectDailyData: function () { - return this.storage.enqueueTransaction(this._populateCrashCounts.bind(this)); - }, - - _populateCrashCounts: function () { - this._log.info("Grabbing crash counts from crash manager."); - let crashCounts = yield this._manager.getCrashCountsByDay(); - - // TODO: CrashManager no longer stores submissions as crashes, but we still - // want to send the submission data to FHR. As a temporary workaround, we - // populate |crashCounts| with the submission data to match past behaviour. - // See bug 1056160. - let crashes = yield this._manager.getCrashes(); - for (let crash of crashes) { - for (let [submissionID, submission] of crash.submissions) { - if (!submission.responseDate) { - continue; - } - - let day = Metrics.dateToDays(submission.responseDate); - if (!crashCounts.has(day)) { - crashCounts.set(day, new Map()); - } - - let succeeded = - submission.result == this._manager.SUBMISSION_RESULT_OK; - let type = crash.type + "-submission-" + (succeeded ? "succeeded" : - "failed"); - - let count = (crashCounts.get(day).get(type) || 0) + 1; - crashCounts.get(day).set(type, count); - } - } - - let m = this.getMeasurement("crashes", 5); - let fields = DailyCrashesMeasurement5.prototype.fields; - - for (let [day, types] of crashCounts) { - let date = Metrics.daysToDate(day); - for (let [type, count] of types) { - if (!(type in fields)) { - this._log.warn("Unknown crash type encountered: " + type); - continue; - } - - yield m.setDailyLastNumeric(type, count, date); - } - } - }, -}); - -#endif - /** * Records data from update hotfixes. * diff --git a/testing/gtest/mozilla/GTestRunner.cpp b/testing/gtest/mozilla/GTestRunner.cpp index d53863e643..8774eb7ce7 100644 --- a/testing/gtest/mozilla/GTestRunner.cpp +++ b/testing/gtest/mozilla/GTestRunner.cpp @@ -6,9 +6,6 @@ #include "GTestRunner.h" #include "gtest/gtest.h" #include "mozilla/Attributes.h" -#ifdef MOZ_CRASHREPORTER -#include "nsICrashReporter.h" -#endif #include "testing/TestHarness.h" #include "prenv.h" @@ -84,29 +81,6 @@ int RunGTestFunc() ScopedXPCOM xpcom("GTest"); -#ifdef MOZ_CRASHREPORTER - nsCOMPtr crashreporter; - char *crashreporterStr = PR_GetEnv("MOZ_CRASHREPORTER"); - if (crashreporterStr && !strcmp(crashreporterStr, "1")) { - //TODO: move this to an even-more-common location to use in all - // C++ unittests - crashreporter = do_GetService("@mozilla.org/toolkit/crash-reporter;1"); - if (crashreporter) { - std::cerr << "Setting up crash reporting" << std::endl; - - nsCOMPtr dirsvc = - do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID); - nsCOMPtr cwd; - nsresult rv = dirsvc->Get(NS_OS_CURRENT_WORKING_DIR, - NS_GET_IID(nsIFile), - getter_AddRefs(cwd)); - MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv)); - crashreporter->SetEnabled(true); - crashreporter->SetMinidumpPath(cwd); - } - } -#endif - return RUN_ALL_TESTS(); } diff --git a/toolkit/components/moz.build b/toolkit/components/moz.build index bdc5e51be3..8307504901 100644 --- a/toolkit/components/moz.build +++ b/toolkit/components/moz.build @@ -57,9 +57,6 @@ DIRS += [ 'xulstore' ] -if CONFIG['MOZ_CRASHREPORTER']: - DIRS += ['crashes'] - if CONFIG['MOZ_SOCIAL']: DIRS += ['social'] diff --git a/toolkit/components/places/tests/cpp/places_test_harness_tail.h b/toolkit/components/places/tests/cpp/places_test_harness_tail.h index af97c2aa4d..fac0fc75eb 100644 --- a/toolkit/components/places/tests/cpp/places_test_harness_tail.h +++ b/toolkit/components/places/tests/cpp/places_test_harness_tail.h @@ -6,9 +6,6 @@ #include "nsWidgetsCID.h" #include "nsIComponentRegistrar.h" -#ifdef MOZ_CRASHREPORTER -#include "nsICrashReporter.h" -#endif #ifndef TEST_NAME #error "Must #define TEST_NAME before including places_test_harness_tail.h" @@ -94,32 +91,6 @@ main(int aArgc, return -1; } -#ifdef MOZ_CRASHREPORTER - char* enabled = PR_GetEnv("MOZ_CRASHREPORTER"); - if (enabled && !strcmp(enabled, "1")) { - // bug 787458: move this to an even-more-common location to use in all - // C++ unittests - nsCOMPtr crashreporter = - do_GetService("@mozilla.org/toolkit/crash-reporter;1"); - if (crashreporter) { - fprintf(stderr, "Setting up crash reporting\n"); - - nsCOMPtr dirsvc = - do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID); - if (!dirsvc) - NS_RUNTIMEABORT("Couldn't get directory service"); - nsCOMPtr cwd; - nsresult rv = dirsvc->Get(NS_OS_CURRENT_WORKING_DIR, - NS_GET_IID(nsIFile), - getter_AddRefs(cwd)); - if (NS_FAILED(rv)) - NS_RUNTIMEABORT("Couldn't get CWD"); - crashreporter->SetEnabled(true); - crashreporter->SetMinidumpPath(cwd); - } - } -#endif - nsRefPtr spinClose = new WaitForConnectionClosed(); // Tinderboxes are constantly on idle. Since idle tasks can interact with diff --git a/toolkit/components/terminator/nsTerminator.cpp b/toolkit/components/terminator/nsTerminator.cpp index 4291fb5cd0..552a3573e4 100644 --- a/toolkit/components/terminator/nsTerminator.cpp +++ b/toolkit/components/terminator/nsTerminator.cpp @@ -29,9 +29,6 @@ #include "nsIObserverService.h" #include "nsIPrefService.h" -#if defined(MOZ_CRASHREPORTER) -#include "nsExceptionHandler.h" -#endif #include "mozilla/ArrayUtils.h" #include "mozilla/Attributes.h" @@ -526,13 +523,6 @@ nsTerminator::UpdateTelemetry() void nsTerminator::UpdateCrashReport(const char* aTopic) { -#if defined(MOZ_CRASHREPORTER) - // In case of crash, we wish to know where in shutdown we are - nsAutoCString report(aTopic); - - unused << CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ShutdownProgress"), - report); -#endif // defined(MOZ_CRASH_REPORTER) } diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js index 01a06bfa80..f5fb31c1b1 100644 --- a/toolkit/content/aboutSupport.js +++ b/toolkit/content/aboutSupport.js @@ -49,73 +49,6 @@ let snapshotFormatters = { [data.numRemoteWindows, data.numTotalWindows, data.remoteAutoStart], 3); }, -#ifdef MOZ_CRASHREPORTER - crashes: function crashes(data) { - let strings = stringBundle(); - let daysRange = Troubleshoot.kMaxCrashAge / (24 * 60 * 60 * 1000); - $("crashes-title").textContent = - PluralForm.get(daysRange, strings.GetStringFromName("crashesTitle")) - .replace("#1", daysRange); - let reportURL; - try { - reportURL = Services.prefs.getCharPref("breakpad.reportURL"); - // Ignore any non http/https urls - if (!/^https?:/i.test(reportURL)) - reportURL = null; - } - catch (e) { } - if (!reportURL) { - $("crashes-noConfig").style.display = "block"; - $("crashes-noConfig").classList.remove("no-copy"); - return; - } - else { - $("crashes-allReports").style.display = "block"; - $("crashes-allReports").classList.remove("no-copy"); - } - - if (data.pending > 0) { - $("crashes-allReportsWithPending").textContent = - PluralForm.get(data.pending, strings.GetStringFromName("pendingReports")) - .replace("#1", data.pending); - } - - let dateNow = new Date(); - $.append($("crashes-tbody"), data.submitted.map(function (crash) { - let date = new Date(crash.date); - let timePassed = dateNow - date; - let formattedDate; - if (timePassed >= 24 * 60 * 60 * 1000) - { - let daysPassed = Math.round(timePassed / (24 * 60 * 60 * 1000)); - let daysPassedString = strings.GetStringFromName("crashesTimeDays"); - formattedDate = PluralForm.get(daysPassed, daysPassedString) - .replace("#1", daysPassed); - } - else if (timePassed >= 60 * 60 * 1000) - { - let hoursPassed = Math.round(timePassed / (60 * 60 * 1000)); - let hoursPassedString = strings.GetStringFromName("crashesTimeHours"); - formattedDate = PluralForm.get(hoursPassed, hoursPassedString) - .replace("#1", hoursPassed); - } - else - { - let minutesPassed = Math.max(Math.round(timePassed / (60 * 1000)), 1); - let minutesPassedString = strings.GetStringFromName("crashesTimeMinutes"); - formattedDate = PluralForm.get(minutesPassed, minutesPassedString) - .replace("#1", minutesPassed); - } - return $.new("tr", [ - $.new("td", [ - $.new("a", crash.id, null, {href : reportURL + crash.id}) - ]), - $.new("td", formattedDate) - ]); - })); - }, -#endif - extensions: function extensions(data) { $.append($("extensions-tbody"), data.map(function (extension) { return $.new("tr", [ diff --git a/toolkit/content/aboutSupport.xhtml b/toolkit/content/aboutSupport.xhtml index 609e1ebe98..b143b54057 100644 --- a/toolkit/content/aboutSupport.xhtml +++ b/toolkit/content/aboutSupport.xhtml @@ -199,33 +199,6 @@ -#ifdef MOZ_CRASHREPORTER - -

- &aboutSupport.crashes.title; -

- - - - - - - - - - -
- &aboutSupport.crashes.id; - - &aboutSupport.crashes.sendDate; -
- - - -#endif -

&aboutSupport.extensionsTitle; diff --git a/toolkit/content/browser-child.js b/toolkit/content/browser-child.js index 8f2f2b9c00..c7a2ce04e2 100644 --- a/toolkit/content/browser-child.js +++ b/toolkit/content/browser-child.js @@ -14,12 +14,6 @@ Cu.import("resource://gre/modules/Timer.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PageThumbUtils", "resource://gre/modules/PageThumbUtils.jsm"); -#ifdef MOZ_CRASHREPORTER -XPCOMUtils.defineLazyServiceGetter(this, "CrashReporter", - "@mozilla.org/xre/app-info;1", - "nsICrashReporter"); -#endif - let FocusSyncHandler = { init: function() { sendAsyncMessage("SetSyncHandler", {}, {handler: this}); @@ -245,10 +239,6 @@ let WebNavigation = { }, loadURI: function(uri, flags, referrer, referrerPolicy, baseURI) { -#ifdef MOZ_CRASHREPORTER - if (CrashReporter.enabled) - CrashReporter.annotateCrashReport("URL", uri); -#endif if (referrer) referrer = Services.io.newURI(referrer, null, null); if (baseURI) diff --git a/toolkit/crashreporter/google-breakpad/src/common/Makefile.in b/toolkit/crashreporter/google-breakpad/src/common/Makefile.in index 3e043e96ab..e094a3f0f1 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/Makefile.in +++ b/toolkit/crashreporter/google-breakpad/src/common/Makefile.in @@ -3,8 +3,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. ifneq (WINNT,$(OS_TARGET)) -ifdef MOZ_CRASHREPORTER -endif endif ifeq ($(OS_TARGET),Android) diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/moz.build b/toolkit/crashreporter/google-breakpad/src/common/dwarf/moz.build index 58f958beb2..75188d363a 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf/moz.build @@ -4,17 +4,5 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -if CONFIG['MOZ_CRASHREPORTER']: - HostLibrary('host_breakpad_dwarf_s') - HOST_SOURCES += [ - 'bytereader.cc', - 'dwarf2diehandler.cc', - 'dwarf2reader.cc', - 'functioninfo.cc', - ] - LOCAL_INCLUDES += [ - '../..', - ] - # need static lib FORCE_STATIC_LIB = True diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/moz.build b/toolkit/crashreporter/google-breakpad/src/common/linux/moz.build index 13446dd338..aed149aba5 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/linux/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/common/linux/moz.build @@ -22,18 +22,6 @@ if CONFIG['OS_TARGET'] != 'Android': 'http_upload.cc', ] -if CONFIG['MOZ_CRASHREPORTER']: - HostLibrary('host_breakpad_linux_common_s') - HOST_SOURCES += [ - 'dump_symbols.cc', - 'elf_symbols_to_module.cc', - 'elfutils.cc', - 'file_id.cc', - 'guid_creator.cc', - 'linux_libc_support.cc', - 'memory_mapped_file.cc', - ] - Library('breakpad_linux_common_s') FINAL_LIBRARY = 'xul' diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build b/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build index 7d2860b82d..02de07ec0a 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build @@ -15,16 +15,6 @@ UNIFIED_SOURCES += [ 'string_utilities.cc', ] -# This is a little weird, but we're building a host and a target lib here. -# The host lib is used for dump_syms, and the target lib for the -# crash reporter client. Therefore, we don't need all the srcs in both. -if CONFIG['MOZ_CRASHREPORTER']: - HOST_SOURCES += UNIFIED_SOURCES - HOST_SOURCES += [ - 'dump_syms.mm', - ] - HostLibrary('host_breakpad_mac_common_s') - SOURCES += [ 'HTTPMultipartUpload.m', 'MachIPC.mm', diff --git a/toolkit/crashreporter/google-breakpad/src/common/moz.build b/toolkit/crashreporter/google-breakpad/src/common/moz.build index be0a02cc57..6e25f1ab28 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/common/moz.build @@ -45,26 +45,6 @@ else: 'stabs_to_module.cc', ] -if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_CRASHREPORTER']: - HOST_SOURCES += [ 'convert_UTF.c' ] - HostLibrary('host_breakpad_common_s') - HOST_SOURCES += [ - 'arm_ex_reader.cc', - 'arm_ex_to_module.cc', - 'dwarf_cfi_to_module.cc', - 'dwarf_cu_to_module.cc', - 'dwarf_line_to_module.cc', - 'language.cc', - 'logging.cc', - 'md5.cc', - 'module.cc', - 'pathname_stripper.cc', - 'stabs_reader.cc', - 'stabs_to_module.cc', - 'string_conversion.cc', - 'unique_string.cc', - ] - if CONFIG['OS_ARCH'] == 'Darwin': UNIFIED_SOURCES += [ 'mac/dump_syms.mm', diff --git a/toolkit/crashreporter/moz.build b/toolkit/crashreporter/moz.build index 3334ba1d66..4165140ecc 100644 --- a/toolkit/crashreporter/moz.build +++ b/toolkit/crashreporter/moz.build @@ -13,9 +13,6 @@ if CONFIG['OS_ARCH'] == 'WINNT': 'breakpad-windows-libxul' ] - if CONFIG['MOZ_CRASHREPORTER_INJECTOR']: - DIRS += ['breakpad-windows-standalone'] - elif CONFIG['OS_ARCH'] == 'Darwin': DIRS += [ 'google-breakpad/src/common', @@ -50,13 +47,6 @@ elif CONFIG['OS_ARCH'] == 'SunOS': DIRS += ['client'] -if CONFIG['MOZ_CRASHREPORTER_INJECTOR']: - DIRS += ['injector'] - UNIFIED_SOURCES += [ - 'InjectCrashReporter.cpp', - 'LoadLibraryRemote.cpp', - ] - TEST_DIRS += ['test'] EXPORTS += [ diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp index c6516ccd28..7296dfd0a2 100644 --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -67,11 +67,6 @@ #error "Not yet implemented for this platform" #endif // defined(XP_WIN32) -#ifdef MOZ_CRASHREPORTER_INJECTOR -#include "InjectCrashReporter.h" -using mozilla::InjectCrashRunnable; -#endif - #include #include #include @@ -301,18 +296,12 @@ struct ChildProcessData : public nsUint32HashKey explicit ChildProcessData(KeyTypePointer aKey) : nsUint32HashKey(aKey) , sequence(0) -#ifdef MOZ_CRASHREPORTER_INJECTOR - , callback(nullptr) -#endif { } nsCOMPtr minidump; // Each crashing process is assigned an increasing sequence number to // indicate which process crashed first. uint32_t sequence; -#ifdef MOZ_CRASHREPORTER_INJECTOR - InjectorCrashCallback* callback; -#endif }; typedef nsTHashtable ChildMinidumpMap; @@ -320,21 +309,6 @@ static ChildMinidumpMap* pidToMinidump; static uint32_t crashSequence; static bool OOPInitialized(); -#ifdef MOZ_CRASHREPORTER_INJECTOR -static nsIThread* sInjectorThread; - -class ReportInjectedCrash : public nsRunnable -{ -public: - explicit ReportInjectedCrash(uint32_t pid) : mPID(pid) { } - - NS_IMETHOD Run(); - -private: - uint32_t mPID; -}; -#endif // MOZ_CRASHREPORTER_INJECTOR - // Crashreporter annotations that we don't send along in subprocess // reports static const char* kSubprocessBlacklist[] = { @@ -2658,23 +2632,13 @@ OnChildProcessDumpRequested(void* aContext, aClientInfo->pid(); #endif -#ifdef MOZ_CRASHREPORTER_INJECTOR - bool runCallback; -#endif { MutexAutoLock lock(*dumpMapLock); ChildProcessData* pd = pidToMinidump->PutEntry(pid); MOZ_ASSERT(!pd->minidump); pd->minidump = minidump; pd->sequence = ++crashSequence; -#ifdef MOZ_CRASHREPORTER_INJECTOR - runCallback = nullptr != pd->callback; -#endif } -#ifdef MOZ_CRASHREPORTER_INJECTOR - if (runCallback) - NS_DispatchToMainThread(new ReportInjectedCrash(pid)); -#endif } } @@ -2782,13 +2746,6 @@ OOPDeinit() return; } -#ifdef MOZ_CRASHREPORTER_INJECTOR - if (sInjectorThread) { - sInjectorThread->Shutdown(); - NS_RELEASE(sInjectorThread); - } -#endif - delete crashServer; crashServer = nullptr; @@ -2818,67 +2775,6 @@ GetChildNotificationPipe() } #endif -#ifdef MOZ_CRASHREPORTER_INJECTOR -void -InjectCrashReporterIntoProcess(DWORD processID, InjectorCrashCallback* cb) -{ - if (!GetEnabled()) - return; - - if (!OOPInitialized()) - OOPInit(); - - if (!sInjectorThread) { - if (NS_FAILED(NS_NewThread(&sInjectorThread))) - return; - } - - { - MutexAutoLock lock(*dumpMapLock); - ChildProcessData* pd = pidToMinidump->PutEntry(processID); - MOZ_ASSERT(!pd->minidump && !pd->callback); - pd->callback = cb; - } - - nsCOMPtr r = new InjectCrashRunnable(processID); - sInjectorThread->Dispatch(r, nsIEventTarget::DISPATCH_NORMAL); -} - -NS_IMETHODIMP -ReportInjectedCrash::Run() -{ - // Crash reporting may have been disabled after this method was dispatched - if (!OOPInitialized()) - return NS_OK; - - InjectorCrashCallback* cb; - { - MutexAutoLock lock(*dumpMapLock); - ChildProcessData* pd = pidToMinidump->GetEntry(mPID); - if (!pd || !pd->callback) - return NS_OK; - - MOZ_ASSERT(pd->minidump); - - cb = pd->callback; - } - - cb->OnCrash(mPID); - return NS_OK; -} - -void -UnregisterInjectorCallback(DWORD processID) -{ - if (!OOPInitialized()) - return; - - MutexAutoLock lock(*dumpMapLock); - pidToMinidump->RemoveEntry(processID); -} - -#endif // MOZ_CRASHREPORTER_INJECTOR - bool CheckForLastRunCrash() { diff --git a/toolkit/locales/Makefile.in b/toolkit/locales/Makefile.in index f5e4e553fd..e1299c0445 100644 --- a/toolkit/locales/Makefile.in +++ b/toolkit/locales/Makefile.in @@ -33,11 +33,5 @@ libs:: update.locale sed -e 's/%AB_CD%/$(AB_CD)/' $< > $(FINAL_TARGET)/update.locale endif -ifdef MOZ_CRASHREPORTER -libs:: crashreporter.ini -ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) - $(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/crashreporter.app/Contents/Resources -else $(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET) endif -endif diff --git a/toolkit/locales/l10n.mk b/toolkit/locales/l10n.mk index 1c907e5f3f..275b764cd6 100644 --- a/toolkit/locales/l10n.mk +++ b/toolkit/locales/l10n.mk @@ -119,14 +119,6 @@ ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) ifneq (en,$(AB)) mv $(STAGEDIST)/en.lproj $(STAGEDIST)/$(AB).lproj endif -ifdef MOZ_CRASHREPORTER -# On Mac OS X, the crashreporter.ini file needs to be moved from under the -# application bundle's Resources directory where all other l10n files are -# located to the crash reporter bundle's Resources directory. - mv $(STAGEDIST)/crashreporter.app/Contents/Resources/crashreporter.ini \ - $(STAGEDIST)/../MacOS/crashreporter.app/Contents/Resources/crashreporter.ini - $(RM) -rf $(STAGEDIST)/crashreporter.app -endif endif $(NSINSTALL) -D $(DIST)/l10n-stage/$(PKG_PATH) diff --git a/toolkit/modules/Services.jsm b/toolkit/modules/Services.jsm index b2d525d1ee..65437dc0fe 100644 --- a/toolkit/modules/Services.jsm +++ b/toolkit/modules/Services.jsm @@ -36,15 +36,6 @@ XPCOMUtils.defineLazyGetter(Services, "dirsvc", function () { .QueryInterface(Ci.nsIProperties); }); -#ifdef MOZ_CRASHREPORTER -XPCOMUtils.defineLazyGetter(Services, "crashmanager", () => { - let ns = {}; - Components.utils.import("resource://gre/modules/CrashManager.jsm", ns); - - return ns.CrashManager.Singleton; -}); -#endif - let initTable = [ #ifdef MOZ_WIDGET_ANDROID ["androidBridge", "@mozilla.org/android/bridge;1", "nsIAndroidBridge"], diff --git a/toolkit/modules/Troubleshoot.jsm b/toolkit/modules/Troubleshoot.jsm index 6acb0e7613..d56ca2bd48 100644 --- a/toolkit/modules/Troubleshoot.jsm +++ b/toolkit/modules/Troubleshoot.jsm @@ -11,10 +11,6 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; Cu.import("resource://gre/modules/AddonManager.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -#ifdef MOZ_CRASHREPORTER -Cu.import("resource://gre/modules/CrashReports.jsm"); -#endif - let Experiments; try { Experiments = Cu.import("resource:///modules/experiments/Experiments.jsm").Experiments; @@ -188,18 +184,6 @@ let dataProviders = { done(data); }, -#ifdef MOZ_CRASHREPORTER - crashes: function crashes(done) { - let reports = CrashReports.getReports(); - let now = new Date(); - let reportsNew = reports.filter(report => (now - report.date < Troubleshoot.kMaxCrashAge)); - let reportsSubmitted = reportsNew.filter(report => (!report.pending)); - let reportsPendingCount = reportsNew.length - reportsSubmitted.length; - let data = {submitted : reportsSubmitted, pending : reportsPendingCount}; - done(data); - }, -#endif - extensions: function extensions(done) { AddonManager.getAddonsByTypes(["extension"], function (extensions) { extensions.sort(function (a, b) { diff --git a/toolkit/moz.build b/toolkit/moz.build index 3784ce8f64..3534b91237 100644 --- a/toolkit/moz.build +++ b/toolkit/moz.build @@ -38,17 +38,3 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': DIRS += ['system/windowsproxy'] elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': DIRS += ['system/androidproxy'] - -if CONFIG['MOZ_CRASHREPORTER']: - DIRS += ['crashreporter'] -elif CONFIG['MOZ_ENABLE_PROFILER_SPS']: - # Profiler requires some crashreporter code, - # so build it even if crashreporter is disabled. - DIRS += [ - 'crashreporter/google-breakpad/src/common', - 'crashreporter/google-breakpad/src/processor', - ] - if CONFIG['OS_ARCH'] == 'Darwin': - DIRS += ['crashreporter/google-breakpad/src/common/mac'] - elif CONFIG['OS_ARCH'] == 'Linux': - DIRS += ['crashreporter/google-breakpad/src/common/linux'] diff --git a/toolkit/mozapps/installer/upload-files.mk b/toolkit/mozapps/installer/upload-files.mk index e10745db4c..e728ad53f8 100644 --- a/toolkit/mozapps/installer/upload-files.mk +++ b/toolkit/mozapps/installer/upload-files.mk @@ -736,11 +736,6 @@ UPLOAD_FILES= \ $(call QUOTED_WILDCARD,$(PKG_JSSHELL)) \ $(if $(UPLOAD_EXTRA_FILES), $(foreach f, $(UPLOAD_EXTRA_FILES), $(wildcard $(DIST)/$(f)))) -ifdef MOZ_CRASHREPORTER_UPLOAD_FULL_SYMBOLS -UPLOAD_FILES += \ - $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip) -endif - ifdef MOZ_CODE_COVERAGE UPLOAD_FILES += \ $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(CODE_COVERAGE_ARCHIVE_BASENAME).zip) diff --git a/toolkit/xre/nsAndroidStartup.cpp b/toolkit/xre/nsAndroidStartup.cpp index adf0fd6ca0..df97f33927 100644 --- a/toolkit/xre/nsAndroidStartup.cpp +++ b/toolkit/xre/nsAndroidStartup.cpp @@ -44,15 +44,6 @@ struct AutoAttachJavaThread { extern "C" NS_EXPORT void GoannaStart(void *data, const nsXREAppData *appData) { -#ifdef MOZ_CRASHREPORTER - const struct mapping_info *info = getLibraryMapping(); - while (info->name) { - CrashReporter::AddLibraryMapping(info->name, info->base, - info->len, info->offset); - info++; - } -#endif - AutoAttachJavaThread attacher; if (!attacher.attached) return; diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index e8317f8437..0e469542d2 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -179,14 +179,6 @@ #include "jprof.h" #endif -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#include "nsICrashReporter.h" -#define NS_CRASHREPORTER_CONTRACTID "@mozilla.org/toolkit/crash-reporter;1" -#include "nsIPrefService.h" -#include "nsIMemoryInfoDumper.h" -#endif - #include "base/command_line.h" #ifdef MOZ_ENABLE_TESTS #include "GTestRunner.h" @@ -621,10 +613,6 @@ class nsXULAppInfo : public nsIXULAppInfo, #endif #ifdef XP_WIN public nsIWinAppHelper, -#endif -#ifdef MOZ_CRASHREPORTER - public nsICrashReporter, - public nsIFinishDumpingCallback, #endif public nsIXULRuntime @@ -637,10 +625,6 @@ public: #ifdef NIGHTLY_BUILD NS_DECL_NSIOBSERVER #endif -#ifdef MOZ_CRASHREPORTER - NS_DECL_NSICRASHREPORTER - NS_DECL_NSIFINISHDUMPINGCALLBACK -#endif #ifdef XP_WIN NS_DECL_NSIWINAPPHELPER #endif @@ -654,10 +638,6 @@ NS_INTERFACE_MAP_BEGIN(nsXULAppInfo) #endif #ifdef XP_WIN NS_INTERFACE_MAP_ENTRY(nsIWinAppHelper) -#endif -#ifdef MOZ_CRASHREPORTER - NS_INTERFACE_MAP_ENTRY(nsICrashReporter) - NS_INTERFACE_MAP_ENTRY(nsIFinishDumpingCallback) #endif NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIXULAppInfo, gAppData || XRE_GetProcessType() == GoannaProcessType_Content) @@ -971,12 +951,7 @@ nsXULAppInfo::GetReplacedLockTime(PRTime *aReplacedLockTime) NS_IMETHODIMP nsXULAppInfo::GetLastRunCrashID(nsAString &aLastRunCrashID) { -#ifdef MOZ_CRASHREPORTER - CrashReporter::GetLastRunCrashID(aLastRunCrashID); - return NS_OK; -#else return NS_ERROR_NOT_IMPLEMENTED; -#endif } NS_IMETHODIMP @@ -1073,213 +1048,6 @@ nsXULAppInfo::GetUserCanElevate(bool *aUserCanElevate) } #endif -#ifdef MOZ_CRASHREPORTER -NS_IMETHODIMP -nsXULAppInfo::GetEnabled(bool *aEnabled) -{ - *aEnabled = CrashReporter::GetEnabled(); - return NS_OK; -} - -NS_IMETHODIMP -nsXULAppInfo::SetEnabled(bool aEnabled) -{ - if (aEnabled) { - if (CrashReporter::GetEnabled()) { - // no point in erroring for double-enabling - return NS_OK; - } - - nsCOMPtr greBinDir; - NS_GetSpecialDirectory(NS_GRE_BIN_DIR, getter_AddRefs(greBinDir)); - if (!greBinDir) { - return NS_ERROR_FAILURE; - } - - nsCOMPtr xreBinDirectory = do_QueryInterface(greBinDir); - if (!xreBinDirectory) { - return NS_ERROR_FAILURE; - } - - return CrashReporter::SetExceptionHandler(xreBinDirectory, true); - } - else { - if (!CrashReporter::GetEnabled()) { - // no point in erroring for double-disabling - return NS_OK; - } - - return CrashReporter::UnsetExceptionHandler(); - } -} - -NS_IMETHODIMP -nsXULAppInfo::GetServerURL(nsIURL** aServerURL) -{ - if (!CrashReporter::GetEnabled()) - return NS_ERROR_NOT_INITIALIZED; - - nsAutoCString data; - if (!CrashReporter::GetServerURL(data)) { - return NS_ERROR_FAILURE; - } - nsCOMPtr uri; - NS_NewURI(getter_AddRefs(uri), data); - if (!uri) - return NS_ERROR_FAILURE; - - nsCOMPtr url; - url = do_QueryInterface(uri); - NS_ADDREF(*aServerURL = url); - - return NS_OK; -} - -NS_IMETHODIMP -nsXULAppInfo::SetServerURL(nsIURL* aServerURL) -{ - bool schemeOk; - // only allow https or http URLs - nsresult rv = aServerURL->SchemeIs("https", &schemeOk); - NS_ENSURE_SUCCESS(rv, rv); - if (!schemeOk) { - rv = aServerURL->SchemeIs("http", &schemeOk); - NS_ENSURE_SUCCESS(rv, rv); - - if (!schemeOk) - return NS_ERROR_INVALID_ARG; - } - nsAutoCString spec; - rv = aServerURL->GetSpec(spec); - NS_ENSURE_SUCCESS(rv, rv); - - return CrashReporter::SetServerURL(spec); -} - -NS_IMETHODIMP -nsXULAppInfo::GetMinidumpPath(nsIFile** aMinidumpPath) -{ - if (!CrashReporter::GetEnabled()) - return NS_ERROR_NOT_INITIALIZED; - - nsAutoString path; - if (!CrashReporter::GetMinidumpPath(path)) - return NS_ERROR_FAILURE; - - nsresult rv = NS_NewLocalFile(path, false, aMinidumpPath); - NS_ENSURE_SUCCESS(rv, rv); - return NS_OK; -} - -NS_IMETHODIMP -nsXULAppInfo::SetMinidumpPath(nsIFile* aMinidumpPath) -{ - nsAutoString path; - nsresult rv = aMinidumpPath->GetPath(path); - NS_ENSURE_SUCCESS(rv, rv); - return CrashReporter::SetMinidumpPath(path); -} - -NS_IMETHODIMP -nsXULAppInfo::AnnotateCrashReport(const nsACString& key, - const nsACString& data) -{ - return CrashReporter::AnnotateCrashReport(key, data); -} - -NS_IMETHODIMP -nsXULAppInfo::AppendAppNotesToCrashReport(const nsACString& data) -{ - return CrashReporter::AppendAppNotesToCrashReport(data); -} - -NS_IMETHODIMP -nsXULAppInfo::RegisterAppMemory(uint64_t pointer, - uint64_t len) -{ - return CrashReporter::RegisterAppMemory((void *)pointer, len); -} - -NS_IMETHODIMP -nsXULAppInfo::WriteMinidumpForException(void* aExceptionInfo) -{ -#ifdef XP_WIN32 - return CrashReporter::WriteMinidumpForException(static_cast(aExceptionInfo)); -#else - return NS_ERROR_NOT_IMPLEMENTED; -#endif -} - -NS_IMETHODIMP -nsXULAppInfo::AppendObjCExceptionInfoToAppNotes(void* aException) -{ -#ifdef XP_MACOSX - return CrashReporter::AppendObjCExceptionInfoToAppNotes(aException); -#else - return NS_ERROR_NOT_IMPLEMENTED; -#endif -} - -NS_IMETHODIMP -nsXULAppInfo::GetSubmitReports(bool* aEnabled) -{ - return CrashReporter::GetSubmitReports(aEnabled); -} - -NS_IMETHODIMP -nsXULAppInfo::SetSubmitReports(bool aEnabled) -{ - return CrashReporter::SetSubmitReports(aEnabled); -} - -NS_IMETHODIMP -nsXULAppInfo::UpdateCrashEventsDir() -{ - CrashReporter::UpdateCrashEventsDir(); - return NS_OK; -} - -NS_IMETHODIMP -nsXULAppInfo::SaveMemoryReport() -{ - if (!CrashReporter::GetEnabled()) { - return NS_ERROR_NOT_INITIALIZED; - } - nsCOMPtr file; - nsresult rv = NS_GetSpecialDirectory(NS_APP_PROFILE_DIR_STARTUP, - getter_AddRefs(file)); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - file->AppendNative(NS_LITERAL_CSTRING("memory-report.json.gz")); - - nsString path; - file->GetPath(path); - - nsCOMPtr dumper = - do_GetService("@mozilla.org/memory-info-dumper;1"); - if (NS_WARN_IF(!dumper)) { - return NS_ERROR_UNEXPECTED; - } - - rv = dumper->DumpMemoryReportsToNamedFile(path, this, file, true /* anonymize */); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - return NS_OK; -} - -NS_IMETHODIMP -nsXULAppInfo::Callback(nsISupports* aData) -{ - nsCOMPtr file = do_QueryInterface(aData); - MOZ_ASSERT(file); - - CrashReporter::SetMemoryReportFile(file); - return NS_OK; -} -#endif - static const nsXULAppInfo kAppInfo; static nsresult AppInfoConstructor(nsISupports* aOuter, REFNSIID aIID, void **aResult) @@ -1384,9 +1152,6 @@ static const mozilla::Module::CIDEntry kXRECIDs[] = { static const mozilla::Module::ContractIDEntry kXREContracts[] = { { XULAPPINFO_SERVICE_CONTRACTID, &kAPPINFO_CID }, { XULRUNTIME_SERVICE_CONTRACTID, &kAPPINFO_CID }, -#ifdef MOZ_CRASHREPORTER - { NS_CRASHREPORTER_CONTRACTID, &kAPPINFO_CID }, -#endif { NS_PROFILESERVICE_CONTRACTID, &kProfileServiceCID }, { NS_NATIVEAPPSUPPORT_CONTRACTID, &kNativeAppSupportCID }, { nullptr } @@ -2760,32 +2525,6 @@ static void RestoreStateForAppInitiatedRestart() } } -#ifdef MOZ_CRASHREPORTER -// When we first initialize the crash reporter we don't have a profile, -// so we set the minidump path to $TEMP. Once we have a profile, -// we set it to $PROFILE/minidumps, creating the directory -// if needed. -static void MakeOrSetMinidumpPath(nsIFile* profD) -{ - nsCOMPtr dumpD; - profD->Clone(getter_AddRefs(dumpD)); - - if(dumpD) { - bool fileExists; - //XXX: do some more error checking here - dumpD->Append(NS_LITERAL_STRING("minidumps")); - dumpD->Exists(&fileExists); - if(!fileExists) { - dumpD->Create(nsIFile::DIRECTORY_TYPE, 0700); - } - - nsAutoString pathStr; - if(NS_SUCCEEDED(dumpD->GetPath(pathStr))) - CrashReporter::SetMinidumpPath(pathStr); - } -} -#endif - const nsXREAppData* gAppData = nullptr; #ifdef MOZ_WIDGET_GTK @@ -3209,81 +2948,6 @@ XREMain::XRE_mainInit(bool* aExitFlag) if (NS_FAILED(rv)) return 1; -#ifdef MOZ_CRASHREPORTER - if (EnvHasValue("MOZ_CRASHREPORTER")) { - mAppData->flags |= NS_XRE_ENABLE_CRASH_REPORTER; - } - - nsCOMPtr xreBinDirectory; - xreBinDirectory = mDirProvider.GetGREBinDir(); - - if ((mAppData->flags & NS_XRE_ENABLE_CRASH_REPORTER) && - NS_SUCCEEDED( - CrashReporter::SetExceptionHandler(xreBinDirectory))) { - nsCOMPtr file; - rv = mDirProvider.GetUserAppDataDirectory(getter_AddRefs(file)); - if (NS_SUCCEEDED(rv)) { - CrashReporter::SetUserAppDataDirectory(file); - } - if (mAppData->crashReporterURL) - CrashReporter::SetServerURL(nsDependentCString(mAppData->crashReporterURL)); - - // pass some basic info from the app data - if (mAppData->vendor) - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Vendor"), - nsDependentCString(mAppData->vendor)); - if (mAppData->name) - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProductName"), - nsDependentCString(mAppData->name)); - if (mAppData->ID) - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProductID"), - nsDependentCString(mAppData->ID)); - if (mAppData->version) - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Version"), - nsDependentCString(mAppData->version)); - if (mAppData->buildID) - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("BuildID"), - nsDependentCString(mAppData->buildID)); - - nsDependentCString releaseChannel(NS_STRINGIFY(MOZ_UPDATE_CHANNEL)); - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ReleaseChannel"), - releaseChannel); -#ifdef MOZ_LINKER - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("CrashAddressLikelyWrong"), - IsSignalHandlingBroken() ? NS_LITERAL_CSTRING("1") - : NS_LITERAL_CSTRING("0")); -#endif - CrashReporter::SetRestartArgs(gArgc, gArgv); - - // annotate other data (user id etc) - nsCOMPtr userAppDataDir; - if (NS_SUCCEEDED(mDirProvider.GetUserAppDataDirectory( - getter_AddRefs(userAppDataDir)))) { - CrashReporter::SetupExtraData(userAppDataDir, - nsDependentCString(mAppData->buildID)); - - // see if we have a crashreporter-override.ini in the application directory - nsCOMPtr overrideini; - bool exists; - if (NS_SUCCEEDED(mDirProvider.GetAppDir()->Clone(getter_AddRefs(overrideini))) && - NS_SUCCEEDED(overrideini->AppendNative(NS_LITERAL_CSTRING("crashreporter-override.ini"))) && - NS_SUCCEEDED(overrideini->Exists(&exists)) && - exists) { -#ifdef XP_WIN - nsAutoString overridePathW; - overrideini->GetPath(overridePathW); - NS_ConvertUTF16toUTF8 overridePath(overridePathW); -#else - nsAutoCString overridePath; - overrideini->GetNativePath(overridePath); -#endif - - SaveWordToEnv("MOZ_CRASHREPORTER_STRINGS_OVERRIDE", overridePath); - } - } - } -#endif - #ifdef XP_MACOSX if (EnvHasValue("MOZ_LAUNCHED_CHILD")) { // This is needed, on relaunch, to force the OS to use the "Cocoa Dock @@ -3425,88 +3089,6 @@ XREMain::XRE_mainInit(bool* aExitFlag) return 0; } -#ifdef MOZ_CRASHREPORTER -#ifdef XP_WIN -/** - * Uses WMI to read some manufacturer information that may be useful for - * diagnosing hardware-specific crashes. This function is best-effort; failures - * shouldn't burden the caller. COM must be initialized before calling. - */ -static void AnnotateSystemManufacturer() -{ - nsRefPtr locator; - - HRESULT hr = CoCreateInstance(CLSID_WbemLocator, nullptr, CLSCTX_INPROC_SERVER, - IID_IWbemLocator, getter_AddRefs(locator)); - - if (FAILED(hr)) { - return; - } - - nsRefPtr services; - - hr = locator->ConnectServer(_bstr_t(L"ROOT\\CIMV2"), nullptr, nullptr, nullptr, - 0, nullptr, nullptr, getter_AddRefs(services)); - - if (FAILED(hr)) { - return; - } - - hr = CoSetProxyBlanket(services, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, nullptr, - RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE, - nullptr, EOAC_NONE); - - if (FAILED(hr)) { - return; - } - - nsRefPtr enumerator; - - hr = services->ExecQuery(_bstr_t(L"WQL"), _bstr_t(L"SELECT * FROM Win32_BIOS"), - WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, - nullptr, getter_AddRefs(enumerator)); - - if (FAILED(hr) || !enumerator) { - return; - } - - nsRefPtr classObject; - ULONG results; - - hr = enumerator->Next(WBEM_INFINITE, 1, getter_AddRefs(classObject), &results); - - if (FAILED(hr) || results == 0) { - return; - } - - VARIANT value; - VariantInit(&value); - - hr = classObject->Get(L"Manufacturer", 0, &value, 0, 0); - - if (SUCCEEDED(hr) && V_VT(&value) == VT_BSTR) { - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("BIOS_Manufacturer"), - NS_ConvertUTF16toUTF8(V_BSTR(&value))); - } - - VariantClear(&value); -} - -static void PR_CALLBACK AnnotateSystemManufacturer_ThreadStart(void*) -{ - HRESULT hr = CoInitialize(nullptr); - - if (FAILED(hr)) { - return; - } - - AnnotateSystemManufacturer(); - - CoUninitialize(); -} -#endif -#endif - namespace mozilla { ShutdownChecksMode gShutdownChecks = SCM_NOTHING; } @@ -3877,13 +3459,6 @@ XREMain::XRE_mainStartup(bool* aExitFlag) mozilla::Telemetry::SetProfileDir(mProfD); -#ifdef MOZ_CRASHREPORTER - if (mAppData->flags & NS_XRE_ENABLE_CRASH_REPORTER) - MakeOrSetMinidumpPath(mProfD); - - CrashReporter::SetProfileDirectory(mProfD); -#endif - nsAutoCString version; BuildVersion(version); @@ -4010,35 +3585,6 @@ XREMain::XRE_mainRun() rv = mScopedXPCOM->SetWindowCreator(mNativeApp); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); -#ifdef MOZ_CRASHREPORTER - // tell the crash reporter to also send the release channel - nsCOMPtr prefs = do_GetService("@mozilla.org/preferences-service;1", &rv); - if (NS_SUCCEEDED(rv)) { - nsCOMPtr defaultPrefBranch; - rv = prefs->GetDefaultBranch(nullptr, getter_AddRefs(defaultPrefBranch)); - - if (NS_SUCCEEDED(rv)) { - nsXPIDLCString sval; - rv = defaultPrefBranch->GetCharPref("app.update.channel", getter_Copies(sval)); - if (NS_SUCCEEDED(rv)) { - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ReleaseChannel"), - sval); - } - } - } - // Needs to be set after xpcom initialization. - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("FramePoisonBase"), - nsPrintfCString("%.16llx", uint64_t(gMozillaPoisonBase))); - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("FramePoisonSize"), - nsPrintfCString("%lu", uint32_t(gMozillaPoisonSize))); - -#ifdef XP_WIN - PR_CreateThread(PR_USER_THREAD, AnnotateSystemManufacturer_ThreadStart, 0, - PR_PRIORITY_LOW, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0); -#endif - -#endif - if (mStartOffline) { nsCOMPtr io (do_GetService("@mozilla.org/network/io-service;1")); NS_ENSURE_TRUE(io, NS_ERROR_FAILURE); @@ -4113,13 +3659,6 @@ XREMain::XRE_mainRun() mDirProvider.DoStartup(); -#ifdef MOZ_CRASHREPORTER - nsCString userAgentLocale; - if (NS_SUCCEEDED(Preferences::GetCString("general.useragent.locale", &userAgentLocale))) { - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("useragent_locale"), userAgentLocale); - } -#endif - appStartup->GetShuttingDown(&mShuttingDown); nsCOMPtr cmdLine; @@ -4389,10 +3928,6 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData) rv = LaunchChild(mNativeApp, true); } -#ifdef MOZ_CRASHREPORTER - if (mAppData->flags & NS_XRE_ENABLE_CRASH_REPORTER) - CrashReporter::UnsetExceptionHandler(); -#endif return rv == NS_ERROR_LAUNCHED_CHILD_PROCESS ? 0 : 1; } @@ -4402,11 +3937,6 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData) MOZ_gdk_display_close(mGdkDisplay); #endif -#ifdef MOZ_CRASHREPORTER - if (mAppData->flags & NS_XRE_ENABLE_CRASH_REPORTER) - CrashReporter::UnsetExceptionHandler(); -#endif - XRE_DeinitCommandLine(); return NS_FAILED(rv) ? 1 : 0; @@ -4459,11 +3989,6 @@ XRE_metroShutdown() xreMainPtr->mProfileLock->Unlock(); gProfileLock = nullptr; -#ifdef MOZ_CRASHREPORTER - if (xreMainPtr->mAppData->flags & NS_XRE_ENABLE_CRASH_REPORTER) - CrashReporter::UnsetExceptionHandler(); -#endif - XRE_DeinitCommandLine(); } diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp index af0dc8b842..048af4dff0 100644 --- a/toolkit/xre/nsEmbedFunctions.cpp +++ b/toolkit/xre/nsEmbedFunctions.cpp @@ -241,30 +241,6 @@ XRE_SetProcessType(const char* aProcessTypeString) } } -#if defined(MOZ_CRASHREPORTER) -// FIXME/bug 539522: this out-of-place function is stuck here because -// IPDL wants access to this crashreporter interface, and -// crashreporter is built in such a way to make that awkward -bool -XRE_TakeMinidumpForChild(uint32_t aChildPid, nsIFile** aDump, - uint32_t* aSequence) -{ - return CrashReporter::TakeMinidumpForChild(aChildPid, aDump, aSequence); -} - -bool -XRE_SetRemoteExceptionHandler(const char* aPipe/*= 0*/) -{ -#if defined(XP_WIN) || defined(XP_MACOSX) - return CrashReporter::SetRemoteExceptionHandler(nsDependentCString(aPipe)); -#elif defined(OS_LINUX) - return CrashReporter::SetRemoteExceptionHandler(); -#else -# error "OOP crash reporter unsupported on this platform" -#endif -} -#endif // if defined(MOZ_CRASHREPORTER) - #if defined(XP_WIN) void SetTaskbarGroupId(const nsString& aId) @@ -397,33 +373,6 @@ XRE_InitChildProcess(int aArgc, SetupErrorHandling(aArgv[0]); -#if defined(MOZ_CRASHREPORTER) - if (aArgc < 1) - return NS_ERROR_FAILURE; - const char* const crashReporterArg = aArgv[--aArgc]; - -# if defined(XP_WIN) || defined(XP_MACOSX) - // on windows and mac, |crashReporterArg| is the named pipe on which the - // server is listening for requests, or "-" if crash reporting is - // disabled. - if (0 != strcmp("-", crashReporterArg) && - !XRE_SetRemoteExceptionHandler(crashReporterArg)) { - // Bug 684322 will add better visibility into this condition - NS_WARNING("Could not setup crash reporting\n"); - } -# elif defined(OS_LINUX) - // on POSIX, |crashReporterArg| is "true" if crash reporting is - // enabled, false otherwise - if (0 != strcmp("false", crashReporterArg) && - !XRE_SetRemoteExceptionHandler(nullptr)) { - // Bug 684322 will add better visibility into this condition - NS_WARNING("Could not setup crash reporting\n"); - } -# else -# error "OOP crash reporting unsupported on this platform" -# endif -#endif // if defined(MOZ_CRASHREPORTER) - gArgv = aArgv; gArgc = aArgc; diff --git a/toolkit/xre/nsX11ErrorHandler.cpp b/toolkit/xre/nsX11ErrorHandler.cpp index 02107d1b9e..5e254d989e 100644 --- a/toolkit/xre/nsX11ErrorHandler.cpp +++ b/toolkit/xre/nsX11ErrorHandler.cpp @@ -117,18 +117,6 @@ X11Error(Display *display, XErrorEvent *event) { } } -#ifdef MOZ_CRASHREPORTER - switch (XRE_GetProcessType()) { - case GoannaProcessType_Default: - case GoannaProcessType_Plugin: - case GoannaProcessType_Content: - CrashReporter::AppendAppNotesToCrashReport(notes); - break; - default: - ; // crash report notes not supported. - } -#endif - #ifdef DEBUG // The resource id is unlikely to be useful in a crash report without // context of other ids, but add it to the debug console output. diff --git a/webapprt/content/webapp.js b/webapprt/content/webapp.js index 88310c4618..5955d2481f 100644 --- a/webapprt/content/webapp.js +++ b/webapprt/content/webapp.js @@ -14,12 +14,6 @@ Cu.import("resource://gre/modules/Task.jsm"); XPCOMUtils.defineLazyGetter(this, "gAppBrowser", function() document.getElementById("content")); -#ifdef MOZ_CRASHREPORTER -XPCOMUtils.defineLazyServiceGetter(this, "gCrashReporter", - "@mozilla.org/toolkit/crash-reporter;1", - "nsICrashReporter"); -#endif - function isSameOrigin(url) { let origin = Services.io.newURI(url, null, null).prePath; return (origin == WebappRT.config.app.origin); @@ -198,21 +192,6 @@ function updateEditUIVisibility() { } function updateCrashReportURL(aURI) { -#ifdef MOZ_CRASHREPORTER - if (!gCrashReporter.enabled) - return; - - let uri = aURI.clone(); - // uri.userPass throws on protocols without the concept of authentication, - // like about:, which tests can load, so we catch and ignore an exception. - try { - if (uri.userPass != "") { - uri.userPass = ""; - } - } catch (e) {} - - gCrashReporter.annotateCrashReport("URL", uri.spec); -#endif } // Context menu handling code. diff --git a/widget/GfxInfoBase.cpp b/widget/GfxInfoBase.cpp index 8af176a49f..553337fdea 100644 --- a/widget/GfxInfoBase.cpp +++ b/widget/GfxInfoBase.cpp @@ -31,10 +31,6 @@ #include "mozilla/gfx/2D.h" #include "mozilla/gfx/Logging.h" -#if defined(MOZ_CRASHREPORTER) -#include "nsExceptionHandler.h" -#endif - using namespace mozilla::widget; using namespace mozilla; using mozilla::MutexAutoLock; diff --git a/widget/GfxInfoX11.cpp b/widget/GfxInfoX11.cpp index 6bd14a2522..8cd6b6df84 100644 --- a/widget/GfxInfoX11.cpp +++ b/widget/GfxInfoX11.cpp @@ -15,11 +15,6 @@ #include "GfxInfoX11.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#include "nsICrashReporter.h" -#endif - namespace mozilla { namespace widget { @@ -176,9 +171,6 @@ GfxInfo::GetData() mAdapterDescription.Append(nsDependentCString(buf)); mAdapterDescription.Append('\n'); } -#ifdef MOZ_CRASHREPORTER - CrashReporter::AppendAppNotesToCrashReport(mAdapterDescription); -#endif return; } @@ -194,9 +186,6 @@ GfxInfo::GetData() if (mHasTextureFromPixmap) note.AppendLiteral(" -- texture_from_pixmap"); note.Append('\n'); -#ifdef MOZ_CRASHREPORTER - CrashReporter::AppendAppNotesToCrashReport(note); -#endif // determine the major OpenGL version. That's the first integer in the version string. mGLMajorVersion = strtol(mVersion.get(), 0, 10); diff --git a/widget/android/AndroidJNI.cpp b/widget/android/AndroidJNI.cpp index 4b90ab616d..2d00ff313e 100644 --- a/widget/android/AndroidJNI.cpp +++ b/widget/android/AndroidJNI.cpp @@ -24,11 +24,6 @@ #include "mozilla/Services.h" #include "nsThreadUtils.h" -#ifdef MOZ_CRASHREPORTER -#include "nsICrashReporter.h" -#include "nsExceptionHandler.h" -#endif - #include "mozilla/unused.h" #include "mozilla/UniquePtr.h" @@ -129,15 +124,6 @@ Java_org_mozilla_goanna_GoannaAppShell_onResume(JNIEnv *jenv, jclass jc) NS_EXPORT void JNICALL Java_org_mozilla_goanna_GoannaAppShell_reportJavaCrash(JNIEnv *jenv, jclass, jstring jStackTrace) { -#ifdef MOZ_CRASHREPORTER - const nsJNICString stackTrace(jStackTrace, jenv); - if (NS_WARN_IF(NS_FAILED(CrashReporter::AnnotateCrashReport( - NS_LITERAL_CSTRING("JavaStackTrace"), stackTrace)))) { - // Only crash below if crash reporter is initialized and annotation succeeded. - // Otherwise try other means of reporting the crash in Java. - return; - } -#endif // MOZ_CRASHREPORTER MOZ_CRASH("Uncaught Java exception"); } diff --git a/widget/android/GfxInfo.cpp b/widget/android/GfxInfo.cpp index 95bd0d409c..75cd9fb686 100644 --- a/widget/android/GfxInfo.cpp +++ b/widget/android/GfxInfo.cpp @@ -15,12 +15,6 @@ #include "nsIWindowWatcher.h" #include "nsServiceManagerUtils.h" -#if defined(MOZ_CRASHREPORTER) -#include "nsExceptionHandler.h" -#include "nsICrashReporter.h" -#define NS_CRASHREPORTER_CONTRACTID "@mozilla.org/toolkit/crash-reporter;1" -#endif - namespace mozilla { namespace widget { @@ -351,21 +345,6 @@ GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active) void GfxInfo::AddCrashReportAnnotations() { -#if defined(MOZ_CRASHREPORTER) - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterVendorID"), - mGLStrings->Vendor()); - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDeviceID"), - mGLStrings->Renderer()); - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDriverVersion"), - mGLStrings->Version()); - - /* Add an App Note for now so that we get the data immediately. These - * can go away after we store the above in the socorro db */ - nsAutoCString note; - note.AppendPrintf("AdapterDescription: '%s'\n", mAdapterDescription.get()); - - CrashReporter::AppendAppNotesToCrashReport(note); -#endif } const nsTArray& diff --git a/widget/cocoa/GfxInfo.mm b/widget/cocoa/GfxInfo.mm index caf1824cd8..f5e10bd47e 100644 --- a/widget/cocoa/GfxInfo.mm +++ b/widget/cocoa/GfxInfo.mm @@ -18,12 +18,6 @@ #import #import -#if defined(MOZ_CRASHREPORTER) -#include "nsExceptionHandler.h" -#include "nsICrashReporter.h" -#define NS_CRASHREPORTER_CONTRACTID "@mozilla.org/toolkit/crash-reporter;1" -#endif - using namespace mozilla; using namespace mozilla::widget; @@ -296,33 +290,6 @@ GfxInfo::GetCountryCode(nsAString & aCountryCode) void GfxInfo::AddCrashReportAnnotations() { -#if defined(MOZ_CRASHREPORTER) - nsString deviceID, vendorID, driverVersion; - nsAutoCString narrowDeviceID, narrowVendorID, narrowDriverVersion; - - GetAdapterDeviceID(deviceID); - CopyUTF16toUTF8(deviceID, narrowDeviceID); - GetAdapterVendorID(vendorID); - CopyUTF16toUTF8(vendorID, narrowVendorID); - GetAdapterDriverVersion(driverVersion); - CopyUTF16toUTF8(driverVersion, narrowDriverVersion); - - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterVendorID"), - narrowVendorID); - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDeviceID"), - narrowDeviceID); - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDriverVersion"), - narrowDriverVersion); - /* Add an App Note for now so that we get the data immediately. These - * can go away after we store the above in the socorro db */ - nsAutoCString note; - /* AppendPrintf only supports 32 character strings, mrghh. */ - note.Append("AdapterVendorID: "); - note.Append(narrowVendorID); - note.Append(", AdapterDeviceID: "); - note.Append(narrowDeviceID); - CrashReporter::AppendAppNotesToCrashReport(note); -#endif } // We don't support checking driver versions on Mac. diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 568ad4fab7..8a3fbc4d58 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -72,9 +72,6 @@ #include "nsAccessibilityService.h" #include "mozilla/a11y/Platform.h" #endif -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif #include "mozilla/Preferences.h" @@ -5374,31 +5371,14 @@ static int32_t RoundUp(double aDouble) #if !defined(RELEASE_BUILD) || defined(DEBUG) if (mGoannaChild && mTextInputHandler && mTextInputHandler->IsFocused()) { -#ifdef MOZ_CRASHREPORTER - NSWindow* window = [self window]; - NSString* info = [NSString stringWithFormat:@"\nview [%@], window [%@], key event [%@], window is key %i, is fullscreen %i, app is active %i", - self, window, theEvent, [window isKeyWindow], ([window styleMask] & (1 << 14)) != 0, - [NSApp isActive]]; - nsAutoCString additionalInfo([info UTF8String]); -#endif if (mGoannaChild->GetInputContext().IsPasswordEditor() && !TextInputHandler::IsSecureEventInputEnabled()) { #define CRASH_MESSAGE "A password editor has focus, but not in secure input mode" -#ifdef MOZ_CRASHREPORTER - CrashReporter::AppendAppNotesToCrashReport(NS_LITERAL_CSTRING("\nBug 893973: ") + - NS_LITERAL_CSTRING(CRASH_MESSAGE)); - CrashReporter::AppendAppNotesToCrashReport(additionalInfo); -#endif MOZ_CRASH(CRASH_MESSAGE); #undef CRASH_MESSAGE } else if (!mGoannaChild->GetInputContext().IsPasswordEditor() && TextInputHandler::IsSecureEventInputEnabled()) { #define CRASH_MESSAGE "A non-password editor has focus, but in secure input mode" -#ifdef MOZ_CRASHREPORTER - CrashReporter::AppendAppNotesToCrashReport(NS_LITERAL_CSTRING("\nBug 893973: ") + - NS_LITERAL_CSTRING(CRASH_MESSAGE)); - CrashReporter::AppendAppNotesToCrashReport(additionalInfo); -#endif MOZ_CRASH(CRASH_MESSAGE); #undef CRASH_MESSAGE } diff --git a/widget/nsBaseAppShell.cpp b/widget/nsBaseAppShell.cpp index b16a2e282e..245bbe8dd8 100644 --- a/widget/nsBaseAppShell.cpp +++ b/widget/nsBaseAppShell.cpp @@ -6,9 +6,6 @@ #include "base/message_loop.h" #include "nsBaseAppShell.h" -#if defined(MOZ_CRASHREPORTER) -#include "nsExceptionHandler.h" -#endif #include "nsThreadUtils.h" #include "nsIObserverService.h" #include "nsServiceManagerUtils.h" @@ -329,18 +326,12 @@ void nsBaseAppShell::IncrementEventloopNestingLevel() { ++mEventloopNestingLevel; -#if defined(MOZ_CRASHREPORTER) - CrashReporter::SetEventloopNestingLevel(mEventloopNestingLevel); -#endif } void nsBaseAppShell::DecrementEventloopNestingLevel() { --mEventloopNestingLevel; -#if defined(MOZ_CRASHREPORTER) - CrashReporter::SetEventloopNestingLevel(mEventloopNestingLevel); -#endif } void diff --git a/widget/windows/GfxInfo.cpp b/widget/windows/GfxInfo.cpp index f4b4fc7fef..ea5cdbdcc3 100644 --- a/widget/windows/GfxInfo.cpp +++ b/widget/windows/GfxInfo.cpp @@ -17,12 +17,6 @@ #include "mozilla/Preferences.h" #include "nsPrintfCString.h" -#if defined(MOZ_CRASHREPORTER) -#include "nsExceptionHandler.h" -#include "nsICrashReporter.h" -#define NS_CRASHREPORTER_CONTRACTID "@mozilla.org/toolkit/crash-reporter;1" -#endif - using namespace mozilla; using namespace mozilla::widget; @@ -702,23 +696,6 @@ GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active) return NS_OK; } -#if defined(MOZ_CRASHREPORTER) -/* Cisco's VPN software can cause corruption of the floating point state. - * Make a note of this in our crash reports so that some weird crashes - * make more sense */ -static void -CheckForCiscoVPN() { - LONG result; - HKEY key; - /* This will give false positives, but hopefully no false negatives */ - result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Cisco Systems\\VPN Client", 0, KEY_QUERY_VALUE, &key); - if (result == ERROR_SUCCESS) { - RegCloseKey(key); - CrashReporter::AppendAppNotesToCrashReport(NS_LITERAL_CSTRING("Cisco VPN\n")); - } -} -#endif - /* interface nsIGfxInfo2 */ /* readonly attribute DOMString countryCode; */ NS_IMETHODIMP @@ -731,82 +708,6 @@ GfxInfo::GetCountryCode(nsAString& aCountryCode) void GfxInfo::AddCrashReportAnnotations() { -#if defined(MOZ_CRASHREPORTER) - CheckForCiscoVPN(); - - if (mHasDriverVersionMismatch) { - CrashReporter::AppendAppNotesToCrashReport(NS_LITERAL_CSTRING("DriverVersionMismatch\n")); - } - - nsString deviceID, vendorID, driverVersion, subsysID; - nsCString narrowDeviceID, narrowVendorID, narrowDriverVersion, narrowSubsysID; - - GetAdapterDeviceID(deviceID); - CopyUTF16toUTF8(deviceID, narrowDeviceID); - GetAdapterVendorID(vendorID); - CopyUTF16toUTF8(vendorID, narrowVendorID); - GetAdapterDriverVersion(driverVersion); - CopyUTF16toUTF8(driverVersion, narrowDriverVersion); - GetAdapterSubsysID(subsysID); - CopyUTF16toUTF8(subsysID, narrowSubsysID); - - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterVendorID"), - narrowVendorID); - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDeviceID"), - narrowDeviceID); - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDriverVersion"), - narrowDriverVersion); - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterSubsysID"), - narrowSubsysID); - - /* Add an App Note for now so that we get the data immediately. These - * can go away after we store the above in the socorro db */ - nsAutoCString note; - /* AppendPrintf only supports 32 character strings, mrghh. */ - note.AppendLiteral("AdapterVendorID: "); - note.Append(narrowVendorID); - note.AppendLiteral(", AdapterDeviceID: "); - note.Append(narrowDeviceID); - note.AppendLiteral(", AdapterSubsysID: "); - note.Append(narrowSubsysID); - note.AppendLiteral(", AdapterDriverVersion: "); - note.Append(NS_LossyConvertUTF16toASCII(driverVersion)); - - if (vendorID == GfxDriverInfo::GetDeviceVendor(VendorAll)) { - /* if we didn't find a valid vendorID lets append the mDeviceID string to try to find out why */ - note.AppendLiteral(", "); - LossyAppendUTF16toASCII(mDeviceID, note); - note.AppendLiteral(", "); - LossyAppendUTF16toASCII(mDeviceKeyDebug, note); - LossyAppendUTF16toASCII(mDeviceKeyDebug, note); - } - note.Append("\n"); - - if (mHasDualGPU) { - nsString deviceID2, vendorID2, subsysID2; - nsAutoString adapterDriverVersionString2; - nsCString narrowDeviceID2, narrowVendorID2, narrowSubsysID2; - - note.AppendLiteral("Has dual GPUs. GPU #2: "); - GetAdapterDeviceID2(deviceID2); - CopyUTF16toUTF8(deviceID2, narrowDeviceID2); - GetAdapterVendorID2(vendorID2); - CopyUTF16toUTF8(vendorID2, narrowVendorID2); - GetAdapterDriverVersion2(adapterDriverVersionString2); - GetAdapterSubsysID(subsysID2); - CopyUTF16toUTF8(subsysID2, narrowSubsysID2); - note.AppendLiteral("AdapterVendorID2: "); - note.Append(narrowVendorID2); - note.AppendLiteral(", AdapterDeviceID2: "); - note.Append(narrowDeviceID2); - note.AppendLiteral(", AdapterSubsysID2: "); - note.Append(narrowSubsysID2); - note.AppendLiteral(", AdapterDriverVersion2: "); - note.Append(NS_LossyConvertUTF16toASCII(adapterDriverVersionString2)); - } - CrashReporter::AppendAppNotesToCrashReport(note); - -#endif } void diff --git a/widget/windows/KeyboardLayout.cpp b/widget/windows/KeyboardLayout.cpp index f3fc651472..c5f193b397 100644 --- a/widget/windows/KeyboardLayout.cpp +++ b/widget/windows/KeyboardLayout.cpp @@ -13,9 +13,6 @@ #include "mozilla/WindowsVersion.h" #include "nsAlgorithm.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif #include "nsGkAtoms.h" #include "nsIDOMKeyEvent.h" #include "nsIIdleServiceInternal.h" @@ -1708,61 +1705,6 @@ NativeKey::NeedsToHandleWithoutFollowingCharMessages() const return mIsPrintableKey; } -#ifdef MOZ_CRASHREPORTER - -static nsCString -GetResultOfInSendMessageEx() -{ - DWORD ret = ::InSendMessageEx(nullptr); - if (!ret) { - return NS_LITERAL_CSTRING("ISMEX_NOSEND"); - } - nsAutoCString result; - if (ret & ISMEX_CALLBACK) { - result = "ISMEX_CALLBACK"; - } - if (ret & ISMEX_NOTIFY) { - if (!result.IsEmpty()) { - result += " | "; - } - result += "ISMEX_NOTIFY"; - } - if (ret & ISMEX_REPLIED) { - if (!result.IsEmpty()) { - result += " | "; - } - result += "ISMEX_REPLIED"; - } - if (ret & ISMEX_SEND) { - if (!result.IsEmpty()) { - result += " | "; - } - result += "ISMEX_SEND"; - } - return result; -} - -static const char* -GetMessageName(UINT aMessage) -{ - switch (aMessage) { - case WM_KEYDOWN: return "WM_KEYDOWN"; - case WM_SYSKEYDOWN: return "WM_SYSKEYDOWN"; - case WM_KEYUP: return "WM_KEYUP"; - case WM_SYSKEYUP: return "WM_SYSKEYUP"; - case WM_CHAR: return "WM_CHAR"; - case WM_DEADCHAR: return "WM_DEADCHAR"; - case WM_SYSCHAR: return "WM_SYSCHAR"; - case WM_SYSDEADCHAR: return "WM_SYSDEADCHAR"; - case WM_UNICHAR: return "WM_UNICHAR"; - case WM_QUIT: return "WM_QUIT"; - case WM_NULL: return "WM_NULL"; - default: return "Unknown"; - } -} - -#endif // #ifdef MOZ_CRASHREPORTER - bool NativeKey::MayBeSameCharMessage(const MSG& aCharMsg1, const MSG& aCharMsg2) const @@ -1849,45 +1791,6 @@ NativeKey::GetFollowingCharMessage(MSG& aCharMsg) const } if (doCrash) { -#ifdef MOZ_CRASHREPORTER - nsPrintfCString info("\nPeekMessage() failed to remove char message! " - "\nHandling message: %s (0x%08X), wParam: 0x%08X, " - "lParam: 0x%08X, hwnd=0x%p, InSendMessageEx()=%s, \n" - "Found message: %s (0x%08X), wParam: 0x%08X, " - "lParam: 0x%08X, hwnd=0x%p, " - "\nWM_NULL has been removed: %d, " - "\nNext key message in all windows: %s (0x%08X), " - "wParam: 0x%08X, lParam: 0x%08X, hwnd=0x%p, " - "time=%d, ", - GetMessageName(mMsg.message), - mMsg.message, mMsg.wParam, mMsg.lParam, - nextKeyMsg.hwnd, - GetResultOfInSendMessageEx().get(), - GetMessageName(nextKeyMsg.message), - nextKeyMsg.message, nextKeyMsg.wParam, - nextKeyMsg.lParam, nextKeyMsg.hwnd, i, - GetMessageName(nextKeyMsgInAllWindows.message), - nextKeyMsgInAllWindows.message, - nextKeyMsgInAllWindows.wParam, - nextKeyMsgInAllWindows.lParam, - nextKeyMsgInAllWindows.hwnd, - nextKeyMsgInAllWindows.time); - CrashReporter::AppendAppNotesToCrashReport(info); - MSG nextMsg; - if (WinUtils::PeekMessage(&nextMsg, 0, 0, 0, - PM_NOREMOVE | PM_NOYIELD)) { - nsPrintfCString info("\nNext message in all windows: %s (0x%08X), " - "wParam: 0x%08X, lParam: 0x%08X, hwnd=0x%p, " - "time=%d", - GetMessageName(nextMsg.message), - nextMsg.message, nextMsg.wParam, nextMsg.lParam, - nextMsg.hwnd, nextMsg.time); - CrashReporter::AppendAppNotesToCrashReport(info); - } else { - CrashReporter::AppendAppNotesToCrashReport( - NS_LITERAL_CSTRING("\nThere is no message in any window")); - } -#endif // #ifdef MOZ_CRASHREPORTER MOZ_CRASH("We lost the following char message"); } @@ -1907,79 +1810,12 @@ NativeKey::GetFollowingCharMessage(MSG& aCharMsg) const // in lParam may be changed from 0 to something. The changed value // is different from the scan code of handling keydown message. if (!MayBeSameCharMessage(removedMsg, nextKeyMsg)) { -#ifdef MOZ_CRASHREPORTER - nsPrintfCString info("\nPeekMessage() removed unexpcted char message! " - "\nHandling message: %s (0x%08X), wParam: 0x%08X, " - "lParam: 0x%08X, hwnd=0x%p, InSendMessageEx()=%s, " - "\nFound message: %s (0x%08X), wParam: 0x%08X, " - "lParam: 0x%08X, hwnd=0x%p, " - "\nRemoved message: %s (0x%08X), wParam: 0x%08X, " - "lParam: 0x%08X, hwnd=0x%p, ", - GetMessageName(mMsg.message), - mMsg.message, mMsg.wParam, mMsg.lParam, mMsg.hwnd, - GetResultOfInSendMessageEx().get(), - GetMessageName(nextKeyMsg.message), - nextKeyMsg.message, nextKeyMsg.wParam, - nextKeyMsg.lParam, nextKeyMsg.hwnd, - GetMessageName(removedMsg.message), - removedMsg.message, removedMsg.wParam, - removedMsg.lParam, removedMsg.hwnd); - CrashReporter::AppendAppNotesToCrashReport(info); - // What's the next key message? - MSG nextKeyMsgAfter; - if (WinUtils::PeekMessage(&nextKeyMsgAfter, mMsg.hwnd, - WM_KEYFIRST, WM_KEYLAST, - PM_NOREMOVE | PM_NOYIELD)) { - nsPrintfCString info("\nNext key message after unexpected char message " - "removed: %s (0x%08X), wParam: 0x%08X, " - "lParam: 0x%08X, hwnd=0x%p, ", - GetMessageName(nextKeyMsgAfter.message), - nextKeyMsgAfter.message, nextKeyMsgAfter.wParam, - nextKeyMsgAfter.lParam, nextKeyMsgAfter.hwnd); - CrashReporter::AppendAppNotesToCrashReport(info); - } else { - CrashReporter::AppendAppNotesToCrashReport( - NS_LITERAL_CSTRING("\nThere is no key message after unexpected char " - "message removed, ")); - } - // Another window has a key message? - MSG nextKeyMsgInAllWindows; - if (WinUtils::PeekMessage(&nextKeyMsgInAllWindows, 0, - WM_KEYFIRST, WM_KEYLAST, - PM_NOREMOVE | PM_NOYIELD)) { - nsPrintfCString info("\nNext key message in all windows: %s (0x%08X), " - "wParam: 0x%08X, lParam: 0x%08X, hwnd=0x%p.", - GetMessageName(nextKeyMsgInAllWindows.message), - nextKeyMsgInAllWindows.message, - nextKeyMsgInAllWindows.wParam, - nextKeyMsgInAllWindows.lParam, - nextKeyMsgInAllWindows.hwnd); - CrashReporter::AppendAppNotesToCrashReport(info); - } else { - CrashReporter::AppendAppNotesToCrashReport( - NS_LITERAL_CSTRING("\nThere is no key message in any windows.")); - } -#endif // #ifdef MOZ_CRASHREPORTER MOZ_CRASH("PeekMessage() removed unexpected message"); } aCharMsg = removedMsg; return true; } -#ifdef MOZ_CRASHREPORTER - nsPrintfCString info("\nWe lost following char message! " - "\nHandling message: %s (0x%08X), wParam: 0x%08X, " - "lParam: 0x%08X, InSendMessageEx()=%s, \n" - "Found message: %s (0x%08X), wParam: 0x%08X, " - "lParam: 0x%08X, removed a lot of WM_NULL", - GetMessageName(mMsg.message), - mMsg.message, mMsg.wParam, mMsg.lParam, - GetResultOfInSendMessageEx().get(), - GetMessageName(nextKeyMsg.message), - nextKeyMsg.message, nextKeyMsg.wParam, - nextKeyMsg.lParam); - CrashReporter::AppendAppNotesToCrashReport(info); -#endif // #ifdef MOZ_CRASHREPORTER MOZ_CRASH("We lost the following char message"); return false; } @@ -2392,17 +2228,6 @@ KeyboardLayout::InitNativeKey(NativeKey& aNativeKey, int32_t activeDeadKeyIndex = GetKeyIndex(mActiveDeadKey); if (activeDeadKeyIndex < 0 || activeDeadKeyIndex >= NS_NUM_OF_KEYS) { -#if defined(DEBUG) || defined(MOZ_CRASHREPORTER) - nsPrintfCString warning("The virtual key index (%d) of mActiveDeadKey " - "(0x%02X) is not a printable key (virtualKey=" - "0x%02X)", - activeDeadKeyIndex, mActiveDeadKey, virtualKey); - NS_WARNING(warning.get()); -#ifdef MOZ_CRASHREPORTER - CrashReporter::AppendAppNotesToCrashReport( - NS_LITERAL_CSTRING("\n") + warning); -#endif // #ifdef MOZ_CRASHREPORTER -#endif // #if defined(DEBUG) || defined(MOZ_CRASHREPORTER) MOZ_CRASH("Trying to reference out of range of mVirtualKeys"); } UniCharsAndModifiers prevDeadChars = diff --git a/widget/windows/moz.build b/widget/windows/moz.build index 0257aa011b..23bfd41c4e 100644 --- a/widget/windows/moz.build +++ b/widget/windows/moz.build @@ -68,11 +68,6 @@ SOURCES += [ 'WinMouseScrollHandler.cpp', ] -if CONFIG['MOZ_CRASHREPORTER']: - UNIFIED_SOURCES += [ - 'LSPAnnotator.cpp', - ] - if CONFIG['NS_PRINTING']: UNIFIED_SOURCES += [ 'nsDeviceContextSpecWin.cpp', diff --git a/widget/windows/nsAppShell.cpp b/widget/windows/nsAppShell.cpp index cfc114012e..c09ff9ff58 100644 --- a/widget/windows/nsAppShell.cpp +++ b/widget/windows/nsAppShell.cpp @@ -128,9 +128,6 @@ nsAppShell::~nsAppShell() nsresult nsAppShell::Init() { -#ifdef MOZ_CRASHREPORTER - LSPAnnotate(); -#endif mLastNativeEventScheduled = TimeStamp::NowLoRes(); diff --git a/widget/windows/winrt/MetroWidget.cpp b/widget/windows/winrt/MetroWidget.cpp index 0a76d4cffe..8312d791db 100644 --- a/widget/windows/winrt/MetroWidget.cpp +++ b/widget/windows/winrt/MetroWidget.cpp @@ -29,9 +29,6 @@ #include "Windows.Graphics.Display.h" #include "DisplayInfo_sdk81.h" #include "nsNativeDragTarget.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif #include "UIABridgePrivate.h" #include "WinMouseScrollHandler.h" #include "InputData.h" @@ -1164,16 +1161,6 @@ MetroWidget::GetLayerManager(PLayerTransactionChild* aShadowManager, mLayerManager = new BasicLayerManager(this); mTempBasicLayerInUse = true; } else { -#ifdef MOZ_CRASHREPORTER - if (FAILED(hr)) { - char errorBuf[10]; - errorBuf[0] = '\0'; - _snprintf_s(errorBuf, sizeof(errorBuf), _TRUNCATE, "%X", hr); - CrashReporter:: - AnnotateCrashReport(NS_LITERAL_CSTRING("HRESULT"), - nsDependentCString(errorBuf)); - } -#endif NS_RUNTIMEABORT("Couldn't create layer manager"); } } diff --git a/xpcom/base/CycleCollectedJSRuntime.cpp b/xpcom/base/CycleCollectedJSRuntime.cpp index 133a22e294..e39adb01ab 100644 --- a/xpcom/base/CycleCollectedJSRuntime.cpp +++ b/xpcom/base/CycleCollectedJSRuntime.cpp @@ -69,10 +69,6 @@ #include "nsDOMJSUtils.h" #include "nsJSUtils.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif - #include "nsIException.h" #include "nsThreadUtils.h" #include "xpcpublic.h" @@ -1193,16 +1189,6 @@ CycleCollectedJSRuntime::AnnotateAndSetOutOfMemory(OOMState* aStatePtr, OOMState aNewState) { *aStatePtr = aNewState; -#ifdef MOZ_CRASHREPORTER - CrashReporter::AnnotateCrashReport(aStatePtr == &mOutOfMemoryState - ? NS_LITERAL_CSTRING("JSOutOfMemory") - : NS_LITERAL_CSTRING("JSLargeAllocationFailure"), - aNewState == OOMState::Reporting - ? NS_LITERAL_CSTRING("Reporting") - : aNewState == OOMState::Reported - ? NS_LITERAL_CSTRING("Reported") - : NS_LITERAL_CSTRING("Recovered")); -#endif } void @@ -1213,14 +1199,6 @@ CycleCollectedJSRuntime::OnGC(JSGCStatus aStatus) nsCycleCollector_prepareForGarbageCollection(); break; case JSGC_END: { -#ifdef MOZ_CRASHREPORTER - if (mOutOfMemoryState == OOMState::Reported) { - AnnotateAndSetOutOfMemory(&mOutOfMemoryState, OOMState::Recovered); - } - if (mLargeAllocationFailureState == OOMState::Reported) { - AnnotateAndSetOutOfMemory(&mLargeAllocationFailureState, OOMState::Recovered); - } -#endif // Do any deferred finalization of native objects. FinalizeDeferredThings(JS::WasIncrementalGC(mJSRuntime) ? FinalizeIncrementally : diff --git a/xpcom/base/nsCrashOnException.cpp b/xpcom/base/nsCrashOnException.cpp index 0f8042531f..06c48738f1 100644 --- a/xpcom/base/nsCrashOnException.cpp +++ b/xpcom/base/nsCrashOnException.cpp @@ -8,22 +8,11 @@ #include "nsCOMPtr.h" #include "nsServiceManagerUtils.h" -#ifdef MOZ_CRASHREPORTER -#include "nsICrashReporter.h" -#endif - namespace mozilla { static int ReportException(EXCEPTION_POINTERS* aExceptionInfo) { -#ifdef MOZ_CRASHREPORTER - nsCOMPtr cr = - do_GetService("@mozilla.org/toolkit/crash-reporter;1"); - if (cr) { - cr->WriteMinidumpForException(aExceptionInfo); - } -#endif return EXCEPTION_EXECUTE_HANDLER; } diff --git a/xpcom/base/nsDebugImpl.cpp b/xpcom/base/nsDebugImpl.cpp index c720a826c9..c15f8bceab 100644 --- a/xpcom/base/nsDebugImpl.cpp +++ b/xpcom/base/nsDebugImpl.cpp @@ -11,9 +11,6 @@ #include "nsDebugImpl.h" #include "nsDebug.h" -#ifdef MOZ_CRASHREPORTER -# include "nsExceptionHandler.h" -#endif #include "nsString.h" #include "nsXULAppAPI.h" #include "prprf.h" @@ -403,20 +400,6 @@ NS_DebugBreak(uint32_t aSeverity, const char* aStr, const char* aExpr, return; case NS_DEBUG_ABORT: { -#if defined(MOZ_CRASHREPORTER) - // Updating crash annotations in the child causes us to do IPC. This can - // really cause trouble if we're asserting from within IPC code. So we - // have to do without the annotations in that case. - if (XRE_GetProcessType() == GoannaProcessType_Default) { - nsCString note("xpcom_runtime_abort("); - note += buf.buffer; - note += ")"; - CrashReporter::AppendAppNotesToCrashReport(note); - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AbortMessage"), - nsDependentCString(buf.buffer)); - } -#endif // MOZ_CRASHREPORTER - #if defined(DEBUG) && defined(_WIN32) RealBreak(); #endif @@ -616,9 +599,6 @@ NS_ErrorAccordingToNSPR() void NS_ABORT_OOM(size_t aSize) { -#ifdef MOZ_CRASHREPORTER - CrashReporter::AnnotateOOMAllocationSize(aSize); -#endif MOZ_CRASH(); } diff --git a/xpcom/base/nsObjCExceptions.h b/xpcom/base/nsObjCExceptions.h index 89ac4e8060..86f7df91fa 100644 --- a/xpcom/base/nsObjCExceptions.h +++ b/xpcom/base/nsObjCExceptions.h @@ -17,12 +17,6 @@ #import #endif -#if defined(MOZ_CRASHREPORTER) && defined(__cplusplus) -#include "nsICrashReporter.h" -#include "nsCOMPtr.h" -#include "nsServiceManagerUtils.h" -#endif - #include #include #include "nsError.h" @@ -47,15 +41,6 @@ nsObjCExceptionLog(NSException* aException) NSLog(@"Mozilla has caught an Obj-C exception [%@: %@]", [aException name], [aException reason]); -#if defined(MOZ_CRASHREPORTER) && defined(__cplusplus) - // Attach exception info to the crash report. - nsCOMPtr crashReporter = - do_GetService("@mozilla.org/toolkit/crash-reporter;1"); - if (crashReporter) { - crashReporter->AppendObjCExceptionInfoToAppNotes(static_cast(aException)); - } -#endif - #ifdef DEBUG @try { // Try to get stack information out of the exception. 10.5 returns the stack diff --git a/xpcom/build/nsXULAppAPI.h b/xpcom/build/nsXULAppAPI.h index e96c156a12..0cc00becf0 100644 --- a/xpcom/build/nsXULAppAPI.h +++ b/xpcom/build/nsXULAppAPI.h @@ -382,17 +382,6 @@ XRE_API(const char*, XRE_API(void, XRE_SetProcessType, (const char* aProcessTypeString)) -#if defined(MOZ_CRASHREPORTER) -// Used in the "master" parent process hosting the crash server -XRE_API(bool, - XRE_TakeMinidumpForChild, (uint32_t aChildPid, nsIFile** aDump, - uint32_t* aSequence)) - -// Used in child processes. -XRE_API(bool, - XRE_SetRemoteExceptionHandler, (const char* aPipe)) -#endif - namespace mozilla { namespace gmp { class GMPLoader; diff --git a/xpcom/system/moz.build b/xpcom/system/moz.build index b330e41e66..615ff04fee 100644 --- a/xpcom/system/moz.build +++ b/xpcom/system/moz.build @@ -17,10 +17,5 @@ XPIDL_SOURCES += [ 'nsIXULRuntime.idl', ] -if CONFIG['MOZ_CRASHREPORTER']: - XPIDL_SOURCES += [ - 'nsICrashReporter.idl', - ] - XPIDL_MODULE = 'xpcom_system' diff --git a/xpcom/threads/HangMonitor.cpp b/xpcom/threads/HangMonitor.cpp index 6e87de2d78..87e1caa47b 100644 --- a/xpcom/threads/HangMonitor.cpp +++ b/xpcom/threads/HangMonitor.cpp @@ -21,10 +21,6 @@ #include "nsThreadUtils.h" #include "nsXULAppAPI.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif - #ifdef XP_WIN #include #endif @@ -113,11 +109,6 @@ Crash() } #endif -#ifdef MOZ_CRASHREPORTER - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Hang"), - NS_LITERAL_CSTRING("1")); -#endif - NS_RUNTIMEABORT("HangMonitor triggered"); } diff --git a/xpcom/threads/nsThread.cpp b/xpcom/threads/nsThread.cpp index 0c99929681..46434bd541 100644 --- a/xpcom/threads/nsThread.cpp +++ b/xpcom/threads/nsThread.cpp @@ -30,11 +30,6 @@ #include "mozilla/ChaosMode.h" #include "mozilla/ipc/BackgroundChild.h" -#ifdef MOZ_CRASHREPORTER -#include "nsServiceManagerUtils.h" -#include "nsICrashReporter.h" -#endif - #ifdef XP_LINUX #include #include @@ -399,34 +394,6 @@ nsThread::ThreadFunc(void* aArg) //----------------------------------------------------------------------------- -#ifdef MOZ_CRASHREPORTER -// Tell the crash reporter to save a memory report if our heuristics determine -// that an OOM failure is likely to occur soon. -static bool SaveMemoryReportNearOOM() -{ - bool needMemoryReport = false; - -#ifdef XP_WIN // XXX implement on other platforms as needed - const size_t LOWMEM_THRESHOLD_VIRTUAL = 200 * 1024 * 1024; - MEMORYSTATUSEX statex; - statex.dwLength = sizeof(statex); - if (GlobalMemoryStatusEx(&statex)) { - if (statex.ullAvailVirtual < LOWMEM_THRESHOLD_VIRTUAL) { - needMemoryReport = true; - } - } -#endif - - if (needMemoryReport) { - nsCOMPtr cr = - do_GetService("@mozilla.org/toolkit/crash-reporter;1"); - cr->SaveMemoryReport(); - } - - return needMemoryReport; -} -#endif - #ifdef MOZ_CANARY int sCanaryOutputFD = -1; #endif @@ -794,27 +761,6 @@ nsThread::ProcessNextEvent(bool aMayWait, bool* aResult) } } -#ifdef MOZ_CRASHREPORTER - if (MAIN_THREAD == mIsMainThread && !ShuttingDown()) { - // Keep an eye on memory usage (cheap, ~7ms) somewhat frequently, - // but save memory reports (expensive, ~75ms) less frequently. - const size_t LOW_MEMORY_CHECK_SECONDS = 30; - const size_t LOW_MEMORY_SAVE_SECONDS = 3 * 60; - - static TimeStamp nextCheck = TimeStamp::NowLoRes() - + TimeDuration::FromSeconds(LOW_MEMORY_CHECK_SECONDS); - - TimeStamp now = TimeStamp::NowLoRes(); - if (now >= nextCheck) { - if (SaveMemoryReportNearOOM()) { - nextCheck = now + TimeDuration::FromSeconds(LOW_MEMORY_SAVE_SECONDS); - } else { - nextCheck = now + TimeDuration::FromSeconds(LOW_MEMORY_CHECK_SECONDS); - } - } - } -#endif - bool notifyMainThreadObserver = (MAIN_THREAD == mIsMainThread) && sMainThreadObserver; if (notifyMainThreadObserver) {