[PATCH] D39473: [sanitizers] Increase alignment of low level allocator

Walter Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 16 16:53:44 PST 2017


waltl added a comment.

In https://reviews.llvm.org/D39473#928001, @alekseyshl wrote:

> Why do we need this at all for internal allocator? It's internal to sanitizer and sanitizer code is not instrumented, that means no shadow.


Here is a typical backtrace.  It seems that asan installs a callback to the internal allocator that poisons those memory.

#0  0xf7fd7c89 in __kernel_vsyscall ()
#1  0xf7e3c627 in syscall () from /lib/i386-linux-gnu/libc.so.6
#2  0x0811c3cc in __sanitizer::internal_sched_yield() () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:401
#3  0x08062c75 in LockSlow () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/asan/../sanitizer_common/sanitizer_mutex.h:55
#4  0x08129696 in Lock () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/sanitizer_common/sanitizer_mutex.h:32
#5  GenericScopedLock () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/sanitizer_common/sanitizer_mutex.h:187
#6  GetOrInit () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc:21
#7  0x08128147 in Print () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc:35
#8  0x0810f31f in AsanCheckFailed () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/asan/asan_rtl.cc:69
#9  0x08124884 in CheckFailed () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/sanitizer_common/sanitizer_termination.cc:79
#10 0x08108b26 in PoisonShadow () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/asan/asan_poisoning.cc:38
#11 0x0810f355 in __asan::OnLowLevelAllocate(unsigned long, unsigned long) () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/asan/asan_rtl.cc:89
#12 0x0811328b in Allocate () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc:193
#13 0x0812b49a in operator new () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/sanitizer_common/sanitizer_common.h:937
#14 ChooseExternalSymbolizer () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:486
#15 ChooseSymbolizerTools () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:516
#16 PlatformInit () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:529
#17 0x081296aa in GetOrInit () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc:24
#18 0x0812b635 in LateInitialize () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:534
#19 0x0810ee62 in AsanInitInternal () at /usr/local/google/home/waltl/Work/llvm-scale5/scale5/compiler-rt/lib/asan/asan_rtl.cc:479
#20 0xf7fe8de4 in ?? () from /lib/ld-linux.so.2
#21 0xf7fd9a5f in ?? () from /lib/ld-linux.so.2


https://reviews.llvm.org/D39473





More information about the llvm-commits mailing list