diff options
author | nealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-07-21 00:10:57 +0000 |
---|---|---|
committer | nealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-07-21 00:10:57 +0000 |
commit | 22734848ea2124d2e8c75a472f71ae20a69fb116 (patch) | |
tree | 5afa6c3c84b50c60ae8438da402edd940c3bb949 /src/client/mac/crash_generation | |
parent | Fix for http://breakpad.appspot.com/18009 - run dump_syms on both PPC & i386 ... (diff) | |
download | breakpad-22734848ea2124d2e8c75a472f71ae20a69fb116.tar.xz |
Port fixes from internal Google Breakpad to SVN.
A=preston, nealsid
R=Stuart, Preston
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@360 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/mac/crash_generation')
-rw-r--r-- | src/client/mac/crash_generation/Inspector.mm | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/client/mac/crash_generation/Inspector.mm b/src/client/mac/crash_generation/Inspector.mm index 5c5c2218..d328ee5d 100644 --- a/src/client/mac/crash_generation/Inspector.mm +++ b/src/client/mac/crash_generation/Inspector.mm @@ -319,6 +319,12 @@ kern_return_t Inspector::ReadMessages() { printf("parameter count = %d\n", info.parameter_count); #endif + // In certain situations where multiple crash requests come + // through quickly, we can end up with the mach IPC messages not + // coming through correctly. Since we don't know what parameters + // we've missed, we can't do much besides abort the crash dump + // situation in this case. + unsigned int parameters_read = 0; // The initial message contains the number of key value pairs that // we are expected to read. // Read each key/value pair, one mach message per key/value pair. @@ -329,6 +335,14 @@ kern_return_t Inspector::ReadMessages() { if(result == KERN_SUCCESS) { KeyValueMessageData &key_value_data = (KeyValueMessageData&)*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 + // messages to not come through correctly. + if (strlen(key_value_data.key) == 0) { + continue; + } + parameters_read++; config_params_.SetKeyValue(key_value_data.key, key_value_data.value); } else { @@ -336,6 +350,11 @@ kern_return_t Inspector::ReadMessages() { break; } } + if (parameters_read != info.parameter_count) { + DEBUGLOG(stderr, "Only read %d parameters instead of %d, aborting crash " + "dump generation.", parameters_read, info.parameter_count); + return KERN_FAILURE; + } } return result; @@ -379,7 +398,7 @@ bool Inspector::InspectTask() { SetCrashTimeParameters(); // If the client app has not specified a minidump directory, // use a default of Library/<kDefaultLibrarySubdirectory>/<Product Name> - if (0 == strlen(minidumpDirectory)) { + if (!minidumpDirectory || 0 == strlen(minidumpDirectory)) { NSArray *libraryDirectories = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, |