summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_procmaps_linux.cc
AgeCommit message (Collapse)Author
2017-11-28[LSan] Fix one source of stale segments in the process memory mapping.Alex Shlyapnikov
Summary: Load process memory map after updating the same cache to reflect the umap happening in the process of updating. Also clear out the buffer in case of failed read of /proc/self/maps (not the source of stale segments, but can lead to the similar crash). Reviewers: eugenis Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D40529 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319237 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22Removed platform-specific ifdefs from sanitizer_procmaps.hFrancis Ricci
Summary: Removed platform-specific ifdefs for linux, mac, freebsd and netbsd from sanitizer_procmaps.h Patch by Yicheng Wang <yichengfb@fb.com> Reviewers: kcc, kubamracek, alekseyshl, fjricci, vitalybuka Reviewed By: fjricci, vitalybuka Subscribers: vitalybuka, emaste, krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D38098 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313999 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11Use internal_strncpy to copy filename in linux procmapsFrancis Ricci
Cleaner than using a while loop to copy the string character by character. Reviewers: alekseyshl, glider Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35136 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307696 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11Refactor MemoryMappingLayout::Next to use a single struct instead of output ↵Francis Ricci
parameters. NFC. Summary: This is the first in a series of patches to refactor sanitizer_procmaps to allow MachO section information to be exposed on darwin. In addition, grouping all segment information in a single struct is cleaner than passing it through a large set of output parameters, and avoids the need for annotations of NULL parameters for unneeded information. The filename string is optional and must be managed and supplied by the calling function. This is to allow the MemoryMappedSegment struct to be stored on the stack without causing overly large stack sizes. Reviewers: alekseyshl, kubamracek, glider Subscribers: emaste, llvm-commits Differential Revision: https://reviews.llvm.org/D35135 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307688 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15[asan] make asan under sandboxes more robustKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303132 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02[sanitizer] Track architecture and UUID of modules in LoadedModuleKuba Mracek
When we enumerate loaded modules, we only track the module name and base address, which then has several problems on macOS. Dylibs and executables often have several architecture slices and not storing which architecture/UUID is actually loaded creates problems with symbolication: A file path + offset isn't enough to correctly symbolicate, since the offset can be valid in multiple slices. This is especially common for Haswell+ X86_64 machines, where x86_64h slices are preferred, but if one is not available, a regular x86_64 is loaded instead. But the same issue exists for i386 vs. x86_64 as well. This patch adds tracking of arch and UUID for each LoadedModule. At this point, this information isn't used in reports, but this is the first step. The goal is to correctly identify which slice is loaded in symbolication, and also to output this information in reports so that we can tell which exact slices were loaded in post-mortem analysis. Differential Revision: https://reviews.llvm.org/D26632 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@288537 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04[libsanitizer] Fix bugs and wiki links to point to GitHub.Alexander Potapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254738 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-17[Sanitizer] Teach ReadFileToBuffer to distinguish empty file from ↵Alexey Samsonov
inaccessible file. Summary: This fixes https://code.google.com/p/address-sanitizer/issues/detail?id=399 (sanitizers crash with empty suppression files). Reviewers: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11284 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@242594 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-06Segregate FreeBSD-specific parts from sanitizer_procmaps_linux.ccViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D4555 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214955 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-11[asan] Exclude non-executable mappings from coverage.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@210649 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-01Add FreeBSD support to sanitizers' procmaps facilitiesViktor Kutuzov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@205291 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04A set of trivial changes to support sanitizers on FreeBSD.Alexey Samsonov
Patch by Viktor Kutuzov! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202801 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-25[Sanitizer] Remove now unused symbolization functionality from ↵Alexey Samsonov
MemoryMappingLayout git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@198014 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-25[Sanitizer] Use different MemoryMappingLayout::DumpListOfModules on Linux ↵Alexey Samsonov
and Mac. Make a unit test added in r198004 more robust. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@198012 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-25[Sanitizer] Move OS-specific code for MemoryMappingLayout into separate ↵Alexey Samsonov
source files. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@198003 91177308-0d34-0410-b5e6-96231b3b80d8