Commit 6d44793d authored by Jüri Valdmann's avatar Jüri Valdmann Committed by Commit Bot

Skip deleted object files in POSIX base::debug::StackTrace

The file names read from /proc/self/maps can contain a special " (deleted)"
suffix to indicate that the file has been deleted (unlinked). This is expected
and should not trigger a LOG(WARNING).

Change-Id: Ia96b3bf1894c8fbd6bfa0c217bc8a01bbb59d750
Reviewed-on: https://chromium-review.googlesource.com/1186622Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586334}
parent d69c73b5
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include "base/numerics/safe_conversions.h" #include "base/numerics/safe_conversions.h"
#include "base/posix/eintr_wrapper.h" #include "base/posix/eintr_wrapper.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "build/build_config.h" #include "build/build_config.h"
#if defined(USE_SYMBOLIZE) #if defined(USE_SYMBOLIZE)
...@@ -690,6 +691,11 @@ class SandboxSymbolizeHelper { ...@@ -690,6 +691,11 @@ class SandboxSymbolizeHelper {
// Skip pseudo-paths, like [stack], [vdso], [heap], etc ... // Skip pseudo-paths, like [stack], [vdso], [heap], etc ...
continue; continue;
} }
if (base::EndsWith(region.path, " (deleted)",
base::CompareCase::SENSITIVE)) {
// Skip deleted files.
continue;
}
// Avoid duplicates. // Avoid duplicates.
if (modules_.find(region.path) == modules_.end()) { if (modules_.find(region.path) == modules_.end()) {
int fd = open(region.path.c_str(), O_RDONLY | O_CLOEXEC); int fd = open(region.path.c_str(), O_RDONLY | O_CLOEXEC);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment