[PATCH] [sanitizer] Decorate /proc/self/maps.

Evgeniy Stepanov eugenis at google.com
Tue May 26 14:14:30 PDT 2015


Hi kcc, samsonov, dvyukov,

Add descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.
This is done by creating a named shared memory region, unlinking it and setting up a private (i.e. copy-on-write) mapping of that instead of a regular anonymous mapping. I've experimented with regular (sparse) files, but they can not be scaled to the size of MSan shadow mapping, at least on Linux/X86_64 and ext3 fs.

Controlled by a common flag, decorate_proc_maps, disabled by default.

This patch has a few shortcomings:
- not all mappings are annotated, especially in TSan.
- out handling of memset() of shadow via mmap() puts small anonymous mappings inside larger named mappings, which looks ugly and can, in theory, hit the mapping number limit.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D10039

Files:
  cmake/config-ix.cmake
  lib/asan/CMakeLists.txt
  lib/asan/asan_internal.h
  lib/asan/asan_poisoning.h
  lib/asan/asan_rtl.cc
  lib/asan/tests/CMakeLists.txt
  lib/msan/msan_linux.cc
  lib/sanitizer_common/sanitizer_common.h
  lib/sanitizer_common/sanitizer_flags.inc
  lib/sanitizer_common/sanitizer_posix.cc
  lib/sanitizer_common/sanitizer_win.cc
  lib/tsan/go/buildgo.sh
  lib/tsan/rtl/tsan_platform_linux.cc
  lib/tsan/rtl/tsan_rtl.cc
  lib/tsan/rtl/tsan_rtl.h
  test/asan/TestCases/Posix/decorate_proc_maps.cc
  test/msan/decorate_proc_maps.cc
  test/tsan/decorate_proc_maps.cc
  test/utils/utils.h

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10039.26535.patch
Type: text/x-patch
Size: 19612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150526/c497e056/attachment.bin>


More information about the llvm-commits mailing list