Remove conditional crashreporter code

This commit is contained in:
trav90
2016-05-18 00:35:03 -05:00
committed by roytam1
parent f97216fc54
commit 903fddcff7
87 changed files with 0 additions and 2924 deletions
-31
View File
@@ -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,
@@ -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<nsCOMPtr<nsIContent> >;
sPluginTimers = new nsTArray<nsCOMPtr<nsITimer> >;
-10
View File
@@ -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");
}
-12
View File
@@ -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() {
-16
View File
@@ -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
-21
View File
@@ -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
-6
View File
@@ -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
-4
View File
@@ -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
-3
View File
@@ -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
-6
View File
@@ -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;
-3
View File
@@ -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 },
-19
View File
@@ -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<CrashReporterChild*>(ManagedPCrashReporterChild()[0]);
nsDependentCString reason(aReason);
crashReporter->SendAnnotateCrashReport(
NS_LITERAL_CSTRING("ipc_channel_error"),
reason);
}
#endif
NS_RUNTIMEABORT("Content child abort due to IPC error");
}
-75
View File
@@ -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<CrashReporterParent*>(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<CrashReporterParent*>(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
-141
View File
@@ -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<PCrashReporterParent> 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<long long>(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<nsIThread> 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<nsICrashService> 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
-103
View File
@@ -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<class Toplevel>
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<class Toplevel>
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<class Toplevel>
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<class Toplevel>
inline bool
CrashReporterParent::GeneratePairedMinidump(Toplevel* t)
{
CrashReporter::ProcessHandle child;
#ifdef XP_MACOSX
child = t->Process()->GetChildTask();
#else
child = t->OtherProcess();
#endif
nsCOMPtr<nsIFile> childDump;
if (CrashReporter::CreatePairedMinidumps(child,
mMainThread,
getter_AddRefs(childDump)) &&
CrashReporter::GetIDFromMinidump(childDump, mChildDumpID)) {
return true;
}
return false;
}
template<class Toplevel>
inline bool
CrashReporterParent::GenerateCrashReport(Toplevel* t,
const AnnotationTable* processNotes)
{
nsCOMPtr<nsIFile> crashDump;
if (t->TakeMinidump(getter_AddRefs(crashDump), nullptr) &&
CrashReporter::GetIDFromMinidump(crashDump, mChildDumpID)) {
return GenerateChildData(processNotes);
}
return false;
}
template<class Toplevel>
/* static */ bool
CrashReporterParent::CreateCrashReporter(Toplevel* actor)
{
#ifdef MOZ_CRASHREPORTER
NativeThreadId id;
uint32_t processType;
PCrashReporterParent* p =
actor->CallPCrashReporterConstructor(&id, &processType);
if (p) {
static_cast<CrashReporterParent*>(p)->SetChildData(id, processType);
} else {
NS_ERROR("Error creating crash reporter actor");
}
return !!p;
#endif
return false;
}
#endif
} // namespace dom
} // namespace mozilla
-7
View File
@@ -37,9 +37,6 @@
#include "nsDocShell.h"
#include "nsEmbedCID.h"
#include <algorithm>
#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<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
MOZ_ASSERT(swm);
swm->LoadRegistrations(aConfiguration.serviceWorkerRegistrations());
-8
View File
@@ -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
}
}
-4
View File
@@ -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;
-78
View File
@@ -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<CrashReporterParent*>(ManagedPCrashReporterParent()[0]);
}
if (NS_WARN_IF(!cr)) {
return;
}
AnnotationTable notes(4);
WriteExtraDataForMinidump(notes);
nsCOMPtr<nsIFile> 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, &notes);
}
static void
GMPNotifyObservers(const nsACString& aPluginId, const nsACString& aPluginName, const nsAString& aPluginDumpId)
{
nsCOMPtr<nsIObserverService> 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<gmp::GoannaMediaPluginService> 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;
-15
View File
@@ -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<GoannaMediaPluginService> 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;
-10
View File
@@ -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<nsNPAPIPluginInstance> instance = new nsNPAPIPluginInstance();
// This will create the owning reference. The connection must be made between the
-19
View File
@@ -25,9 +25,6 @@
#include "nsILocalFileMac.h"
#include "nsCocoaFeatures.h"
#if defined(MOZ_CRASHREPORTER)
#include "nsExceptionHandler.h"
#endif
#include <string.h>
#include <stdio.h>
@@ -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;
-3
View File
@@ -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
-4
View File
@@ -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;
}
-364
View File
@@ -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; i<mPluginCpuUsageOnHang.Length(); ++i) {
nsCString tempStr;
tempStr.AppendFloat(std::ceil(mPluginCpuUsageOnHang[i] * 100) / 100);
notes.Put(nsPrintfCString("CpuUsageFlashProcess%d", i), tempStr);
}
#endif
}
#endif
}
}
#endif // MOZ_CRASHREPORTER
void
PluginModuleParent::SetChildTimeout(const int32_t aChildTimeout)
{
@@ -878,27 +795,6 @@ PluginModuleChromeParent::AnnotateHang(mozilla::HangMonitor::HangAnnotations& aA
}
}
#ifdef MOZ_CRASHREPORTER_INJECTOR
static bool
CreateFlashMinidump(DWORD processId, ThreadId childThread,
nsIFile* parentMinidump, const nsACString& name)
{
if (processId == 0) {
return false;
}
base::ProcessHandle handle;
if (!base::OpenPrivilegedProcessHandle(processId, &handle)) {
return false;
}
bool res = CreateAdditionalChildMinidump(handle, 0, parentMinidump, name);
base::CloseProcessHandle(handle);
return res;
}
#endif
bool
PluginModuleChromeParent::ShouldContinueFromReplyTimeout()
{
@@ -942,65 +838,6 @@ PluginModuleContentParent::OnExitedSyncSend()
void
PluginModuleChromeParent::TerminateChildProcess(MessageLoop* aMsgLoop)
{
#ifdef MOZ_CRASHREPORTER
#ifdef XP_WIN
mozilla::MutexAutoLock lock(mCrashReporterMutex);
CrashReporterParent* crashReporter = mCrashReporter;
if (!crashReporter) {
// If mCrashReporter is null then the hang has ended, the plugin module
// is shutting down. There's nothing to do here.
return;
}
#else
CrashReporterParent* crashReporter = CrashReporter();
#endif
crashReporter->AnnotateCrashReport(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<nsIFile> pluginDumpFile;
if (GetMinidumpForID(mPluginDumpID, getter_AddRefs(pluginDumpFile)) &&
pluginDumpFile) {
nsCOMPtr<nsIFile> 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<CrashReporterParent*>(ManagedPCrashReporterParent()[0]);
}
#ifdef MOZ_CRASHREPORTER_INJECTOR
static void
RemoveMinidump(nsIFile* minidump)
{
if (!minidump)
return;
minidump->Remove(false);
nsCOMPtr<nsIFile> 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(&notes);
return;
}
uint32_t sequence = UINT32_MAX;
nsCOMPtr<nsIFile> dumpFile;
nsAutoCString flashProcessType;
TakeMinidump(getter_AddRefs(dumpFile), &sequence);
#ifdef MOZ_CRASHREPORTER_INJECTOR
nsCOMPtr<nsIFile> 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, &notes);
}
#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<PCrashReporterParent*>(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
-36
View File
@@ -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
-4
View File
@@ -5,10 +5,6 @@
#include "gfxCrashReporterUtils.h"
#if defined(MOZ_CRASHREPORTER)
#define MOZ_GFXFEATUREREPORTER 1
#endif
#ifdef MOZ_GFXFEATUREREPORTER
#include "gfxCrashReporterUtils.h"
#include <string.h> // for strcmp
-8
View File
@@ -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());
-16
View File
@@ -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;
}
-30
View File
@@ -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<std::string>& 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<int,int>(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<std::string>& aEx
// Process id
cmdLine.AppendLooseValue(UTF8ToWide(pidstring));
#if defined(MOZ_CRASHREPORTER)
cmdLine.AppendLooseValue(
UTF8ToWide(CrashReporter::GetChildNotificationPipe()));
#endif
// Process type
cmdLine.AppendLooseValue(UTF8ToWide(childProcessType));
-9
View File
@@ -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);
}
-23
View File
@@ -52,11 +52,6 @@
#include <unistd.h> /* 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<nsIFile> 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;
@@ -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<nsIProperties> dirsvc =
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID);
nsCOMPtr<nsIFile> 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<nsIEventTarget> sts_target() { return sts_target_; }
@@ -83,9 +59,6 @@ class MtransportTestUtils {
nsCOMPtr<nsIIOService> ioservice_;
nsCOMPtr<nsIEventTarget> sts_target_;
nsCOMPtr<nsPISocketTransportService> sts_;
#ifdef MOZ_CRASHREPORTER
nsCOMPtr<nsICrashReporter> crashreporter_;
#endif
};
@@ -350,20 +350,6 @@
#include ../search/manifests/SearchAndroidManifest_activities.xml.in
#endif
#if MOZ_CRASHREPORTER
<activity android:name="org.mozilla.goanna.CrashReporter"
android:process="@ANDROID_PACKAGE_NAME@.CrashReporter"
android:label="@string/crash_reporter_title"
android:icon="@drawable/crash_reporter"
android:theme="@style/Goanna"
android:exported="false"
android:excludeFromRecents="true">
<intent-filter>
<action android:name="org.mozilla.goanna.reportCrash" />
</intent-filter>
</activity>
#endif
<activity android:name="org.mozilla.goanna.preferences.GoannaPreferences"
android:theme="@style/Goanna.Preferences"
android:configChanges="orientation|screenSize|locale|layoutDirection"
-4
View File
@@ -191,11 +191,7 @@ public class AppConstants {
//#endif
public static final boolean MOZ_CRASHREPORTER =
//#if MOZ_CRASHREPORTER
true;
//#else
false;
//#endif
public static final boolean MOZ_DATA_REPORTING =
//#ifdef MOZ_DATA_REPORTING
-18
View File
@@ -532,10 +532,6 @@ gbjar.generated_sources = [] # Keep it this way.
gbjar.extra_jars += [
'constants.jar'
]
if CONFIG['MOZ_CRASHREPORTER']:
gbjar.sources += [ 'CrashReporter.java' ]
ANDROID_RES_DIRS += [ SRCDIR + '/crashreporter/res' ]
if CONFIG['MOZ_ANDROID_SHARE_OVERLAY']:
gbjar.sources += [
'overlays/OverlayConstants.java',
@@ -863,20 +859,6 @@ for d in ['app', 'chrome', 'components', 'locales', 'modules', 'themes']:
# having no resources, assets, or Java code).
main.included_projects += ['../' + omnijar.name]
if CONFIG['MOZ_CRASHREPORTER']:
crashreporter = add_android_eclipse_library_project('FennecResourcesCrashReporter')
crashreporter.package_name = 'org.mozilla.goanna.crashreporter'
crashreporter.res = SRCDIR + '/crashreporter/res'
crashreporter.recursive_make_targets += generated_recursive_make_targets
# layout/crash_reporter.xml references strings and other resources, and
# therefore depends on other resource projects.
crashreporter.included_projects += ['../' + static.name, '../' + generated.name]
crashreporter.referenced_projects += ['../' + static.name, '../' + generated.name]
resources.included_projects += ['../' + crashreporter.name]
resources.referenced_projects += ['../' + crashreporter.name]
if CONFIG['MOZ_ANDROID_MLS_STUMBLER']:
main.included_projects += ['../FennecStumbler']
main.referenced_projects += ['../FennecStumbler']
@@ -180,12 +180,6 @@ public class testSettingsMenuItems extends PixelTest {
settingsMap.get(PATH_CUSTOMIZE).add(autoUpdateUi);
}
// Crash reporter
if (AppConstants.MOZ_CRASHREPORTER) {
String[] crashReporterUi = { "Crash Reporter", StringHelper.BRAND_NAME + " submits crash reports to help Mozilla make your browser more stable and secure" };
settingsMap.get(PATH_MOZILLA).add(crashReporterUi);
}
// Telemetry
if (AppConstants.MOZ_TELEMETRY_REPORTING) {
String[] telemetryUi = { "Telemetry", "Shares performance, usage, hardware and customization data about your browser with Mozilla to help us make " + StringHelper.BRAND_NAME + " better" };
@@ -578,20 +578,6 @@ bin/libfreebl_32int64_3.so
@BINPATH@/updater@BIN_SUFFIX@
#endif
; [Crash Reporter]
;
#ifdef MOZ_CRASHREPORTER
@BINPATH@/components/CrashService.manifest
@BINPATH@/components/CrashService.js
@BINPATH@/crashreporter@BIN_SUFFIX@
@BINPATH@/crashreporter.crt
@BINPATH@/crashreporter.ini
#ifdef XP_UNIX
@BINPATH@/Throbber-small.gif
#endif
@BINPATH@/crashreporter-override.ini
#endif
[mobile]
@BINPATH@/chrome/icons/
@BINPATH@/chrome/chrome@JAREXT@
-14
View File
@@ -25,10 +25,6 @@
#include "prefapi_private_data.h"
#ifdef MOZ_CRASHREPORTER
#include "nsICrashReporter.h"
#endif
#include "nsIConsoleService.h"
#ifdef DEBUG
@@ -331,16 +327,6 @@ NS_IMETHODIMP nsPrefBranch::GetComplexValue(const char *aPrefName, const nsIID &
// some addons, see bug 836263.
nsAutoString wdata;
if (!AppendUTF8toUTF16(utf8String, wdata, mozilla::fallible)) {
#ifdef MOZ_CRASHREPORTER
nsCOMPtr<nsICrashReporter> 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);
@@ -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:");
@@ -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
-198
View File
@@ -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.
*
-26
View File
@@ -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<nsICrashReporter> 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<nsIProperties> dirsvc =
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID);
nsCOMPtr<nsIFile> 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();
}
-3
View File
@@ -57,9 +57,6 @@ DIRS += [
'xulstore'
]
if CONFIG['MOZ_CRASHREPORTER']:
DIRS += ['crashes']
if CONFIG['MOZ_SOCIAL']:
DIRS += ['social']
@@ -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<nsICrashReporter> crashreporter =
do_GetService("@mozilla.org/toolkit/crash-reporter;1");
if (crashreporter) {
fprintf(stderr, "Setting up crash reporting\n");
nsCOMPtr<nsIProperties> dirsvc =
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID);
if (!dirsvc)
NS_RUNTIMEABORT("Couldn't get directory service");
nsCOMPtr<nsIFile> 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<WaitForConnectionClosed> spinClose = new WaitForConnectionClosed();
// Tinderboxes are constantly on idle. Since idle tasks can interact with
@@ -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)
}
-67
View File
@@ -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", [
-27
View File
@@ -199,33 +199,6 @@
</table>
<!-- - - - - - - - - - - - - - - - - - - - - -->
#ifdef MOZ_CRASHREPORTER
<h2 class="major-section" id="crashes-title">
&aboutSupport.crashes.title;
</h2>
<table id="crashes-table">
<thead>
<tr>
<th>
&aboutSupport.crashes.id;
</th>
<th>
&aboutSupport.crashes.sendDate;
</th>
</tr>
</thead>
<tbody id="crashes-tbody">
</tbody>
</table>
<p id="crashes-allReports" class="hidden no-copy">
<a href="about:crashes" id="crashes-allReportsWithPending" class="block">&aboutSupport.crashes.allReports;</a>
</p>
<p id="crashes-noConfig" class="hidden no-copy">&aboutSupport.crashes.noConfig;</p>
#endif
<!-- - - - - - - - - - - - - - - - - - - - - -->
<h2 class="major-section">
&aboutSupport.extensionsTitle;
-10
View File
@@ -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)
@@ -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)
@@ -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
@@ -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'
@@ -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',
@@ -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',
-10
View File
@@ -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 += [
@@ -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 <stdlib.h>
#include <time.h>
#include <prenv.h>
@@ -301,18 +296,12 @@ struct ChildProcessData : public nsUint32HashKey
explicit ChildProcessData(KeyTypePointer aKey)
: nsUint32HashKey(aKey)
, sequence(0)
#ifdef MOZ_CRASHREPORTER_INJECTOR
, callback(nullptr)
#endif
{ }
nsCOMPtr<nsIFile> 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<ChildProcessData> 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<nsIRunnable> 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()
{
-6
View File
@@ -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
-8
View File
@@ -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)
-9
View File
@@ -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"],
-16
View File
@@ -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) {
-14
View File
@@ -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']
@@ -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)
-9
View File
@@ -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;
-475
View File
@@ -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<nsIFile> greBinDir;
NS_GetSpecialDirectory(NS_GRE_BIN_DIR, getter_AddRefs(greBinDir));
if (!greBinDir) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIFile> 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<nsIURI> uri;
NS_NewURI(getter_AddRefs(uri), data);
if (!uri)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIURL> 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<EXCEPTION_POINTERS*>(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<nsIFile> 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<nsIMemoryInfoDumper> 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<nsIFile> 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<nsIFile> 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<nsIFile> xreBinDirectory;
xreBinDirectory = mDirProvider.GetGREBinDir();
if ((mAppData->flags & NS_XRE_ENABLE_CRASH_REPORTER) &&
NS_SUCCEEDED(
CrashReporter::SetExceptionHandler(xreBinDirectory))) {
nsCOMPtr<nsIFile> 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<nsIFile> 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<nsIFile> 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<IWbemLocator> locator;
HRESULT hr = CoCreateInstance(CLSID_WbemLocator, nullptr, CLSCTX_INPROC_SERVER,
IID_IWbemLocator, getter_AddRefs(locator));
if (FAILED(hr)) {
return;
}
nsRefPtr<IWbemServices> 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<IEnumWbemClassObject> 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<IWbemClassObject> 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<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv);
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIPrefBranch> 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<nsIIOService2> 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<nsICommandLineRunner> 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();
}
-51
View File
@@ -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;
-12
View File
@@ -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.
-21
View File
@@ -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.
-4
View File
@@ -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;
-11
View File
@@ -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);
-14
View File
@@ -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");
}
-21
View File
@@ -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<GfxDriverInfo>&
-33
View File
@@ -18,12 +18,6 @@
#import <IOKit/IOKitLib.h>
#import <Cocoa/Cocoa.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;
@@ -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.
-20
View File
@@ -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
}
-9
View File
@@ -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
-99
View File
@@ -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
-175
View File
@@ -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 =
-5
View File
@@ -68,11 +68,6 @@ SOURCES += [
'WinMouseScrollHandler.cpp',
]
if CONFIG['MOZ_CRASHREPORTER']:
UNIFIED_SOURCES += [
'LSPAnnotator.cpp',
]
if CONFIG['NS_PRINTING']:
UNIFIED_SOURCES += [
'nsDeviceContextSpecWin.cpp',
-3
View File
@@ -128,9 +128,6 @@ nsAppShell::~nsAppShell()
nsresult
nsAppShell::Init()
{
#ifdef MOZ_CRASHREPORTER
LSPAnnotate();
#endif
mLastNativeEventScheduled = TimeStamp::NowLoRes();
-13
View File
@@ -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");
}
}
-22
View File
@@ -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 :
-11
View File
@@ -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<nsICrashReporter> cr =
do_GetService("@mozilla.org/toolkit/crash-reporter;1");
if (cr) {
cr->WriteMinidumpForException(aExceptionInfo);
}
#endif
return EXCEPTION_EXECUTE_HANDLER;
}
-20
View File
@@ -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();
}
-15
View File
@@ -17,12 +17,6 @@
#import <ExceptionHandling/NSExceptionHandler.h>
#endif
#if defined(MOZ_CRASHREPORTER) && defined(__cplusplus)
#include "nsICrashReporter.h"
#include "nsCOMPtr.h"
#include "nsServiceManagerUtils.h"
#endif
#include <unistd.h>
#include <signal.h>
#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<nsICrashReporter> crashReporter =
do_GetService("@mozilla.org/toolkit/crash-reporter;1");
if (crashReporter) {
crashReporter->AppendObjCExceptionInfoToAppNotes(static_cast<void*>(aException));
}
#endif
#ifdef DEBUG
@try {
// Try to get stack information out of the exception. 10.5 returns the stack
-11
View File
@@ -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;
-5
View File
@@ -17,10 +17,5 @@ XPIDL_SOURCES += [
'nsIXULRuntime.idl',
]
if CONFIG['MOZ_CRASHREPORTER']:
XPIDL_SOURCES += [
'nsICrashReporter.idl',
]
XPIDL_MODULE = 'xpcom_system'
-9
View File
@@ -21,10 +21,6 @@
#include "nsThreadUtils.h"
#include "nsXULAppAPI.h"
#ifdef MOZ_CRASHREPORTER
#include "nsExceptionHandler.h"
#endif
#ifdef XP_WIN
#include <windows.h>
#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");
}
-54
View File
@@ -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 <sys/time.h>
#include <sys/resource.h>
@@ -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<nsICrashReporter> 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) {