[PATCH] D40898: [Sanitizers] Basic sanitizer Solaris support (PR 33274)

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 07:50:33 PST 2017


ro created this revision.
ro added a project: Sanitizers.
Herald added subscribers: Sanitizers, fedor.sergeev, krytarowski, kubamracek, jyknight, srhines.

This is the first mostly working version of the Sanitizer port to 32-bit Solaris/x86.
It is currently based on Solaris 11.4 Beta.

This part was initially developed inside libsanitizer in the GCC tree and should apply to
both.  Subsequent parts will address changes to clang, the compiler-rt build system
and testsuite.

I'm not yet sure what the right patch granularity is: if it's profitable to split the patch
up, I'd like to get guidance on how to do so.

Most of the changes are probably straightforward with a few exceptions:

- The Solaris syscall interface isn't stable, undocumented and can change within an OS release.  The stable interface is the libc interface, which I'm using here, if possible using the internal _-prefixed names.

- While the patch primarily target 32-bit x86, I've left a few sparc changes in.  They cannot currently be used with clang due to a backend limitation, but have worked fine inside the gcc tree.

- Some functions (e.g. largefile versions of functions like open64) only exist in 32-bit Solaris, so I've introduced a separate SANITIZER_SOLARIS32 to check for that.

The patch (with the subsequent ones to be submitted shortly) was tested
on i386-pc-solaris2.11.  Only a few failures remain, some of them analyzed, some
still TBD:

   AddressSanitizer-i386-sunos :: TestCases/Posix/concurrent_overflow.cc
   AddressSanitizer-i386-sunos :: TestCases/init-order-atexit.cc
   AddressSanitizer-i386-sunos :: TestCases/log-path_test.cc
   AddressSanitizer-i386-sunos :: TestCases/malloc-no-intercept.c
   AddressSanitizer-i386-sunos-dynamic :: TestCases/Posix/concurrent_overflow.cc
   AddressSanitizer-i386-sunos-dynamic :: TestCases/Posix/start-deactivated.cc
   AddressSanitizer-i386-sunos-dynamic :: TestCases/default_options.cc
   AddressSanitizer-i386-sunos-dynamic :: TestCases/init-order-atexit.cc
   AddressSanitizer-i386-sunos-dynamic :: TestCases/log-path_test.cc
   AddressSanitizer-i386-sunos-dynamic :: TestCases/malloc-no-intercept.c
  
  SanitizerCommon-Unit :: ./Sanitizer-i386-Test/MemoryMappingLayout.DumpListOfModules
   SanitizerCommon-Unit :: ./Sanitizer-i386-Test/SanitizerCommon.PthreadDestructorIterations

Maybe this is good enough the get the ball rolling.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D40898

Files:
  lib/asan/asan_interceptors.h
  lib/asan/asan_linux.cc
  lib/asan/asan_malloc_linux.cc
  lib/interception/interception.h
  lib/interception/interception_linux.cc
  lib/interception/interception_linux.h
  lib/sanitizer_common/sanitizer_common_interceptors.inc
  lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
  lib/sanitizer_common/sanitizer_errno.h
  lib/sanitizer_common/sanitizer_internal_defs.h
  lib/sanitizer_common/sanitizer_linux.cc
  lib/sanitizer_common/sanitizer_linux.h
  lib/sanitizer_common/sanitizer_linux_libcdep.cc
  lib/sanitizer_common/sanitizer_mutex.h
  lib/sanitizer_common/sanitizer_platform.h
  lib/sanitizer_common/sanitizer_platform_interceptors.h
  lib/sanitizer_common/sanitizer_platform_limits_posix.cc
  lib/sanitizer_common/sanitizer_platform_limits_posix.h
  lib/sanitizer_common/sanitizer_posix_libcdep.cc
  lib/sanitizer_common/sanitizer_procmaps.h
  lib/sanitizer_common/sanitizer_procmaps_common.cc
  lib/sanitizer_common/sanitizer_procmaps_solaris.cc
  lib/sanitizer_common/sanitizer_solaris.cc
  lib/sanitizer_common/sanitizer_syscall_generic.inc
  lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc
  lib/ubsan/ubsan_platform.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40898.125728.patch
Type: text/x-patch
Size: 74567 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171206/13cdada8/attachment-0001.bin>


More information about the llvm-commits mailing list