user_collector: use %P instead of %p
The latter will give us the PID as seen in the current PID namespace, but since the crash handler always runs in the top most PID namespace, that is meaningless to us. Instead, use the %P option so we see the PID in the top most namespace. BUG=chromium:351568 TEST=`cbuildbot amd64-generic-full` passes # linux-3.10 TEST=`cbuildbot x86-alex-release` passes # linux-3.4 TEST=`cbuildbot link-release` passes # linux-3.8 CQ-DEPEND=CL:190011 CQ-DEPEND=CL:190020 CQ-DEPEND=CL:190012 CQ-DEPEND=CL:190021 Change-Id: Ic619c4e7514e2824f7ba31b73cb9e11ec4092774 Reviewed-on: https://chromium-review.googlesource.com/190010 Reviewed-by: Ben Chan <benchan@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
d24164e255
commit
bfdf4a8913
2 changed files with 2 additions and 2 deletions
|
|
@ -107,7 +107,7 @@ std::string UserCollector::GetPattern(bool enabled) const {
|
|||
// the size of the invocation line for crash_reporter, since the kernel
|
||||
// has a fixed-sized (128B) buffer for it (before parameter expansion).
|
||||
// Note that the kernel does not support quoted arguments in core_pattern.
|
||||
return StringPrintf("|%s --user=%%p:%%s:%%u:%%e", our_path_.c_str());
|
||||
return StringPrintf("|%s --user=%%P:%%s:%%u:%%e", our_path_.c_str());
|
||||
} else {
|
||||
return "core";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class UserCollectorTest : public ::testing::Test {
|
|||
|
||||
TEST_F(UserCollectorTest, EnableOK) {
|
||||
ASSERT_TRUE(collector_.Enable());
|
||||
ExpectFileEquals("|/my/path --user=%p:%s:%u:%e", "test/core_pattern");
|
||||
ExpectFileEquals("|/my/path --user=%P:%s:%u:%e", "test/core_pattern");
|
||||
ExpectFileEquals("4", "test/core_pipe_limit");
|
||||
ASSERT_EQ(s_crashes, 0);
|
||||
EXPECT_TRUE(FindLog("Enabling user crash handling"));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue