diff options
author | Tobias Sargeant <tobiasjs@google.com> | 2017-02-24 19:58:13 +0000 |
---|---|---|
committer | Tobias Sargeant <tobiasjs@chromium.org> | 2017-02-24 19:59:03 +0000 |
commit | ccf03c13ebfae7dec60e28c9a07decc78a43549a (patch) | |
tree | f63ac51437824c134dabc6f99e0289b62a65941e /src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc | |
parent | Handle ntdll only emitting PUBLIC at func entry (diff) | |
download | breakpad-ccf03c13ebfae7dec60e28c9a07decc78a43549a.tar.xz |
Improve stack sanitization unittests.
Rather than relying on the process stack having all the things that
should/shouldn't be sanitized, create synthetic stacks to test all of
the important cases.
BUG=664460
Change-Id: I959266390e94d6fb83ca8ef11ac19fac89e68c31
Reviewed-on: https://chromium-review.googlesource.com/446108
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Diffstat (limited to 'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc')
-rw-r--r-- | src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc b/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc index 4ccb7201..3ad48e50 100644 --- a/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc +++ b/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc @@ -57,14 +57,15 @@ void *thread_function(void *data) { int pipefd = *static_cast<int *>(data); - volatile pid_t thread_id = syscall(__NR_gettid); + volatile pid_t* thread_id = new pid_t; + *thread_id = syscall(__NR_gettid); // Signal parent that a thread has started. uint8_t byte = 1; if (write(pipefd, &byte, sizeof(byte)) != sizeof(byte)) { perror("ERROR: parent notification failed"); return NULL; } - register volatile pid_t *thread_id_ptr asm(TID_PTR_REGISTER) = &thread_id; + register volatile pid_t *thread_id_ptr asm(TID_PTR_REGISTER) = thread_id; while (true) asm volatile ("" : : "r" (thread_id_ptr)); return NULL; |