Merge "malloc_hooks README.md: fix example compilation failures"
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
index 11d9fe6..b4223ea 100644
--- a/PREUPLOAD.cfg
+++ b/PREUPLOAD.cfg
@@ -1,8 +1,9 @@
-[Hook Scripts]
-notice = tools/update_notice.sh
-
[Builtin Hooks]
clang_format = true
[Builtin Hooks Options]
clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp
+
+[Hook Scripts]
+aosp_hook = ${REPO_ROOT}/frameworks/base/tools/aosp/aosp_sha.sh ${PREUPLOAD_COMMIT} "."
+notice = tools/update_notice.sh
diff --git a/libc/Android.bp b/libc/Android.bp
index a5442e1..f73ae4a 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -1701,6 +1701,7 @@
symbol_file: "libc.map.txt",
versions: [
"29",
+ "R",
"10000",
],
},
diff --git a/libc/malloc_debug/tests/malloc_debug_system_tests.cpp b/libc/malloc_debug/tests/malloc_debug_system_tests.cpp
index dd569fd..ac19cf9 100644
--- a/libc/malloc_debug/tests/malloc_debug_system_tests.cpp
+++ b/libc/malloc_debug/tests/malloc_debug_system_tests.cpp
@@ -40,7 +40,7 @@
#include <android-base/file.h>
#include <android-base/stringprintf.h>
#include <gtest/gtest.h>
-#include <log/log.h>
+#include <log/log_read.h>
#include <string>
#include <thread>
diff --git a/libc/private/ScopedSignalBlocker.h b/libc/private/ScopedSignalBlocker.h
index ce0ae64..f6ba9ed 100644
--- a/libc/private/ScopedSignalBlocker.h
+++ b/libc/private/ScopedSignalBlocker.h
@@ -20,20 +20,26 @@
#include "platform/bionic/macros.h"
+// This code needs to really block all the signals, not just the user-visible
+// ones. We call __rt_sigprocmask(2) directly so we don't mask out our own
+// signals (https://issuetracker.google.com/153624226 was a pthread_exit(3)
+// crash because a request to dump the thread's stack came in as it was exiting).
+extern "C" int __rt_sigprocmask(int, const sigset64_t*, sigset64_t*, size_t);
+
class ScopedSignalBlocker {
public:
// Block all signals.
explicit ScopedSignalBlocker() {
sigset64_t set;
sigfillset64(&set);
- sigprocmask64(SIG_BLOCK, &set, &old_set_);
+ __rt_sigprocmask(SIG_BLOCK, &set, &old_set_, sizeof(sigset64_t));
}
// Block just the specified signal.
explicit ScopedSignalBlocker(int signal) {
sigset64_t set = {};
sigaddset64(&set, signal);
- sigprocmask64(SIG_BLOCK, &set, &old_set_);
+ __rt_sigprocmask(SIG_BLOCK, &set, &old_set_, sizeof(sigset64_t));
}
~ScopedSignalBlocker() {
@@ -41,7 +47,7 @@
}
void reset() {
- sigprocmask64(SIG_SETMASK, &old_set_, nullptr);
+ __rt_sigprocmask(SIG_SETMASK, &old_set_, nullptr, sizeof(sigset64_t));
}
sigset64_t old_set_;