[PATCH] D64057: Add NetBSD/amd64 LSan support

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 1 19:34:30 PDT 2019


krytarowski added a comment.

This code in general works.. however the tests are not compatible with NetBSD.

Please see:

  $ env LSAN_OPTIONS=report_objects=1:use_stacks=1:use_registers=1 /public/llvm-build/projects/compiler-rt/test/lsan/X86_64LsanConfig/TestCases/Output/use_unaligned.cc.tmp
  Test alloc: 0x61a000000000 
  
  =================================================================
  ==6705==ERROR: LeakSanitizer: detected memory leaks
  
  Direct leak of 1337 byte(s) in 1 object(s) allocated from:
      #0 0x4048f5 in malloc /public/llvm/projects/compiler-rt/lib/lsan/lsan_interceptors.cc:54:3
      #1 0x41e308 in main /public/compiler-rt/test/lsan/TestCases/use_unaligned.cc:15:13
      #2 0x4032bc in ___start (/public/llvm-build/projects/compiler-rt/test/lsan/X86_64LsanConfig/TestCases/Output/use_unaligned.cc.tmp+0x4032bc)
  
  Objects leaked above:
  0x61a000000000 (1337 bytes)
  
  SUMMARY: LeakSanitizer: 1337 byte(s) leaked in 1 allocation(s).



  $ env LSAN_OPTIONS=report_objects=1:use_stacks=0:use_registers=1 /public/llvm-build/projects/compiler-rt/test/lsan/X86_64LsanConfig/TestCases/Output/use_unaligned.cc.tmp
  Test alloc: 0x61a000000000 
  
  =================================================================
  ==6026==ERROR: LeakSanitizer: detected memory leaks
  
  Direct leak of 1337 byte(s) in 1 object(s) allocated from:
      #0 0x4048f5 in malloc /public/llvm/projects/compiler-rt/lib/lsan/lsan_interceptors.cc:54:3
      #1 0x41e308 in main /public/compiler-rt/test/lsan/TestCases/use_unaligned.cc:15:13
      #2 0x4032bc in ___start (/public/llvm-build/projects/compiler-rt/test/lsan/X86_64LsanConfig/TestCases/Output/use_unaligned.cc.tmp+0x4032bc)
  
  Objects leaked above:
  0x61a000000000 (1337 bytes)
  
  Direct leak of 32 byte(s) in 1 object(s) allocated from:
      #0 0x4048f5 in malloc /public/llvm/projects/compiler-rt/lib/lsan/lsan_interceptors.cc:54:3
      #1 0x7f7ff6160e67 in atexit_handler_alloc /usr/src/lib/libc/stdlib/atexit.c:112
      #2 0x7f7ff6160e67 in __cxa_atexit_internal /usr/src/lib/libc/stdlib/atexit.c:158
  
  Objects leaked above:
  0x602000000000 (32 bytes)
  
  Indirect leak of 128 byte(s) in 4 object(s) allocated from:
      #0 0x4048f5 in malloc /public/llvm/projects/compiler-rt/lib/lsan/lsan_interceptors.cc:54:3
      #1 0x7f7ff6160e67 in atexit_handler_alloc /usr/src/lib/libc/stdlib/atexit.c:112
      #2 0x7f7ff6160e67 in __cxa_atexit_internal /usr/src/lib/libc/stdlib/atexit.c:158
  
  Objects leaked above:
  0x602000000020 (32 bytes)
  0x602000000040 (32 bytes)
  0x602000000060 (32 bytes)
  0x602000000080 (32 bytes)
  
  SUMMARY: LeakSanitizer: 1497 byte(s) leaked in 6 allocation(s).

This causes breakage in all LSan tests. What should we do with this? Is there need to fix something in LSan? Tune the tests?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64057/new/

https://reviews.llvm.org/D64057





More information about the llvm-commits mailing list