Compare commits
13 Commits
android-6.
...
android-6.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
420e371107 | ||
![]() |
f315961aee | ||
![]() |
c01f421b18 | ||
![]() |
c7ebaf57ab | ||
![]() |
e88c453695 | ||
![]() |
a25c04b736 | ||
![]() |
ba95d8a02b | ||
![]() |
572651dbb2 | ||
![]() |
aa553fe465 | ||
![]() |
e89c2048d6 | ||
![]() |
2fdf2ea2b1 | ||
![]() |
aae28448f2 | ||
![]() |
d1b93d0823 |
@@ -130,13 +130,8 @@ __LIBC_HIDDEN__ void pthread_key_clean_all(void);
|
||||
*/
|
||||
#define PTHREAD_STACK_SIZE_DEFAULT ((1 * 1024 * 1024) - SIGSTKSZ)
|
||||
|
||||
// Leave room for a guard page in the internally created signal stacks.
|
||||
#if defined(__LP64__)
|
||||
// SIGSTKSZ is not big enough for 64-bit arch. See http://b/23041777.
|
||||
#define SIGNAL_STACK_SIZE (16 * 1024 + PAGE_SIZE)
|
||||
#else
|
||||
/* Leave room for a guard page in the internally created signal stacks. */
|
||||
#define SIGNAL_STACK_SIZE (SIGSTKSZ + PAGE_SIZE)
|
||||
#endif
|
||||
|
||||
/* Needed by fork. */
|
||||
__LIBC_HIDDEN__ extern void __bionic_atfork_run_prepare();
|
||||
|
@@ -27,7 +27,6 @@
|
||||
#include <sys/syscall.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <unwind.h>
|
||||
|
||||
#include <atomic>
|
||||
#include <regex>
|
||||
@@ -1572,26 +1571,3 @@ TEST_F(pthread_DeathTest, pthread_mutex_unlock_null_64) {
|
||||
GTEST_LOG_(INFO) << "This test tests bionic implementation details on 64 bit devices.";
|
||||
#endif
|
||||
}
|
||||
|
||||
extern _Unwind_Reason_Code FrameCounter(_Unwind_Context* ctx, void* arg);
|
||||
|
||||
static volatile bool signal_handler_on_altstack_done;
|
||||
|
||||
static void SignalHandlerOnAltStack(int signo, siginfo_t*, void*) {
|
||||
ASSERT_EQ(SIGUSR1, signo);
|
||||
// Check if we have enough stack space for unwinding.
|
||||
int count = 0;
|
||||
_Unwind_Backtrace(FrameCounter, &count);
|
||||
ASSERT_GT(count, 0);
|
||||
// Check if we have enough stack space for logging.
|
||||
std::string s(2048, '*');
|
||||
GTEST_LOG_(INFO) << s;
|
||||
signal_handler_on_altstack_done = true;
|
||||
}
|
||||
|
||||
TEST(pthread, big_enough_signal_stack_for_64bit_arch) {
|
||||
signal_handler_on_altstack_done = false;
|
||||
ScopedSignalHandler handler(SIGUSR1, SignalHandlerOnAltStack, SA_SIGINFO | SA_ONSTACK);
|
||||
kill(getpid(), SIGUSR1);
|
||||
ASSERT_TRUE(signal_handler_on_altstack_done);
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#define noinline __attribute__((__noinline__))
|
||||
#define __unused __attribute__((__unused__))
|
||||
|
||||
_Unwind_Reason_Code FrameCounter(_Unwind_Context* ctx __unused, void* arg) {
|
||||
static _Unwind_Reason_Code FrameCounter(_Unwind_Context* ctx __unused, void* arg) {
|
||||
int* count_ptr = reinterpret_cast<int*>(arg);
|
||||
|
||||
#if SHOW_FRAME_LOCATIONS
|
||||
|
Reference in New Issue
Block a user