aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2017-09-26 11:39:36 -0700
committerElliott Hughes <enh@google.com>2017-09-27 16:29:42 +0000
commitf2a1b12f2e689c2ef116c955f42c640f5c344487 (patch)
treeb534185587562a687124834f1b443cd42e694ec1
parent52cd1e7a4202799d71f2400381e94307599aef5b (diff)
downloadbionic-f2a1b12f2e689c2ef116c955f42c640f5c344487.tar.gz
Include strerror(errno) in __init_tls abort messages.
Bug: http://b/66911122 Bug: 64709603 (presubmit balking at the line above) Test: ran tests Change-Id: I068a388f8ea31012e7e07e8bded1c113796a8440 Merged-In: I068a388f8ea31012e7e07e8bded1c113796a8440
-rw-r--r--libc/bionic/pthread_create.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/bionic/pthread_create.cpp b/libc/bionic/pthread_create.cpp
index 9197aa3fe..ff972c3ec 100644
--- a/libc/bionic/pthread_create.cpp
+++ b/libc/bionic/pthread_create.cpp
@@ -59,13 +59,13 @@ void __init_tls(pthread_internal_t* thread) {
size_t allocation_size = BIONIC_TLS_SIZE + 2 * PAGE_SIZE;
void* allocation = mmap(nullptr, allocation_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (allocation == MAP_FAILED) {
- async_safe_fatal("failed to allocate TLS");
+ async_safe_fatal("failed to allocate TLS: %s", strerror(errno));
}
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, allocation, allocation_size, "bionic TLS guard page");
thread->bionic_tls = reinterpret_cast<bionic_tls*>(static_cast<char*>(allocation) + PAGE_SIZE);
if (mprotect(thread->bionic_tls, BIONIC_TLS_SIZE, PROT_READ | PROT_WRITE) != 0) {
- async_safe_fatal("failed to mprotect TLS");
+ async_safe_fatal("failed to mprotect TLS: %s", strerror(errno));
}
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, thread->bionic_tls, BIONIC_TLS_SIZE, "bionic TLS");
}