From 615d2c0d6d5aa91c624df3ae647daca568ba1a9c Mon Sep 17 00:00:00 2001 From: "mark@chromium.org" Date: Wed, 21 Jul 2010 21:21:07 +0000 Subject: Separate the "hello" message from the parameter messages in Inspector::ReadMessages as was done before r627. The "hello" message contains the parameter count and is referenced while the message reader loops through parameter messages. Prior to r627, both messages were named |message|, which was confusing, probably caused a compiler warning, and apparently provided the motivation to share them. This caused the crash inspector to fail to properly collect the parameters. The common failure mode (although others are possible) was for the inspector to attempt tor read more parameter messages than were available, resulting in an IPC timeout and inspector death. No crash report would be written, and the application expecting its crash to be inspected would time out waiting for a response from the inspector and then _exit. This is effectively a failure to properly handle crashes. The inner message is reintroduced, and named parameter_message for disambiguation. BUG=chromium:49821 TEST=Crashes catchable by the Mac Breakpad framework Review URL: http://breakpad.appspot.com/123002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@628 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/mac/crash_generation/Inspector.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/mac/crash_generation/Inspector.mm b/src/client/mac/crash_generation/Inspector.mm index 1fe2a208..a8930858 100644 --- a/src/client/mac/crash_generation/Inspector.mm +++ b/src/client/mac/crash_generation/Inspector.mm @@ -331,11 +331,12 @@ kern_return_t Inspector::ReadMessages() { // we are expected to read. // Read each key/value pair, one mach message per key/value pair. for (unsigned int i = 0; i < info.parameter_count; ++i) { - result = receive_port.WaitForMessage(&message, 1000); + MachReceiveMessage parameter_message; + result = receive_port.WaitForMessage(¶meter_message, 1000); if(result == KERN_SUCCESS) { KeyValueMessageData &key_value_data = - (KeyValueMessageData&)*message.GetData(); + (KeyValueMessageData&)*parameter_message.GetData(); // If we get a blank key, make sure we don't increment the // parameter count; in some cases (notably on-demand generation // many times in a short period of time) caused the Mach IPC -- cgit v1.2.1