blob: 2a9d1d361711737724ea17bc05718864ad216646 [file] [log] [blame]
Steve Fung6c34c252015-08-20 00:27:30 -07001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Ken Mixter03403162010-08-18 15:23:16 -070016
Steve Fung129bea52015-07-23 13:11:15 -070017#include "crash_collector.h"
Ken Mixter03403162010-08-18 15:23:16 -070018
Ken Mixter04ec10f2010-08-26 16:02:02 -070019#include <dirent.h>
Ken Mixter9b346472010-11-07 13:45:45 -080020#include <fcntl.h> // For file creation modes.
Alex Vakulenko7589aff2014-07-30 10:07:35 -070021#include <inttypes.h>
Ben Chanf3811f52014-08-26 06:46:38 -070022#include <linux/limits.h> // PATH_MAX
Ken Mixter03403162010-08-18 15:23:16 -070023#include <pwd.h> // For struct passwd.
24#include <sys/types.h> // for mode_t.
Ken Mixter9b346472010-11-07 13:45:45 -080025#include <sys/wait.h> // For waitpid.
26#include <unistd.h> // For execv and fork.
Ken Mixter03403162010-08-18 15:23:16 -070027
Ken Mixteree849c52010-09-30 15:30:10 -070028#include <set>
Ben Chan7e776902014-06-18 13:19:51 -070029#include <utility>
Simon Quef70060c2012-04-09 19:07:07 -070030#include <vector>
Ken Mixteree849c52010-09-30 15:30:10 -070031
Ben Chanab6cc902014-09-05 08:21:06 -070032#include <base/files/file_util.h>
Ben Chan7e776902014-06-18 13:19:51 -070033#include <base/logging.h>
34#include <base/posix/eintr_wrapper.h>
35#include <base/strings/string_split.h>
36#include <base/strings/string_util.h>
37#include <base/strings/stringprintf.h>
Alex Vakulenko74dc6242015-10-13 09:23:34 -070038#include <brillo/key_value_store.h>
39#include <brillo/process.h>
Ken Mixter03403162010-08-18 15:23:16 -070040
Daniel Erat731da332015-01-28 09:48:10 -070041namespace {
42
43const char kCollectChromeFile[] =
Michael Krebs4fe30db2011-08-05 13:54:52 -070044 "/mnt/stateful_partition/etc/collect_chrome_crashes";
Steve Fung0e8746d2015-08-20 17:07:50 -070045const char kCrashTestInProgressPath[] =
46 "/data/misc/crash_reporter/tmp/crash-test-in-progress";
Daniel Erat731da332015-01-28 09:48:10 -070047const char kDefaultLogConfig[] = "/etc/crash_reporter_logs.conf";
48const char kDefaultUserName[] = "chronos";
Steve Fung0e8746d2015-08-20 17:07:50 -070049const char kLeaveCoreFile[] = "/data/misc/crash_reporter/.leave_core";
Daniel Erat731da332015-01-28 09:48:10 -070050const char kLsbRelease[] = "/etc/lsb-release";
Steve Fung0e8746d2015-08-20 17:07:50 -070051const char kShellPath[] = "/system/bin/sh";
Steve Fungab2ac7d2015-08-14 17:58:05 -070052const char kSystemCrashPath[] = "/data/misc/crash_reporter/crash";
Daniel Erat731da332015-01-28 09:48:10 -070053const char kUploadVarPrefix[] = "upload_var_";
54const char kUploadFilePrefix[] = "upload_file_";
55
Mike Frysingerf19b5182013-05-17 19:36:47 -040056// Normally this path is not used. Unfortunately, there are a few edge cases
57// where we need this. Any process that runs as kDefaultUserName that crashes
58// is consider a "user crash". That includes the initial Chrome browser that
59// runs the login screen. If that blows up, there is no logged in user yet,
60// so there is no per-user dir for us to stash things in. Instead we fallback
61// to this path as it is at least encrypted on a per-system basis.
62//
63// This also comes up when running autotests. The GUI is sitting at the login
64// screen while tests are sshing in, changing users, and triggering crashes as
65// the user (purposefully).
Daniel Erat731da332015-01-28 09:48:10 -070066const char kFallbackUserCrashPath[] = "/home/chronos/crash";
Ken Mixter03403162010-08-18 15:23:16 -070067
68// Directory mode of the user crash spool directory.
Daniel Erat731da332015-01-28 09:48:10 -070069const mode_t kUserCrashPathMode = 0755;
Ken Mixter03403162010-08-18 15:23:16 -070070
71// Directory mode of the system crash spool directory.
Daniel Erat731da332015-01-28 09:48:10 -070072const mode_t kSystemCrashPathMode = 01755;
Ken Mixter03403162010-08-18 15:23:16 -070073
Daniel Erat731da332015-01-28 09:48:10 -070074const uid_t kRootOwner = 0;
75const uid_t kRootGroup = 0;
76
77} // namespace
Ken Mixter03403162010-08-18 15:23:16 -070078
Ken Mixterda5db7a2010-09-17 13:50:42 -070079// Maximum crash reports per crash spool directory. Note that this is
80// a separate maximum from the maximum rate at which we upload these
81// diagnostics. The higher this rate is, the more space we allow for
82// core files, minidumps, and kcrash logs, and equivalently the more
83// processor and I/O bandwidth we dedicate to handling these crashes when
84// many occur at once. Also note that if core files are configured to
85// be left on the file system, we stop adding crashes when either the
86// number of core files or minidumps reaches this number.
87const int CrashCollector::kMaxCrashDirectorySize = 32;
Ken Mixter04ec10f2010-08-26 16:02:02 -070088
Simon Que9f90aca2013-02-19 17:19:52 -080089using base::FilePath;
Mike Frysingera557c112014-02-05 22:55:39 -050090using base::StringPrintf;
Simon Que9f90aca2013-02-19 17:19:52 -080091
Ken Mixterafcf8082010-10-26 14:45:01 -070092CrashCollector::CrashCollector()
Lei Zhang9b1f3002014-04-24 02:10:57 -070093 : lsb_release_(kLsbRelease),
Simon Queacc79382012-05-04 18:10:09 -070094 log_config_path_(kDefaultLogConfig) {
Ken Mixter03403162010-08-18 15:23:16 -070095}
96
97CrashCollector::~CrashCollector() {
98}
99
100void CrashCollector::Initialize(
101 CrashCollector::CountCrashFunction count_crash_function,
Ken Mixtera3249322011-03-03 08:47:38 -0800102 CrashCollector::IsFeedbackAllowedFunction is_feedback_allowed_function) {
Ben Chan262d7982014-09-18 08:05:20 -0700103 CHECK(count_crash_function);
104 CHECK(is_feedback_allowed_function);
Ken Mixter03403162010-08-18 15:23:16 -0700105
106 count_crash_function_ = count_crash_function;
107 is_feedback_allowed_function_ = is_feedback_allowed_function;
Ken Mixter03403162010-08-18 15:23:16 -0700108}
109
Ken Mixter9b346472010-11-07 13:45:45 -0800110int CrashCollector::WriteNewFile(const FilePath &filename,
111 const char *data,
112 int size) {
113 int fd = HANDLE_EINTR(open(filename.value().c_str(),
114 O_CREAT | O_WRONLY | O_TRUNC | O_EXCL, 0666));
115 if (fd < 0) {
116 return -1;
117 }
118
Alex Vakulenko859ee452014-12-10 12:52:31 -0800119 int rv = base::WriteFileDescriptor(fd, data, size) ? size : -1;
Mike Frysingerf1a50142014-05-14 16:05:09 -0400120 IGNORE_EINTR(close(fd));
Ken Mixter9b346472010-11-07 13:45:45 -0800121 return rv;
122}
123
Ken Mixteree849c52010-09-30 15:30:10 -0700124std::string CrashCollector::Sanitize(const std::string &name) {
Thiemo Nagel98950962014-05-13 19:48:32 +0200125 // Make sure the sanitized name does not include any periods.
126 // The logic in crash_sender relies on this.
Ken Mixteree849c52010-09-30 15:30:10 -0700127 std::string result = name;
128 for (size_t i = 0; i < name.size(); ++i) {
129 if (!isalnum(result[i]) && result[i] != '_')
130 result[i] = '_';
131 }
132 return result;
133}
134
Ken Mixter03403162010-08-18 15:23:16 -0700135std::string CrashCollector::FormatDumpBasename(const std::string &exec_name,
136 time_t timestamp,
137 pid_t pid) {
138 struct tm tm;
139 localtime_r(&timestamp, &tm);
Ken Mixteree849c52010-09-30 15:30:10 -0700140 std::string sanitized_exec_name = Sanitize(exec_name);
Ken Mixter03403162010-08-18 15:23:16 -0700141 return StringPrintf("%s.%04d%02d%02d.%02d%02d%02d.%d",
Ken Mixteree849c52010-09-30 15:30:10 -0700142 sanitized_exec_name.c_str(),
Ken Mixter03403162010-08-18 15:23:16 -0700143 tm.tm_year + 1900,
144 tm.tm_mon + 1,
145 tm.tm_mday,
146 tm.tm_hour,
147 tm.tm_min,
148 tm.tm_sec,
149 pid);
150}
151
Ken Mixter207694d2010-10-28 15:42:37 -0700152FilePath CrashCollector::GetCrashPath(const FilePath &crash_directory,
153 const std::string &basename,
154 const std::string &extension) {
155 return crash_directory.Append(StringPrintf("%s.%s",
156 basename.c_str(),
157 extension.c_str()));
158}
159
Ken Mixter03403162010-08-18 15:23:16 -0700160FilePath CrashCollector::GetCrashDirectoryInfo(
Ken Mixter03403162010-08-18 15:23:16 -0700161 mode_t *mode,
162 uid_t *directory_owner,
163 gid_t *directory_group) {
Steve Fungab2ac7d2015-08-14 17:58:05 -0700164 *mode = kSystemCrashPathMode;
165 *directory_owner = kRootOwner;
166 *directory_group = kRootGroup;
167 return FilePath(kSystemCrashPath);
Ken Mixter03403162010-08-18 15:23:16 -0700168}
169
170bool CrashCollector::GetUserInfoFromName(const std::string &name,
171 uid_t *uid,
172 gid_t *gid) {
173 char storage[256];
174 struct passwd passwd_storage;
Ben Chan262d7982014-09-18 08:05:20 -0700175 struct passwd *passwd_result = nullptr;
Ken Mixter03403162010-08-18 15:23:16 -0700176
177 if (getpwnam_r(name.c_str(), &passwd_storage, storage, sizeof(storage),
Ben Chan262d7982014-09-18 08:05:20 -0700178 &passwd_result) != 0 || passwd_result == nullptr) {
Ken Mixtera3249322011-03-03 08:47:38 -0800179 LOG(ERROR) << "Cannot find user named " << name;
Ken Mixter03403162010-08-18 15:23:16 -0700180 return false;
181 }
182
183 *uid = passwd_result->pw_uid;
184 *gid = passwd_result->pw_gid;
185 return true;
186}
187
188bool CrashCollector::GetCreatedCrashDirectoryByEuid(uid_t euid,
Ken Mixter207694d2010-10-28 15:42:37 -0700189 FilePath *crash_directory,
190 bool *out_of_capacity) {
Ben Chan262d7982014-09-18 08:05:20 -0700191 if (out_of_capacity) *out_of_capacity = false;
Ken Mixter207694d2010-10-28 15:42:37 -0700192
Ken Mixter03403162010-08-18 15:23:16 -0700193 // For testing.
Lei Zhang9b1f3002014-04-24 02:10:57 -0700194 if (!forced_crash_directory_.empty()) {
195 *crash_directory = forced_crash_directory_;
Ken Mixter03403162010-08-18 15:23:16 -0700196 return true;
197 }
198
Ken Mixter03403162010-08-18 15:23:16 -0700199 mode_t directory_mode;
200 uid_t directory_owner;
201 gid_t directory_group;
202 *crash_directory =
Steve Fungab2ac7d2015-08-14 17:58:05 -0700203 GetCrashDirectoryInfo(&directory_mode,
Ken Mixter03403162010-08-18 15:23:16 -0700204 &directory_owner,
205 &directory_group);
206
Mike Frysingera557c112014-02-05 22:55:39 -0500207 if (!base::PathExists(*crash_directory)) {
Ken Mixter03403162010-08-18 15:23:16 -0700208 // Create the spool directory with the appropriate mode (regardless of
209 // umask) and ownership.
210 mode_t old_mask = umask(0);
211 if (mkdir(crash_directory->value().c_str(), directory_mode) < 0 ||
212 chown(crash_directory->value().c_str(),
213 directory_owner,
214 directory_group) < 0) {
Ken Mixtera3249322011-03-03 08:47:38 -0800215 LOG(ERROR) << "Unable to create appropriate crash directory";
Ken Mixter03403162010-08-18 15:23:16 -0700216 return false;
217 }
218 umask(old_mask);
219 }
220
Mike Frysingera557c112014-02-05 22:55:39 -0500221 if (!base::PathExists(*crash_directory)) {
Ken Mixtera3249322011-03-03 08:47:38 -0800222 LOG(ERROR) << "Unable to create crash directory "
223 << crash_directory->value().c_str();
Ken Mixter03403162010-08-18 15:23:16 -0700224 return false;
225 }
226
Ken Mixter04ec10f2010-08-26 16:02:02 -0700227 if (!CheckHasCapacity(*crash_directory)) {
Ben Chan262d7982014-09-18 08:05:20 -0700228 if (out_of_capacity) *out_of_capacity = true;
Steve Fungab2ac7d2015-08-14 17:58:05 -0700229 LOG(ERROR) << "Directory " << crash_directory->value()
230 << " is out of capacity.";
Ken Mixter04ec10f2010-08-26 16:02:02 -0700231 return false;
232 }
233
Ken Mixter03403162010-08-18 15:23:16 -0700234 return true;
235}
Ken Mixter04ec10f2010-08-26 16:02:02 -0700236
Albert Chaulk426fcc02013-05-02 15:38:31 -0700237FilePath CrashCollector::GetProcessPath(pid_t pid) {
238 return FilePath(StringPrintf("/proc/%d", pid));
239}
240
241bool CrashCollector::GetSymlinkTarget(const FilePath &symlink,
Ben Chan8563d202014-01-27 19:30:13 -0800242 FilePath *target) {
Ben Chanf3811f52014-08-26 06:46:38 -0700243 ssize_t max_size = 64;
244 std::vector<char> buffer;
245
Albert Chaulk426fcc02013-05-02 15:38:31 -0700246 while (true) {
Ben Chanf3811f52014-08-26 06:46:38 -0700247 buffer.resize(max_size + 1);
248 ssize_t size = readlink(symlink.value().c_str(), buffer.data(), max_size);
Albert Chaulk426fcc02013-05-02 15:38:31 -0700249 if (size < 0) {
250 int saved_errno = errno;
251 LOG(ERROR) << "Readlink failed on " << symlink.value() << " with "
252 << saved_errno;
253 return false;
254 }
Ben Chanf3811f52014-08-26 06:46:38 -0700255
Albert Chaulk426fcc02013-05-02 15:38:31 -0700256 buffer[size] = 0;
257 if (size == max_size) {
Ben Chanf3811f52014-08-26 06:46:38 -0700258 max_size *= 2;
259 if (max_size > PATH_MAX) {
Albert Chaulk426fcc02013-05-02 15:38:31 -0700260 return false;
261 }
Ben Chanf3811f52014-08-26 06:46:38 -0700262 continue;
Albert Chaulk426fcc02013-05-02 15:38:31 -0700263 }
264 break;
265 }
266
Ben Chanf3811f52014-08-26 06:46:38 -0700267 *target = FilePath(buffer.data());
Albert Chaulk426fcc02013-05-02 15:38:31 -0700268 return true;
269}
270
271bool CrashCollector::GetExecutableBaseNameFromPid(pid_t pid,
272 std::string *base_name) {
273 FilePath target;
274 FilePath process_path = GetProcessPath(pid);
275 FilePath exe_path = process_path.Append("exe");
276 if (!GetSymlinkTarget(exe_path, &target)) {
277 LOG(INFO) << "GetSymlinkTarget failed - Path " << process_path.value()
278 << " DirectoryExists: "
Mike Frysingera557c112014-02-05 22:55:39 -0500279 << base::DirectoryExists(process_path);
Albert Chaulk426fcc02013-05-02 15:38:31 -0700280 // Try to further diagnose exe readlink failure cause.
281 struct stat buf;
282 int stat_result = stat(exe_path.value().c_str(), &buf);
283 int saved_errno = errno;
284 if (stat_result < 0) {
285 LOG(INFO) << "stat " << exe_path.value() << " failed: " << stat_result
286 << " " << saved_errno;
287 } else {
288 LOG(INFO) << "stat " << exe_path.value() << " succeeded: st_mode="
289 << buf.st_mode;
290 }
291 return false;
292 }
293 *base_name = target.BaseName().value();
294 return true;
295}
296
Ken Mixter04ec10f2010-08-26 16:02:02 -0700297// Return true if the given crash directory has not already reached
298// maximum capacity.
299bool CrashCollector::CheckHasCapacity(const FilePath &crash_directory) {
300 DIR* dir = opendir(crash_directory.value().c_str());
301 if (!dir) {
Steve Fungab2ac7d2015-08-14 17:58:05 -0700302 LOG(WARNING) << "Unable to open crash directory "
303 << crash_directory.value();
Ken Mixter04ec10f2010-08-26 16:02:02 -0700304 return false;
305 }
306 struct dirent ent_buf;
307 struct dirent* ent;
Ken Mixter04ec10f2010-08-26 16:02:02 -0700308 bool full = false;
Ken Mixteree849c52010-09-30 15:30:10 -0700309 std::set<std::string> basenames;
Ben Chan262d7982014-09-18 08:05:20 -0700310 while (readdir_r(dir, &ent_buf, &ent) == 0 && ent) {
Ken Mixter04ec10f2010-08-26 16:02:02 -0700311 if ((strcmp(ent->d_name, ".") == 0) ||
312 (strcmp(ent->d_name, "..") == 0))
313 continue;
314
Ken Mixteree849c52010-09-30 15:30:10 -0700315 std::string filename(ent->d_name);
316 size_t last_dot = filename.rfind(".");
317 std::string basename;
318 // If there is a valid looking extension, use the base part of the
319 // name. If the only dot is the first byte (aka a dot file), treat
320 // it as unique to avoid allowing a directory full of dot files
321 // from accumulating.
322 if (last_dot != std::string::npos && last_dot != 0)
323 basename = filename.substr(0, last_dot);
324 else
325 basename = filename;
326 basenames.insert(basename);
Ken Mixter04ec10f2010-08-26 16:02:02 -0700327
Ken Mixteree849c52010-09-30 15:30:10 -0700328 if (basenames.size() >= static_cast<size_t>(kMaxCrashDirectorySize)) {
Ken Mixtera3249322011-03-03 08:47:38 -0800329 LOG(WARNING) << "Crash directory " << crash_directory.value()
330 << " already full with " << kMaxCrashDirectorySize
331 << " pending reports";
Ken Mixter04ec10f2010-08-26 16:02:02 -0700332 full = true;
333 break;
334 }
335 }
336 closedir(dir);
337 return !full;
338}
Ken Mixteree849c52010-09-30 15:30:10 -0700339
Ken Mixterc49dbd42010-12-14 17:44:11 -0800340bool CrashCollector::GetLogContents(const FilePath &config_path,
341 const std::string &exec_name,
342 const FilePath &output_file) {
Alex Vakulenko74dc6242015-10-13 09:23:34 -0700343 brillo::KeyValueStore store;
Daniel Erat731da332015-01-28 09:48:10 -0700344 if (!store.Load(config_path)) {
Ken Mixtera3249322011-03-03 08:47:38 -0800345 LOG(INFO) << "Unable to read log configuration file "
346 << config_path.value();
Ken Mixterc49dbd42010-12-14 17:44:11 -0800347 return false;
348 }
349
Daniel Erat731da332015-01-28 09:48:10 -0700350 std::string command;
351 if (!store.GetString(exec_name, &command))
Ken Mixterc49dbd42010-12-14 17:44:11 -0800352 return false;
353
Alex Vakulenko74dc6242015-10-13 09:23:34 -0700354 brillo::ProcessImpl diag_process;
Ken Mixtera3249322011-03-03 08:47:38 -0800355 diag_process.AddArg(kShellPath);
Daniel Erat731da332015-01-28 09:48:10 -0700356 diag_process.AddStringOption("-c", command);
Ken Mixtera3249322011-03-03 08:47:38 -0800357 diag_process.RedirectOutput(output_file.value());
Ken Mixterc49dbd42010-12-14 17:44:11 -0800358
Daniel Erat731da332015-01-28 09:48:10 -0700359 const int result = diag_process.Run();
Ken Mixtera3249322011-03-03 08:47:38 -0800360 if (result != 0) {
Daniel Erat731da332015-01-28 09:48:10 -0700361 LOG(INFO) << "Log command \"" << command << "\" exited with " << result;
Ken Mixterc49dbd42010-12-14 17:44:11 -0800362 return false;
363 }
364 return true;
365}
366
Ken Mixterafcf8082010-10-26 14:45:01 -0700367void CrashCollector::AddCrashMetaData(const std::string &key,
368 const std::string &value) {
369 extra_metadata_.append(StringPrintf("%s=%s\n", key.c_str(), value.c_str()));
370}
371
Albert Chaulk33dfd472013-06-19 15:34:13 -0700372void CrashCollector::AddCrashMetaUploadFile(const std::string &key,
373 const std::string &path) {
374 if (!path.empty())
375 AddCrashMetaData(kUploadFilePrefix + key, path);
376}
377
378void CrashCollector::AddCrashMetaUploadData(const std::string &key,
379 const std::string &value) {
380 if (!value.empty())
381 AddCrashMetaData(kUploadVarPrefix + key, value);
382}
383
Ken Mixteree849c52010-09-30 15:30:10 -0700384void CrashCollector::WriteCrashMetaData(const FilePath &meta_path,
Ken Mixterc909b692010-10-18 12:26:05 -0700385 const std::string &exec_name,
386 const std::string &payload_path) {
Ben Chanf84ea212014-08-06 17:27:48 -0700387 int64_t payload_size = -1;
Mike Frysingera557c112014-02-05 22:55:39 -0500388 base::GetFileSize(FilePath(payload_path), &payload_size);
Ken Mixterafcf8082010-10-26 14:45:01 -0700389 std::string meta_data = StringPrintf("%sexec_name=%s\n"
Ken Mixter207694d2010-10-28 15:42:37 -0700390 "payload=%s\n"
Alex Vakulenkoeaf060c2014-08-08 09:36:48 -0700391 "payload_size=%" PRId64 "\n"
Ken Mixteree849c52010-09-30 15:30:10 -0700392 "done=1\n",
Ken Mixterafcf8082010-10-26 14:45:01 -0700393 extra_metadata_.c_str(),
Ken Mixteree849c52010-09-30 15:30:10 -0700394 exec_name.c_str(),
Ken Mixter207694d2010-10-28 15:42:37 -0700395 payload_path.c_str(),
Ken Mixterc909b692010-10-18 12:26:05 -0700396 payload_size);
Ben Chanf30c6412014-05-22 23:09:01 -0700397 // We must use WriteNewFile instead of base::WriteFile as we
Ken Mixter9b346472010-11-07 13:45:45 -0800398 // do not want to write with root access to a symlink that an attacker
399 // might have created.
400 if (WriteNewFile(meta_path, meta_data.c_str(), meta_data.size()) < 0) {
Ken Mixtera3249322011-03-03 08:47:38 -0800401 LOG(ERROR) << "Unable to write " << meta_path.value();
Ken Mixteree849c52010-09-30 15:30:10 -0700402 }
403}
Thieu Le1652fb22011-03-03 12:14:43 -0800404
405bool CrashCollector::IsCrashTestInProgress() {
Mike Frysingera557c112014-02-05 22:55:39 -0500406 return base::PathExists(FilePath(kCrashTestInProgressPath));
Thieu Le1652fb22011-03-03 12:14:43 -0800407}
Michael Krebs4fe30db2011-08-05 13:54:52 -0700408
409bool CrashCollector::IsDeveloperImage() {
410 // If we're testing crash reporter itself, we don't want to special-case
411 // for developer images.
412 if (IsCrashTestInProgress())
413 return false;
Mike Frysingera557c112014-02-05 22:55:39 -0500414 return base::PathExists(FilePath(kLeaveCoreFile));
Michael Krebs4fe30db2011-08-05 13:54:52 -0700415}