[PATCH] D27654: Stop intercepting mallinfo and mallopt on FreeBSD

Dimitry Andric via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 14:00:09 PST 2017


dim added a comment.

It's pretty weird, on Ubuntu, the lsan changes make exactly one lsan test case fail, with:

  FAIL: LeakSanitizer-Standalone-x86_64 :: TestCases/use_tls_dynamic.cc (30686 of 31782)
  ******************** TEST 'LeakSanitizer-Standalone-x86_64 :: TestCases/use_tls_dynamic.cc' FAILED ********************
  Script:
  --
  LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0:use_ld_allocations=0"
  /home/ubuntu/obj/llvm-293332-trunk-linux4-x86_64-ninja-rel-1/./bin/clang --driver-mode=g++ -O0 -m64 -gline-tables-only /home/ubuntu/src/llvm/trunk/projects/compiler-rt/test/lsan/TestCases/use_tls_dynamic.cc -DBUILD_DSO -fPIC -shared -o /home/ubuntu/obj/llvm-293332-trunk-linux4-x86_64-ninja-rel-1/projects/compiler-rt/test/lsan/X86_64LsanConfig/TestCases/Output/use_tls_dynamic.cc.tmp-so.so
  /home/ubuntu/obj/llvm-293332-trunk-linux4-x86_64-ninja-rel-1/./bin/clang --driver-mode=g++ -O0 -m64 -gline-tables-only -fsanitize=leak -I/home/ubuntu/src/llvm/trunk/projects/compiler-rt/test/lsan/../ /home/ubuntu/src/llvm/trunk/projects/compiler-rt/test/lsan/TestCases/use_tls_dynamic.cc -o /home/ubuntu/obj/llvm-293332-trunk-linux4-x86_64-ninja-rel-1/projects/compiler-rt/test/lsan/X86_64LsanConfig/TestCases/Output/use_tls_dynamic.cc.tmp
  LSAN_OPTIONS=$LSAN_BASE:"use_tls=0" not  /home/ubuntu/obj/llvm-293332-trunk-linux4-x86_64-ninja-rel-1/projects/compiler-rt/test/lsan/X86_64LsanConfig/TestCases/Output/use_tls_dynamic.cc.tmp 2>&1 | FileCheck /home/ubuntu/src/llvm/trunk/projects/compiler-rt/test/lsan/TestCases/use_tls_dynamic.cc
  LSAN_OPTIONS=$LSAN_BASE:"use_tls=1"  /home/ubuntu/obj/llvm-293332-trunk-linux4-x86_64-ninja-rel-1/projects/compiler-rt/test/lsan/X86_64LsanConfig/TestCases/Output/use_tls_dynamic.cc.tmp 2>&1
  LSAN_OPTIONS=""  /home/ubuntu/obj/llvm-293332-trunk-linux4-x86_64-ninja-rel-1/projects/compiler-rt/test/lsan/X86_64LsanConfig/TestCases/Output/use_tls_dynamic.cc.tmp 2>&1
  --
  Exit Code: 23
  
  Command Output (stdout):
  --
  Test alloc: 0x61a000000600
  
  =================================================================
  ==7609==ERROR: LeakSanitizer: detected memory leaks
  
  Direct leak of 1337 byte(s) in 1 object(s) allocated from:
      #0 0x424445 in __interceptor_malloc /home/ubuntu/src/llvm/trunk/projects/compiler-rt/lib/lsan/lsan_interceptors.cc:55:3
      #1 0x425db5 in main /home/ubuntu/src/llvm/trunk/projects/compiler-rt/test/lsan/TestCases/use_tls_dynamic.cc:26:13
      #2 0x7f8d7020182f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
  
  Objects leaked above:
  0x61a000000600 (1337 bytes)
  
  SUMMARY: LeakSanitizer: 1337 byte(s) leaked in 1 allocation(s).
  
  --

I'm not completely clear on what is going wrong here...  Maybe some interceptors get incorrectly disabled on Linux?  And this causes a leak?


https://reviews.llvm.org/D27654





More information about the llvm-commits mailing list