summaryrefslogtreecommitdiffstats
path: root/crypto/nss_util.cc
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-15 05:41:25 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-15 05:41:25 +0000
commit716fb110ec3417b5ba217467df7752f7b38efad7 (patch)
tree84d9e99630793c4bcb4485a46b454ec1902f4893 /crypto/nss_util.cc
parented22978e0be8e4fe2b94315970e1bcef3359b159 (diff)
downloadchromium_src-716fb110ec3417b5ba217467df7752f7b38efad7.zip
chromium_src-716fb110ec3417b5ba217467df7752f7b38efad7.tar.gz
chromium_src-716fb110ec3417b5ba217467df7752f7b38efad7.tar.bz2
Force a crash with error info on NSS_NoDB_Init failure.
R=eroman@chromium.org,rsleevi@chromium.org BUG=153281 TEST=none Review URL: https://chromiumcodereview.appspot.com/11358256 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167871 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto/nss_util.cc')
-rw-r--r--crypto/nss_util.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/crypto/nss_util.cc b/crypto/nss_util.cc
index 6af70a4..9933d30 100644
--- a/crypto/nss_util.cc
+++ b/crypto/nss_util.cc
@@ -23,6 +23,7 @@
#include <vector>
+#include "base/debug/alias.h"
#include "base/environment.h"
#include "base/file_path.h"
#include "base/file_util.h"
@@ -224,6 +225,13 @@ base::LazyInstance<NSPRInitSingleton>::Leaky
// deleted if it were a regular member.
base::LazyInstance<ScopedTempDir> g_test_nss_db_dir = LAZY_INSTANCE_INITIALIZER;
+// Force a crash to debug http://crbug.com/153281.
+void CrashWithErrors(int nss_error, int os_error) {
+ base::debug::Alias(&nss_error);
+ base::debug::Alias(&os_error);
+ CHECK(false) << "nss_error=" << nss_error << ", os_error=" << os_error;
+}
+
class NSSInitSingleton {
public:
#if defined(OS_CHROMEOS)
@@ -449,8 +457,13 @@ class NSSInitSingleton {
if (nodb_init) {
status = NSS_NoDB_Init(NULL);
if (status != SECSuccess) {
+ // Force a crash with error info to debug http://crbug.com/153281.
+ int nss_error = PR_GetError();
+ int os_error = PR_GetOSError();
LOG(ERROR) << "Error initializing NSS without a persistent "
"database: " << GetNSSErrorMessage();
+ CrashWithErrors(nss_error, os_error);
+ return;
}
#if defined(OS_IOS)
root_ = InitDefaultRootCerts();