gopalshankar / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

fix use_sigaltstack flag and consider enabling it by default. #224

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
See the discussion at 
http://comments.gmane.org/gmane.comp.compilers.clang.devel/31810

Today, use_sigaltstack is broken for large apps, e.g. on Chrome it gives me 
this:
==6206==AddressSanitizer CHECK failed: 
...llvm/projects/compiler-rt/lib/asan/asan_posix.cc:110 "((tsd_key_inited)) != 
(0)" (0x0, 0x0)

Also, use_sigaltstack has a non-zero cost in RAM (currently, 32K per thread),
so enabling it by default may degrade memory efficiency for some users.

Original issue reported on code.google.com by konstant...@gmail.com on 18 Sep 2013 at 9:37

GoogleCodeExporter commented 9 years ago
Today I see the following failure on chrome:

ASAN_OPTIONS=use_sigaltstack=1  ./out/Release/chrome --user-data-dir=zzz 
lenta.ru  
../../content/common/sandbox_seccomp_bpf_linux.cc:**CRASHING**:seccomp-bpf 
failure in syscall 0131
ASAN:SIGSEGV
=================================================================
==9==ERROR: AddressSanitizer: SEGV on unknown address 0x00000d800083 (pc 
0x7fa8f352a475 sp 0x7fa8d53e1380 bp 0x7fa8d53e1450 T1)
AddressSanitizer can not provide additional info.
    #0 0x7fa8f352a474 in PrintSyscallError  content/common/sandbox_seccomp_bpf_linux.cc:134
    #1 0x7fa8f352a474 in (anonymous namespace)::CrashSIGSYS_Handler(playground2::arch_seccomp_data const&, void*) content/common/sandbox_seccomp_bpf_linux.cc:148
    #2 0x7fa8f4803566 in playground2::Trap::SigSys(int, siginfo*, void*)  sandbox/linux/seccomp-bpf/trap.cc:203
    #3 0x7fa8e107dcaf (/lib/x86_64-linux-gnu/libpthread.so.0+0xfcaf)
    #4 0x7fa8dfc1fef6 (/lib/x86_64-linux-gnu/libc.so.6+0x36ef6)
    #5 0x7fa8e92ff30f in __asan::SetAlternateSignalStack() /home/kcc/llvm/projects/compiler-rt/lib/asan/asan_posix.cc:63

Alex, please check what can be done with the sanbox. 

Original comment by konstant...@gmail.com on 3 Oct 2013 at 9:26

GoogleCodeExporter commented 9 years ago
http://llvm.org/viewvc/llvm-project?view=revision&revision=207099 enables 
use_sigaltstack=1

If this still does not play well with chrome's sandbox we'll need to disable 
use_sigaltstack specifically for chrome

Original comment by konstant...@gmail.com on 24 Apr 2014 at 12:03

GoogleCodeExporter commented 9 years ago
For the record, __NR_sigaltstack has been whitelisted in ASan Chromium builds.

Original comment by gli...@chromium.org on 15 Sep 2014 at 4:24