From 491bb6962629f1f2352c24d9f8f73c70fe65871b Mon Sep 17 00:00:00 2001 From: "yusukes@google.com" Date: Thu, 17 Dec 2009 03:12:58 +0000 Subject: Changing DCHECKs in ResourceBundle::LoadResources() to CHECK. Chromium Linux (release build) dies with SIGSEGV on start-up in case when the chrome.pak resource file is missing or broken for some reason: [17247:17247:499277598478:ERROR:base/file_util.cc(302)] Couldn't open /tmp/chrome.pak Segmentation fault. This change changes some DCHECKs to CHECK in order to make the error message readble to user. After this patch, the message would be like this: [17238:17238:499222545654:ERROR:base/file_util.cc(302)] Couldn't open /home/yusukes/tmp/chrome.pak [17238:17238:499222545701:FATAL:app/resource_bundle_posix.cc(88)] Check failed: resources_data_. failed to load chrome.pak Trace/breakpoint trap BUG=none TEST=Run "cp src/out/Release/chrome /tmp && ./tmp/chrome" and verify that it is terminated by CHECK failure (and not SIGSEGV). Review URL: http://codereview.chromium.org/500045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34804 0039d316-1c4b-4281-b951-d872f2087c98 --- app/resource_bundle_posix.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/resource_bundle_posix.cc') diff --git a/app/resource_bundle_posix.cc b/app/resource_bundle_posix.cc index 044bc3d..665df25 100644 --- a/app/resource_bundle_posix.cc +++ b/app/resource_bundle_posix.cc @@ -83,9 +83,9 @@ string16 ResourceBundle::GetLocalizedString(int message_id) { std::string ResourceBundle::LoadResources(const std::wstring& pref_locale) { DCHECK(!resources_data_) << "chrome.pak already loaded"; FilePath resources_file_path = GetResourcesFilePath(); - DCHECK(!resources_file_path.empty()) << "chrome.pak not found"; + CHECK(!resources_file_path.empty()) << "chrome.pak not found"; resources_data_ = LoadResourcesDataPak(resources_file_path); - DCHECK(resources_data_) << "failed to load chrome.pak"; + CHECK(resources_data_) << "failed to load chrome.pak"; DCHECK(!locale_resources_data_) << "locale.pak already loaded"; std::string app_locale = l10n_util::GetApplicationLocale(pref_locale); @@ -96,6 +96,6 @@ std::string ResourceBundle::LoadResources(const std::wstring& pref_locale) { return std::string(); } locale_resources_data_ = LoadResourcesDataPak(locale_file_path); - DCHECK(locale_resources_data_) << "failed to load locale.pak"; + CHECK(locale_resources_data_) << "failed to load locale.pak"; return app_locale; } -- cgit v1.1