aboutsummaryrefslogtreecommitdiff
path: root/contrib/jemalloc
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-10-23 21:31:04 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-10-23 21:31:04 +0000
commitcc718496a94d46859a4b762ed297db757c664e2b (patch)
tree97f54f5b194f16164f071e6042a12e733f8c7c42 /contrib/jemalloc
parent3429c02f82da73dd37ae852b857042dbbce35988 (diff)
downloadsrc-cc718496a94d46859a4b762ed297db757c664e2b.tar.gz
src-cc718496a94d46859a4b762ed297db757c664e2b.zip
After jemalloc was updated to version 5.0.0 in r319971, i386 executables
linked with AddressSanitizer (even those linked on earlier versions of FreeBSD, or with external versions of clang) started failing with errors similar to: ==14688==AddressSanitizer CHECK failed: /usr/src/contrib/compiler-rt/lib/asan/asan_poisoning.cc:36 "((AddrIsAlignedByGranularity(addr))) != (0)" (0x0, 0x0) This is because AddressSanitizer expects all the TLS data in the program to be aligned to at least 8 bytes. Before the jemalloc 5.0.0 update, all the TLS data in the i386 version of libc.so added up to 80 bytes (a multiple of 8), but 5.0.0 made this grow to 2404 bytes (not a multiple of 8). This is due to added caching data in jemalloc's internal struct tsd_s. To fix AddressSanitizer, ensure this struct is aligned to at least 16 bytes, which can be done unconditionally for all architectures. (An earlier version of the fix aligned the struct to 8 bytes, but only for ILP32 architectures. This was deemed unnecessarily complicated.) PR: 221337 X-MFC-With: r319971
Notes
Notes: svn path=/head/; revision=324938
Diffstat (limited to 'contrib/jemalloc')
-rw-r--r--contrib/jemalloc/include/jemalloc/internal/tsd.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/jemalloc/include/jemalloc/internal/tsd.h b/contrib/jemalloc/include/jemalloc/internal/tsd.h
index 155a2ec6c44b..fc14f8cea031 100644
--- a/contrib/jemalloc/include/jemalloc/internal/tsd.h
+++ b/contrib/jemalloc/include/jemalloc/internal/tsd.h
@@ -120,7 +120,8 @@ struct tsd_s {
t use_a_getter_or_setter_instead_##n;
MALLOC_TSD
#undef O
-};
+/* AddressSanitizer requires TLS data to be aligned to at least 8 bytes. */
+} JEMALLOC_ALIGNED(16);
/*
* Wrapper around tsd_t that makes it possible to avoid implicit conversion