Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(991)

Unified Diff: crash_reporter.cc

Issue 3976001: crash-reporter: avoid deadlock if dbus-daemon is hanging (Closed) Base URL: http://git.chromium.org/git/crash-reporter.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crash_reporter.cc
diff --git a/crash_reporter.cc b/crash_reporter.cc
index d8583869804278bd492e82a63171bd024d3054e5..2f8e987dba4f37d40492837627d1bb4315637cd6 100644
--- a/crash_reporter.cc
+++ b/crash_reporter.cc
@@ -67,7 +67,7 @@ static void CountUserCrash() {
kCrashKindUser,
kCrashKindMax);
std::string command = StringPrintf(
- "/usr/bin/dbus-send --type=signal --system / \"%s\"",
+ "/usr/bin/dbus-send --type=signal --system / \"%s\" &",
kUserCrashSignal);
// Announce through D-Bus whenever a user crash happens. This is
// used by the metrics daemon to log active use time between
@@ -77,8 +77,18 @@ static void CountUserCrash() {
// using a dbus library directly. However, this should run
// relatively rarely and longer term we may need to implement a
// better way to do this that doesn't rely on D-Bus.
-
- int status __attribute__((unused)) = system(command.c_str());
+ //
+ // We run in the background in case dbus daemon itself is crashed
+ // and not responding. This allows us to not block and potentially
+ // deadlock on a dbus-daemon crash. If dbus-daemon crashes without
+ // restarting, each crash will fork off a lot of dbus-send
+ // processes. Such a system is in a unusable state and will need
+ // to be restarted anyway.
+
+ int status = system(command.c_str());
+ if (status != 0) {
+ s_system_log.LogWarning("dbus-send running failed");
+ }
}
static int Initialize(KernelCollector *kernel_collector,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698