Closed
Bug 539552
Opened 15 years ago
Closed 15 years ago
Connect up the crash report minidump location with the toplevel actor that crashed
Categories
(Core :: IPC, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
status1.9.2 | --- | .4-fixed |
People
(Reporter: benjamin, Assigned: cjones)
References
Details
(Whiteboard: [fixed-lorentz])
Attachments
(4 files, 6 obsolete files)
3.35 KB,
patch
|
bent.mozilla
:
review+
|
Details | Diff | Splinter Review |
531 bytes,
patch
|
ted
:
review+
|
Details | Diff | Splinter Review |
4.74 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
11.25 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
When a plugin crashes, we want to tell the toplevel PluginModuleParent about the location of the minidump file before we fire any ActorDestroy notifications. The ActorDestroy notifications will then use the minidump location to provide extra annotations and eventually submit the report.
We may also want the following information from IPDL:
* The startup time of the plugin process
Reporter | ||
Comment 1•15 years ago
|
||
cjones mentioned "associate the crashing PID with a toplevel actor"
Assignee | ||
Comment 2•15 years ago
|
||
If we could look up the miniump location from within ActorDestroy(), would that suffice? Also, what should be done with the placeholder code in nsExceptionHandler::OnChildProcessDumpRequested? Is that being obsoleted by this mechanism?
Assignee | ||
Comment 3•15 years ago
|
||
Attachment #421580 -
Flags: review?(ted.mielczarek)
Assignee | ||
Comment 4•15 years ago
|
||
Attachment #421581 -
Flags: review?(bent.mozilla)
Assignee | ||
Comment 5•15 years ago
|
||
PluginModuleParent just prints a message after grabbing the minidump. bsmedberg, I only r?-ed this code for demo purposes, please feel free to cancel and edit yourself.
Attachment #421583 -
Flags: review?(benjamin)
Assignee | ||
Comment 6•15 years ago
|
||
Fixed some minor issues that Windows testing exposed
Attachment #421580 -
Attachment is obsolete: true
Attachment #421606 -
Flags: review?(ted.mielczarek)
Attachment #421580 -
Flags: review?(ted.mielczarek)
Reporter | ||
Comment 7•15 years ago
|
||
To my knowledge, nobody has ever used or tested the multi-thread versions of the template hashtables, and I've wanted to remove them. I'd recommend using an external mutex.
Comment 8•15 years ago
|
||
Comment on attachment 421606 [details] [diff] [review]
Keep track of child process minidumps, offer pid-based lookup API, v 0.1
>diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/client_info.h b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/client_info.h
>--- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/client_info.h
>+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/client_info.h
>@@ -32,6 +32,8 @@
>
> namespace google_breakpad {
>
>+class CrashGenerationServer;
>+
> struct ClientInfo {
> CrashGenerationServer* crash_server_;
> pid_t pid_;
Is this a related change? Seems out of place.
>diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp
>--- a/toolkit/crashreporter/nsExceptionHandler.cpp
>+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
>+// Needs to be thread-safe because it might be accessed inside of a
>+// minidump-request callback on another thread
>+typedef nsInterfaceHashtableMT<nsUint32HashKey, nsIFile> ChildMinidumpMap;
>+static ChildMinidumpMap* pidToMinidump;
I'd follow bsmedberg's advice here re: threadsafety.
>+bool
> UnsetRemoteExceptionHandler()
> {
> delete gExceptionHandler;
> gExceptionHandler = NULL;
>+
>+ delete pidToMinidump;
>+ pidToMinidump = NULL;
This is in the wrong place, this is called from the child process. It needs to be in UnsetExceptionHandler.
>+
>+#if defined(XP_WIN)
>+ PR_Free(childCrashNotifyPipe);
>+ childCrashNotifyPipe = NULL;
>+#endif
I think this is also in the wrong place. This probably wants to be in a OOPShutdown or something like that, which could then get called from UnsetExceptionHandler (or directly from the IPC code).
>diff --git a/toolkit/crashreporter/nsExceptionHandler.h b/toolkit/crashreporter/nsExceptionHandler.h
>--- a/toolkit/crashreporter/nsExceptionHandler.h
>+++ b/toolkit/crashreporter/nsExceptionHandler.h
>@@ -42,6 +42,8 @@
> #include "nsXPCOM.h"
> #include "nsStringGlue.h"
>
>+#include "nsIFile.h"
>+
> #if defined(XP_WIN32)
> #ifdef WIN32_LEAN_AND_MEAN
> #undef WIN32_LEAN_AND_MEAN
>@@ -65,10 +67,12 @@ nsresult SetupExtraData(nsILocalFile* aA
> #ifdef XP_WIN32
> nsresult WriteMinidumpForException(EXCEPTION_POINTERS* aExceptionInfo);
>
>+# if defined(MOZ_IPC)
There are a few more APIs here that could be #ifdef MOZ_IPC.
>diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp
>--- a/toolkit/xre/nsEmbedFunctions.cpp
>+++ b/toolkit/xre/nsEmbedFunctions.cpp
>@@ -259,6 +259,15 @@ static MessageLoop* sIOMessageLoop;
> static MessageLoop* sIOMessageLoop;
>
> #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
>+PRBool
>+XRE_GetMinidumpForChild(PRUint32 aChildPid, nsIFile** aDump)
>+{
>+ return CrashReporter::GetMinidumpForChild(aChildPid, aDump);
>+}
>+
Do we need to do this via IPDL? Seems like we could expose this via XPCOM or something and make things simpler, and then just provide the child PID on the event that gets sent to the browser chrome.
Attachment #421606 -
Flags: review?(ted.mielczarek) → review-
Reporter | ||
Comment 9•15 years ago
|
||
Well... remember that there are going to be *many* events sent to browser chrome (one per plugin instance). I wanted a single place where we could move the minidump to pending/ and write the .extra file, and I thought the toplevel IPDL ActorDestroy method would be a good place to kick that off. Remember that the toplevel actor will be storing metadata that we want to send with the report, such as the plugin name/version data.
Comment 10•15 years ago
|
||
Ah, ok. I thought we'd do that in the callback in nsExceptionHandler.cpp, but maybe getting all the necessary data there would be a pain.
Reporter | ||
Comment 11•15 years ago
|
||
Checking in ep_unittest.pl;
/cvsroot/mozilla/webtools/tinderbox/ep_unittest.pl,v <-- ep_unittest.pl
new revision: 1.6; previous revision: 1.5
done
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 12•15 years ago
|
||
Whoops, wrong bug!
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment on attachment 421581 [details] [diff] [review]
Add a GetMinidump() method to top-level, parent-side IPDL classes
The IPDL changes look fine to me.
Attachment #421581 -
Flags: review?(bent.mozilla) → review+
Comment 14•15 years ago
|
||
This will conflict a little bit with cjones' patch, but I think this is part of the right approach. This writes out almost all the data that's been set in the parent process into a .extra file for the child process' dump. There's a short blacklist of things that we ignore because they don't make sense. I think we can take this + cjones' patch, then make the IPDL AbnormalShutdown case append the rest of the interesting data to that file (plugin filename, child process startup time, etc) and then move both the .dmp and .extra to the Crash Reports/pending directory.
Assignee | ||
Comment 15•15 years ago
|
||
(In reply to comment #8)
> (From update of attachment 421606 [details] [diff] [review])
> >diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/client_info.h b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/client_info.h
> >--- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/client_info.h
> >+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/client_info.h
> >@@ -32,6 +32,8 @@
> >
> > namespace google_breakpad {
> >
> >+class CrashGenerationServer;
> >+
> > struct ClientInfo {
> > CrashGenerationServer* crash_server_;
> > pid_t pid_;
>
> Is this a related change? Seems out of place.
>
Yes. I'll split it out into a separate patch.
> >diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp
> >--- a/toolkit/crashreporter/nsExceptionHandler.cpp
> >+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
> >+// Needs to be thread-safe because it might be accessed inside of a
> >+// minidump-request callback on another thread
> >+typedef nsInterfaceHashtableMT<nsUint32HashKey, nsIFile> ChildMinidumpMap;
> >+static ChildMinidumpMap* pidToMinidump;
>
> I'd follow bsmedberg's advice here re: threadsafety.
>
> >+bool
> > UnsetRemoteExceptionHandler()
> > {
> > delete gExceptionHandler;
> > gExceptionHandler = NULL;
> >+
> >+ delete pidToMinidump;
> >+ pidToMinidump = NULL;
>
> This is in the wrong place, this is called from the child process. It needs to
> be in UnsetExceptionHandler.
>
> >+
> >+#if defined(XP_WIN)
> >+ PR_Free(childCrashNotifyPipe);
> >+ childCrashNotifyPipe = NULL;
> >+#endif
>
> I think this is also in the wrong place. This probably wants to be in a
> OOPShutdown or something like that, which could then get called from
> UnsetExceptionHandler (or directly from the IPC code).
>
Gah! Epic fail, thanks for the catch.
Assignee | ||
Comment 16•15 years ago
|
||
Attachment #421691 -
Flags: review?(ted.mielczarek)
Assignee | ||
Comment 17•15 years ago
|
||
Addressed comments. I went ahead and shuffled some functions in nsExceptionHandler.h to make them easier to |ifdef MOZ_IPC|, so there's a little more diff there than you might expect.
Attachment #421581 -
Attachment is obsolete: true
Attachment #421695 -
Flags: review?(ted.mielczarek)
Assignee | ||
Comment 18•15 years ago
|
||
Attachment #421675 -
Attachment is obsolete: true
Attachment #421695 -
Attachment is obsolete: true
Attachment #421742 -
Flags: review?(ted.mielczarek)
Attachment #421695 -
Flags: review?(ted.mielczarek)
Updated•15 years ago
|
Attachment #421691 -
Flags: review?(ted.mielczarek) → review+
Updated•15 years ago
|
Attachment #421606 -
Attachment is obsolete: true
Updated•15 years ago
|
Attachment #421581 -
Attachment is obsolete: false
Comment 19•15 years ago
|
||
This fleshes out the code in PluginModuleParent, and make it add ProcessType, StartupTime, and PluginFilename. (PluginName and PluginVersion I left as a TODO for bug 539841.)
I'll add the data to the event in a separate patch.
Attachment #421583 -
Attachment is obsolete: true
Attachment #421881 -
Flags: review?(benjamin)
Attachment #421583 -
Flags: review?(benjamin)
Reporter | ||
Comment 20•15 years ago
|
||
Comment on attachment 421881 [details] [diff] [review]
write out some more .extra data in PluginModuleParent
nsCRT.h has FILE_PATH_SEPARATOR, let's use that instead of adding a new #define
Attachment #421881 -
Flags: review?(benjamin) → review+
Comment 21•15 years ago
|
||
Comment on attachment 421742 [details] [diff] [review]
Part 1, v3: Has ted's .extra patch folded in
Your parts look fine. I have a slightly updated version of this that I'll attach, and bsmedberg can give my half a once-over.
Attachment #421742 -
Flags: review?(ted.mielczarek) → review+
Comment 22•15 years ago
|
||
cjones: actually, looking again, it looks like you lost the hunk that deletes pidToMinidump. I noted that it was misplaced in the first patch, did you mean to move it but forgot?
Comment 23•15 years ago
|
||
Attachment #421742 -
Attachment is obsolete: true
Attachment #422561 -
Flags: review?(benjamin)
Assignee | ||
Comment 24•15 years ago
|
||
(In reply to comment #22)
> cjones: actually, looking again, it looks like you lost the hunk that deletes
> pidToMinidump. I noted that it was misplaced in the first patch, did you mean
> to move it but forgot?
Nope, I meant to toast it. It falls under bug 539451.
Reporter | ||
Updated•15 years ago
|
Attachment #422561 -
Flags: review?(benjamin) → review+
Comment 25•15 years ago
|
||
I pushed all these patches to e10s:
http://hg.mozilla.org/projects/electrolysis/rev/69efd75e70ca
http://hg.mozilla.org/projects/electrolysis/rev/c278aa8c9eff
http://hg.mozilla.org/projects/electrolysis/rev/c15099808e2c
http://hg.mozilla.org/projects/electrolysis/rev/cca0bf3db70a
I'm going to move any work that's left to a new bug, this one is kind of crowded.
Whiteboard: [fixed-in-electrolysis]
Comment 26•15 years ago
|
||
Filed bug 541076 for adding the minidump id to the PluginCrashed event.
Reporter | ||
Comment 27•15 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/bab9a9bd06b4
http://hg.mozilla.org/mozilla-central/rev/4309b6909234
http://hg.mozilla.org/mozilla-central/rev/d2f40c5d85f9
http://hg.mozilla.org/mozilla-central/rev/69153c9be237
Status: REOPENED → RESOLVED
Closed: 15 years ago → 15 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 28•15 years ago
|
||
Whiteboard: [fixed-in-electrolysis] → [fixed-lorentz]
Comment 29•15 years ago
|
||
Blanket approval for Lorentz merge to mozilla-1.9.2
a=beltzner for 1.9.2.4 - please make sure to mark status1.9.2:.4-fixed
Reporter | ||
Comment 30•15 years ago
|
||
Merged into 1.9.2 at http://hg.mozilla.org/releases/mozilla-1.9.2/rev/84ba4d805430
status1.9.2:
--- → .4-fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•