Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5767af0 authored by Steve Fung's avatar Steve Fung Committed by ChromeOS Commit Bot
Browse files

crash: Fix session manager D-Bus call service name

The D-Bus call to session manager was using the incorrect service
name field, causing the crash reporter session lookup to fail and
fallback to placing the crash in /home/chronos/crash.  Fix the
D-Bus call so that crashes are put in the right place.

Also, fixing this exposed an error with processing the results.
The previous D-Bus code treated an empty session response the
same as a D-Bus connection error, with the new code D-Bus errors
are handled separately, so also check whether the returned array
is empty.

BUG=chromium:458330
TEST=triggered crash with 'chrome://crash' page; crash files are
     placed in /home/chronos/user/crash
TEST=`test_that -b panther <IP> logging_UserCrash` passes

Change-Id: I77733adc5e4287d9eae83a749818d9cc38398c80
Reviewed-on: https://chromium-review.googlesource.com/249800


Reviewed-by: default avatarDan Erat <derat@chromium.org>
Tested-by: default avatarSteve Fung <stevefung@chromium.org>
Commit-Queue: Steve Fung <stevefung@chromium.org>
parent 6e139522
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ void CrashCollector::SetUpDBus() {
  session_manager_proxy_.reset(
      new org::chromium::SessionManagerInterfaceProxy(
          bus_,
          login_manager::kSessionManagerInterface));
          login_manager::kSessionManagerServiceName));
}

int CrashCollector::WriteNewFile(const FilePath &filename,
@@ -189,7 +189,7 @@ FilePath CrashCollector::GetUserCrashPath() {
  // first result we get back.
  FilePath user_path = FilePath(kFallbackUserCrashPath);
  std::map<std::string, std::string> active_sessions;
  if (!GetActiveUserSessions(&active_sessions)) {
  if (!GetActiveUserSessions(&active_sessions) || active_sessions.empty()) {
    LOG(ERROR) << "Could not get active user sessions, using default.";
    return user_path;
  }