forked from mirrors/gecko-dev
Bug 1896650 - Remove sequence numbers from crash reports r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D210309
This commit is contained in:
parent
91d0d2bc81
commit
80f0c61cf5
5 changed files with 10 additions and 23 deletions
|
|
@ -25,7 +25,7 @@ CrashReporterHost::CrashReporterHost(GeckoProcessType aProcessType,
|
||||||
mFinalized(false) {}
|
mFinalized(false) {}
|
||||||
|
|
||||||
bool CrashReporterHost::GenerateCrashReport(base::ProcessId aPid) {
|
bool CrashReporterHost::GenerateCrashReport(base::ProcessId aPid) {
|
||||||
if (!TakeCrashedChildMinidump(aPid, nullptr)) {
|
if (!TakeCrashedChildMinidump(aPid)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -35,13 +35,13 @@ bool CrashReporterHost::GenerateCrashReport(base::ProcessId aPid) {
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<nsIFile> CrashReporterHost::TakeCrashedChildMinidump(
|
RefPtr<nsIFile> CrashReporterHost::TakeCrashedChildMinidump(
|
||||||
base::ProcessId aPid, uint32_t* aOutSequence) {
|
base::ProcessId aPid) {
|
||||||
CrashReporter::AnnotationTable annotations;
|
CrashReporter::AnnotationTable annotations;
|
||||||
MOZ_ASSERT(!HasMinidump());
|
MOZ_ASSERT(!HasMinidump());
|
||||||
|
|
||||||
RefPtr<nsIFile> crashDump;
|
RefPtr<nsIFile> crashDump;
|
||||||
if (!CrashReporter::TakeMinidumpForChild(aPid, getter_AddRefs(crashDump),
|
if (!CrashReporter::TakeMinidumpForChild(aPid, getter_AddRefs(crashDump),
|
||||||
annotations, aOutSequence)) {
|
annotations)) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
if (!AdoptMinidump(crashDump, annotations)) {
|
if (!AdoptMinidump(crashDump, annotations)) {
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,7 @@ class CrashReporterHost {
|
||||||
|
|
||||||
// Given an existing minidump for a crashed child process, take ownership of
|
// Given an existing minidump for a crashed child process, take ownership of
|
||||||
// it from IPDL. After this, FinalizeCrashReport may be called.
|
// it from IPDL. After this, FinalizeCrashReport may be called.
|
||||||
RefPtr<nsIFile> TakeCrashedChildMinidump(base::ProcessId aPid,
|
RefPtr<nsIFile> TakeCrashedChildMinidump(base::ProcessId aPid);
|
||||||
uint32_t* aOutSequence);
|
|
||||||
|
|
||||||
// Replace the stored minidump with a new one. After this,
|
// Replace the stored minidump with a new one. After this,
|
||||||
// FinalizeCrashReport may be called.
|
// FinalizeCrashReport may be called.
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,7 @@ bool CreateNotificationPipeForChild(int* childCrashFd, int* childCrashRemapFd) {
|
||||||
bool SetRemoteExceptionHandler(const char* aCrashPipe) { return false; }
|
bool SetRemoteExceptionHandler(const char* aCrashPipe) { return false; }
|
||||||
|
|
||||||
bool TakeMinidumpForChild(uint32_t childPid, nsIFile** dump,
|
bool TakeMinidumpForChild(uint32_t childPid, nsIFile** dump,
|
||||||
AnnotationTable& aAnnotations, uint32_t* aSequence) {
|
AnnotationTable& aAnnotations) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -288,18 +288,14 @@ static FileHandle gMagicChildCrashReportFd =
|
||||||
static Mutex* dumpMapLock;
|
static Mutex* dumpMapLock;
|
||||||
struct ChildProcessData : public nsUint32HashKey {
|
struct ChildProcessData : public nsUint32HashKey {
|
||||||
explicit ChildProcessData(KeyTypePointer aKey)
|
explicit ChildProcessData(KeyTypePointer aKey)
|
||||||
: nsUint32HashKey(aKey), sequence(0), annotations(nullptr) {}
|
: nsUint32HashKey(aKey), annotations(nullptr) {}
|
||||||
|
|
||||||
nsCOMPtr<nsIFile> minidump;
|
nsCOMPtr<nsIFile> minidump;
|
||||||
// Each crashing process is assigned an increasing sequence number to
|
|
||||||
// indicate which process crashed first.
|
|
||||||
uint32_t sequence;
|
|
||||||
UniquePtr<AnnotationTable> annotations;
|
UniquePtr<AnnotationTable> annotations;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef nsTHashtable<ChildProcessData> ChildMinidumpMap;
|
typedef nsTHashtable<ChildProcessData> ChildMinidumpMap;
|
||||||
static ChildMinidumpMap* pidToMinidump;
|
static ChildMinidumpMap* pidToMinidump;
|
||||||
static uint32_t crashSequence;
|
|
||||||
static bool OOPInitialized();
|
static bool OOPInitialized();
|
||||||
|
|
||||||
void RecordMainThreadId() {
|
void RecordMainThreadId() {
|
||||||
|
|
@ -3364,7 +3360,6 @@ static void OnChildProcessDumpRequested(
|
||||||
ChildProcessData* pd = pidToMinidump->PutEntry(pid);
|
ChildProcessData* pd = pidToMinidump->PutEntry(pid);
|
||||||
MOZ_ASSERT(!pd->minidump);
|
MOZ_ASSERT(!pd->minidump);
|
||||||
pd->minidump = minidump;
|
pd->minidump = minidump;
|
||||||
pd->sequence = ++crashSequence;
|
|
||||||
pd->annotations = MakeUnique<AnnotationTable>();
|
pd->annotations = MakeUnique<AnnotationTable>();
|
||||||
AnnotationTable& annotations = *(pd->annotations);
|
AnnotationTable& annotations = *(pd->annotations);
|
||||||
AddSharedAnnotations(annotations);
|
AddSharedAnnotations(annotations);
|
||||||
|
|
@ -3582,7 +3577,7 @@ void GetAnnotation(uint32_t childPid, Annotation annotation,
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TakeMinidumpForChild(uint32_t childPid, nsIFile** dump,
|
bool TakeMinidumpForChild(uint32_t childPid, nsIFile** dump,
|
||||||
AnnotationTable& aAnnotations, uint32_t* aSequence) {
|
AnnotationTable& aAnnotations) {
|
||||||
if (!GetEnabled()) return false;
|
if (!GetEnabled()) return false;
|
||||||
|
|
||||||
MutexAutoLock lock(*dumpMapLock);
|
MutexAutoLock lock(*dumpMapLock);
|
||||||
|
|
@ -3593,10 +3588,6 @@ bool TakeMinidumpForChild(uint32_t childPid, nsIFile** dump,
|
||||||
NS_IF_ADDREF(*dump = pd->minidump);
|
NS_IF_ADDREF(*dump = pd->minidump);
|
||||||
aAnnotations = *(pd->annotations);
|
aAnnotations = *(pd->annotations);
|
||||||
|
|
||||||
if (aSequence) {
|
|
||||||
*aSequence = pd->sequence;
|
|
||||||
}
|
|
||||||
|
|
||||||
pidToMinidump->RemoveEntry(pd);
|
pidToMinidump->RemoveEntry(pd);
|
||||||
|
|
||||||
return !!*dump;
|
return !!*dump;
|
||||||
|
|
@ -3637,7 +3628,7 @@ bool FinalizeOrphanedMinidump(uint32_t aChildPid, GeckoProcessType aType,
|
||||||
# pragma section("mozwerpt", read, executable, shared)
|
# pragma section("mozwerpt", read, executable, shared)
|
||||||
|
|
||||||
__declspec(allocate("mozwerpt")) MOZ_EXPORT DWORD WINAPI
|
__declspec(allocate("mozwerpt")) MOZ_EXPORT DWORD WINAPI
|
||||||
WerNotifyProc(LPVOID aParameter) {
|
WerNotifyProc(LPVOID aParameter) {
|
||||||
const WindowsErrorReportingData* werData =
|
const WindowsErrorReportingData* werData =
|
||||||
static_cast<const WindowsErrorReportingData*>(aParameter);
|
static_cast<const WindowsErrorReportingData*>(aParameter);
|
||||||
|
|
||||||
|
|
@ -3668,7 +3659,6 @@ __declspec(allocate("mozwerpt")) MOZ_EXPORT DWORD WINAPI
|
||||||
ChildProcessData* pd = pidToMinidump->PutEntry(pid);
|
ChildProcessData* pd = pidToMinidump->PutEntry(pid);
|
||||||
MOZ_ASSERT(!pd->minidump);
|
MOZ_ASSERT(!pd->minidump);
|
||||||
pd->minidump = minidump;
|
pd->minidump = minidump;
|
||||||
pd->sequence = ++crashSequence;
|
|
||||||
pd->annotations = MakeUnique<AnnotationTable>();
|
pd->annotations = MakeUnique<AnnotationTable>();
|
||||||
(*pd->annotations)[Annotation::WindowsErrorReporting] = "1"_ns;
|
(*pd->annotations)[Annotation::WindowsErrorReporting] = "1"_ns;
|
||||||
AddSharedAnnotations(*(pd->annotations));
|
AddSharedAnnotations(*(pd->annotations));
|
||||||
|
|
|
||||||
|
|
@ -209,11 +209,9 @@ void OOPInit();
|
||||||
// Return true if a dump was found for |childPid|, and return the
|
// Return true if a dump was found for |childPid|, and return the
|
||||||
// path in |dump|. The caller owns the last reference to |dump| if it
|
// path in |dump|. The caller owns the last reference to |dump| if it
|
||||||
// is non-nullptr. The annotations for the crash will be stored in
|
// is non-nullptr. The annotations for the crash will be stored in
|
||||||
// |aAnnotations|. The sequence parameter will be filled with an ordinal
|
// |aAnnotations|.
|
||||||
// indicating which remote process crashed first.
|
|
||||||
bool TakeMinidumpForChild(uint32_t childPid, nsIFile** dump,
|
bool TakeMinidumpForChild(uint32_t childPid, nsIFile** dump,
|
||||||
AnnotationTable& aAnnotations,
|
AnnotationTable& aAnnotations);
|
||||||
uint32_t* aSequence = nullptr);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If a dump was found for |childPid| then write a minimal .extra file to
|
* If a dump was found for |childPid| then write a minimal .extra file to
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue