summaryrefslogtreecommitdiff
path: root/tests/malloc_test.cpp
diff options
context:
space:
mode:
authorRyan Savitski <rsavitski@google.com>2020-01-16 16:04:08 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-01-16 16:04:08 +0000
commitb72fed164ed633525e0376087e51daa4652f8e16 (patch)
tree4be0bd67d4bb77165314c7495b79a02f5f3cfaf3 /tests/malloc_test.cpp
parentc9bde27fbb7f60246532c20d06a08b8af6d95790 (diff)
parent175c8867b05ec14a8da1fd528c2bf17c4e67c280 (diff)
Merge "allow for heapprofd's signal to be multiplexed"
Diffstat (limited to 'tests/malloc_test.cpp')
-rw-r--r--tests/malloc_test.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/malloc_test.cpp b/tests/malloc_test.cpp
index ebbd24793..c7050dc68 100644
--- a/tests/malloc_test.cpp
+++ b/tests/malloc_test.cpp
@@ -18,14 +18,15 @@
#include <elf.h>
#include <limits.h>
+#include <malloc.h>
#include <pthread.h>
+#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
-#include <malloc.h>
#include <unistd.h>
#include <atomic>
@@ -962,7 +963,11 @@ static void SetAllocationLimitMultipleThreads() {
// Let them go all at once.
go = true;
- ASSERT_EQ(0, kill(getpid(), __SIGRTMIN + 4));
+ // Send hardcoded signal (BIONIC_SIGNAL_PROFILER with value 0) to trigger
+ // heapprofd handler.
+ union sigval signal_value;
+ signal_value.sival_int = 0;
+ ASSERT_EQ(0, sigqueue(getpid(), __SIGRTMIN + 4, signal_value));
size_t num_successful = 0;
for (size_t i = 0; i < kNumThreads; i++) {