From ecd727f3866efa8894155787cf29537a7a582987 Mon Sep 17 00:00:00 2001 From: "ted.mielczarek@gmail.com" Date: Fri, 17 May 2013 19:50:00 +0000 Subject: Ensure a proper LinuxDumper::crash_thread_ value Patch by Mike Hommey , R=me at https://breakpad.appspot.com/582002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1185 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/linux/minidump_writer/linux_dumper.cc | 2 +- src/client/linux/minidump_writer/minidump_writer_unittest.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/client/linux/minidump_writer') diff --git a/src/client/linux/minidump_writer/linux_dumper.cc b/src/client/linux/minidump_writer/linux_dumper.cc index 6a75ba94..e5a341ca 100644 --- a/src/client/linux/minidump_writer/linux_dumper.cc +++ b/src/client/linux/minidump_writer/linux_dumper.cc @@ -73,7 +73,7 @@ LinuxDumper::LinuxDumper(pid_t pid) : pid_(pid), crash_address_(0), crash_signal_(0), - crash_thread_(0), + crash_thread_(pid), threads_(&allocator_, 8), mappings_(&allocator_), auxv_(&allocator_, AT_MAX + 1) { diff --git a/src/client/linux/minidump_writer/minidump_writer_unittest.cc b/src/client/linux/minidump_writer/minidump_writer_unittest.cc index 7d6b8667..9b7d73c0 100644 --- a/src/client/linux/minidump_writer/minidump_writer_unittest.cc +++ b/src/client/linux/minidump_writer/minidump_writer_unittest.cc @@ -84,7 +84,7 @@ TEST(MinidumpWriterTest, SetupWithPath) { AutoTempDir temp_dir; string templ = temp_dir.path() + kMDWriterUnitTestFileName; // Set a non-zero tid to avoid tripping asserts. - context.tid = 1; + context.tid = child; ASSERT_TRUE(WriteMinidump(templ.c_str(), child, &context, sizeof(context))); struct stat st; ASSERT_EQ(0, stat(templ.c_str(), &st)); @@ -114,7 +114,7 @@ TEST(MinidumpWriterTest, SetupWithFD) { string templ = temp_dir.path() + kMDWriterUnitTestFileName; int fd = open(templ.c_str(), O_CREAT | O_WRONLY, S_IRWXU); // Set a non-zero tid to avoid tripping asserts. - context.tid = 1; + context.tid = child; ASSERT_TRUE(WriteMinidump(fd, child, &context, sizeof(context))); struct stat st; ASSERT_EQ(0, stat(templ.c_str(), &st)); @@ -391,7 +391,7 @@ TEST(MinidumpWriterTest, DeletedBinary) { string templ = temp_dir.path() + kMDWriterUnitTestFileName; // Set a non-zero tid to avoid tripping asserts. - context.tid = 1; + context.tid = child_pid; ASSERT_TRUE(WriteMinidump(templ.c_str(), child_pid, &context, sizeof(context))); kill(child_pid, SIGKILL); -- cgit v1.2.1