Closed Bug 1274404 Opened 8 years ago Closed 8 years ago

Annotate crashes for large messages in ProcessLink::SendMessage()

Categories

(Core :: IPC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: mccr8, Assigned: erahm)

References

Details

(Whiteboard: btpp-active)

Attachments

(1 file, 1 obsolete file)

The crash from trying to send a large IPC message (bug 1271102) is quite common. We should annotate these crashes with the name of the message, and possibly the message size, to better understand where these very large messages are coming from. The normal annotate crash report method can't be used, because that does IPC, but maybe we could have a mechanism like AnnotateMozCrashReason() to annotate the crash report.
See bug 1271102, comment 4. We can't do annotations off the main thread in the content process.
The mechanism used by AnnotateMozCrashReason can be run off the main thread AFAICT. It just sets a global, then some later function comes along and reads it out.
(In reply to Andrew McCreight [:mccr8] from comment #2)
> The mechanism used by AnnotateMozCrashReason can be run off the main thread
> AFAICT. It just sets a global, then some later function comes along and
> reads it out.

Okay, I can do this.
Assignee: nobody → erahm
Thanks, Eric! Also, I think I'm going to go ahead and implement bug 1272423, which should reduce the frequency of these crashes.
As it turns out this was fixed recently, we can annotate off main thread now.
Attachment #8754611 - Flags: review?(continuation)
Comment on attachment 8754611 [details] [diff] [review]
Annotate IPC message name and size when crashing due to message size

Review of attachment 8754611 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks.

::: ipc/glue/MessageLink.cpp
@@ +157,5 @@
>  
>  void
>  ProcessLink::SendMessage(Message *msg)
>  {
> +    if (msg->size() > IPC::Channel::kMaximumMessageSize) {

nit: >=
Attachment #8754611 - Flags: review?(continuation) → review+
(In reply to Andrew McCreight [:mccr8] from comment #7)
> Comment on attachment 8754611 [details] [diff] [review]
> Annotate IPC message name and size when crashing due to message size
> 
> Review of attachment 8754611 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Thanks.
> 
> ::: ipc/glue/MessageLink.cpp
> @@ +157,5 @@
> >  
> >  void
> >  ProcessLink::SendMessage(Message *msg)
> >  {
> > +    if (msg->size() > IPC::Channel::kMaximumMessageSize) {
> 
> nit: >=

I think i had it wrong originally, logically we only care if it's greater than the max size.
Whiteboard: btpp-active
(In reply to Eric Rahm [:erahm] from comment #8)
> I think i had it wrong originally, logically we only care if it's greater
> than the max size.

Ah, of course! Sorry.
Depends on: 1250637
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/2a2a4005e9356ccd2965bb47c1655d33193a7635
Bug 1274404 - Annotate IPC message name and size when crashing due to message size. r=mccr8
Keywords: checkin-needed
Backed out for address sanitizer bustage on both opt and debug:

https://hg.mozilla.org/integration/mozilla-inbound/rev/64bcbab8fa95a965837dee39d297fbc6f2117fc4
Push with failures: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=2a2a4005e9356ccd2965bb47c1655d33193a7635

MessageLink.cpp:162:7: error: use of undeclared identifier 'CrashReporter'
Flags: needinfo?(erahm)
Probably should have both:
  #ifdef MOZ_CRASHREPORTER
  #endif
around the annotation code, and also:
  #ifdef MOZ_CRASHREPORTER
  #include "nsExceptionHandler.h"
  #endif
Attachment #8754611 - Attachment is obsolete: true
Comment on attachment 8755535 [details] [diff] [review]
Annotate IPC message name and size when crashing due to message size

Updated per comment 12. Carrying forward r+
Flags: needinfo?(erahm)
Attachment #8755535 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/b6de0388fc01
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
The telemetry is working (you have to be logged into crash-stats with minidump permissions in order to see these fields):
https://crash-stats.mozilla.com/report/index/4f46e160-9a9b-46e7-abad-66e122160526

IPCMessageName: PBrowser::Msg_InvokeDragSession
IPCMessageSize: 434290984

434MB! Fortunately, bug 1272018 and bug 1275398 should fix this situation.
Err, not telemetry, crash annotation.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: