Closed Bug 1057402 Opened 6 years ago Closed 6 years ago

Log the message type when we get a message error

Categories

(Core :: IPC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34
blocking-b2g 2.0+
Tracking Status
firefox32 --- wontfix
firefox33 --- wontfix
firefox34 --- fixed
b2g-v2.0 --- fixed
b2g-v2.1 --- fixed

People

(Reporter: khuey, Assigned: khuey)

References

Details

Attachments

(2 files)

Attached patch PatchSplinter Review
No description provided.
Attachment #8477442 - Flags: review?(bent.mozilla)
Attached patch Test codeSplinter Review
Testing with this produces:

158 INFO ###!!! [Parent][DispatchAsyncMessage] Error: (msgtype=5898241,name=???) R
oute error: message sent to unknown actor ID
159 INFO ###!!! [Parent][MessageChannel] Error: Channel error: cannot send/recv

And from msgtype we can back out the protocol and message.
Blocks: 1046084
blocking-b2g: --- → 2.0+
Comment on attachment 8477442 [details] [diff] [review]
Patch

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

::: ipc/glue/MessageChannel.cpp
@@ +1578,5 @@
>          NS_RUNTIMEABORT("unknown Result code");
>          return false;
>      }
>  
> +    char printedMsg[256];

How about 512? Some of these protocol/message names can be long

@@ +1579,5 @@
>          return false;
>      }
>  
> +    char printedMsg[256];
> +    PR_snprintf(printedMsg, 256, "(msgtype=%d,name=%s) %s",

How about this:

  PR_snprintf(printedMsg, sizeof(printedMsg),
              "(msgtype=0x%lx, name='%s') %s",
              aMsg.type(), aMsg.name(), errorMsg);

Important bits are that you don't want to hardcode size twice, and msg.type() returns a 32bit number.
Attachment #8477442 - Flags: review?(bent.mozilla) → review+
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.