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>
diff --git a/crash_reporter/user_collector.cc b/crash_reporter/user_collector.cc
index dffca9d..308fe9a 100644
--- a/crash_reporter/user_collector.cc
+++ b/crash_reporter/user_collector.cc
@@ -265,7 +265,7 @@
       return false;
     }
   }
-  return ValidateProcFiles(container_dir);
+  return true;
 }
 
 bool UserCollector::ValidateProcFiles(const FilePath &container_dir) {
@@ -377,11 +377,19 @@
                                           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;
   }