crash-reporter: Read core from stdin even if proc files are unsuable.

This CL fixes commit c7c7914f49fbdef0d1f06c13854daabe176621ed such that
UserCollector continues to read the core file from stdin even if the proc
files are unusable.

BUG=chromium-os:24820
TEST=Tested the following:
1. Build crash-reporter and run unit tests.
2. Run the following autotest tests on a Cr48:
   - logging_CrashSender
   - logging_UserCrash

Change-Id: I04d09b15a80344b47f0512196c40e94384c5c323
Reviewed-on: https://gerrit.chromium.org/gerrit/13872
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
This commit is contained in:
Ben Chan 2012-01-09 10:29:58 -08:00 committed by David James
parent f13bb58358
commit ec7d7835a2

View file

@ -265,7 +265,7 @@ bool UserCollector::CopyOffProcFiles(pid_t pid,
return false;
}
}
return ValidateProcFiles(container_dir);
return true;
}
bool UserCollector::ValidateProcFiles(const FilePath &container_dir) {
@ -377,11 +377,19 @@ bool UserCollector::ConvertCoreToMinidump(pid_t pid,
const FilePath &container_dir,
const FilePath &core_path,
const FilePath &minidump_path) {
if (!CopyOffProcFiles(pid, container_dir)) {
// If proc files are unuable, we continue to read the core file from stdin,
// but only skip the core-to-minidump conversion, so that we may still use
// the core file for debugging.
bool proc_files_usable =
CopyOffProcFiles(pid, container_dir) && ValidateProcFiles(container_dir);
if (!CopyStdinToCoreFile(core_path)) {
return false;
}
if (!CopyStdinToCoreFile(core_path)) {
if (!proc_files_usable) {
LOG(INFO) << "Skipped converting core file to minidump due to "
<< "unusable proc files";
return false;
}