Bug 1240985 - Crash when trying to cancel while dispatching urgent message (r=dvander)
authorBill McCloskey <billm@mozilla.com>
Tue, 19 Jan 2016 17:38:17 -0800
changeset 281555 b94c1a472d4654e801c2de90e3119ebdf776b50a
parent 281554 98ccd385e6fd837cd6248367a82ffdf2627cf493
child 281556 62eaf89ab82fbd509041026ac34b6a7e572bb176
push id70846
push userwmccloskey@mozilla.com
push dateTue, 26 Jan 2016 05:51:34 +0000
treeherdermozilla-inbound@30f1acd9387f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs1240985
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1240985 - Crash when trying to cancel while dispatching urgent message (r=dvander)
ipc/glue/MessageChannel.cpp
--- a/ipc/glue/MessageChannel.cpp
+++ b/ipc/glue/MessageChannel.cpp
@@ -2129,16 +2129,25 @@ MessageChannel::CancelCurrentTransaction
     // see if mCurrentTransaction is 0 before examining DispatchSyncMessage.
 }
 
 void
 MessageChannel::CancelCurrentTransaction()
 {
     MonitorAutoLock lock(*mMonitor);
     if (mCurrentTransaction) {
+        if (DispatchingSyncMessagePriority() == IPC::Message::PRIORITY_URGENT ||
+            DispatchingAsyncMessagePriority() == IPC::Message::PRIORITY_URGENT)
+        {
+            MOZ_CRASH("Intentional crash: we're running a nested event loop "
+                      "while processing an urgent message");
+        }
+
+        IPC_LOG("Cancel requested: current xid=%d", mCurrentTransaction);
+        MOZ_ASSERT(DispatchingSyncMessage());
         CancelMessage *cancel = new CancelMessage();
         cancel->set_transaction_id(mCurrentTransaction);
         mLink->SendMessage(cancel);
         CancelCurrentTransactionInternal();
     }
 }
 
 void