summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/msan
Commit message (Collapse)AuthorAgeFilesLines
...
* [msan] Chained origins re-design.Evgeniy Stepanov2014-05-2112-106/+290
| | | | | | | | | | | | | | | | | Generalize StackDepot and create a new specialized instance of it to efficiently (i.e. without duplicating stack trace data) store the origin history tree. This reduces memory usage for chained origins roughly by an order of magnitude. Most importantly, this new design allows us to put two limits on stored history data (exposed in MSAN_OPTIONS) that help avoid exponential growth in used memory on certain workloads. See comments in lib/msan/msan_origin.h for more details. llvm-svn: 209284
* [CMake] Use ExternalProject to build MSan-ified version of libcxx for unit ↵Alexey Samsonov2014-05-092-53/+25
| | | | | | | | | | | | | | | tests. This change lets MSan rely on libcxx's own build system instead of manually compiling its sources and setting up all the necessary compile flags. It would also simplify compiling libcxx with another sanitizers (in particular, TSan). The tricky part is to make sure libcxx is reconfigured/rebuilt when Clang or MSan runtime library is changed. "clobber" step used in this patch works well for me, but it's possible it would break for other configurations - will watch the buildbots. llvm-svn: 208451
* [msan] Intercept strxfrm.Evgeniy Stepanov2014-05-081-0/+19
| | | | llvm-svn: 208303
* [msan] Switch to common printf interceptors.Evgeniy Stepanov2014-05-082-64/+3
| | | | | | | | | Format string parsing is disabled by default. This is not expected to meaningfully change the tool behavior. With this change, check_printf flag could be used to evaluate printf format string parsing in MSan. llvm-svn: 208295
* [MSan] Fixup for r206983: MsanThread may be unavailable in signal handler: ↵Alexey Samsonov2014-05-072-3/+10
| | | | | | signals may be raised while thread is being destroyed llvm-svn: 208250
* [sanitizer] Replace a macro with a function.Evgeniy Stepanov2014-05-071-1/+1
| | | | llvm-svn: 208207
* [msan] Fix __msan_check_mem_is_initialized and prettify its output.Evgeniy Stepanov2014-05-074-3/+16
| | | | llvm-svn: 208195
* [msan] Prettify __msan_print_shadow.Evgeniy Stepanov2014-04-304-7/+124
| | | | | | Makes __msan_print_shadow output much more readable, adds origin info. llvm-svn: 207622
* [msan] Disable chained origins in signal handlers.Evgeniy Stepanov2014-04-233-0/+16
| | | | | | StackDepot is not async-signal-safe; storing a new origin to it can deadlock. llvm-svn: 206983
* [msan] Add missing quotes.Evgeniy Stepanov2014-04-181-1/+1
| | | | llvm-svn: 206589
* [msan] Run msan_test in the new with-calls mode.Evgeniy Stepanov2014-04-181-19/+22
| | | | llvm-svn: 206587
* [msan] Missing declarations for the new interface functions.Evgeniy Stepanov2014-04-181-0/+18
| | | | llvm-svn: 206586
* [msan] Add new MSan callbacks for instrumentation-with-calls mode.Evgeniy Stepanov2014-04-181-0/+28
| | | | llvm-svn: 206584
* [msan] Intercept wcsftime().Evgeniy Stepanov2014-04-142-5/+51
| | | | llvm-svn: 206179
* [msan] mprotect() more memory to detect user code outside of application range.Evgeniy Stepanov2014-04-112-5/+6
| | | | llvm-svn: 206028
* [msan] Introduce MsanThread. Move thread-local allocator cache out of TLS.Evgeniy Stepanov2014-04-0410-91/+291
| | | | | | This reduces .tbss from 109K down to almost nothing. llvm-svn: 205618
* [msan] Kill __msan_print_param_shadow.Evgeniy Stepanov2014-04-022-9/+0
| | | | | | | It does not do what it's name says, and what it actually does is hard to describe, and is not useful at all. llvm-svn: 205415
* [msan] Add __msan_check_mem_is_initialized.Evgeniy Stepanov2014-04-022-0/+19
| | | | | | An assert()-like function that checks that a memory range is fully initialized. llvm-svn: 205413
* [msan] Precise origin handling in __unaligned_(load|store)*.Evgeniy Stepanov2014-04-024-35/+160
| | | | llvm-svn: 205412
* [msan] clang-format several unit testsEvgeniy Stepanov2014-04-021-25/+25
| | | | llvm-svn: 205410
* [msan] Remove an extra top frame from track-origins=2 reports.Evgeniy Stepanov2014-03-312-8/+12
| | | | llvm-svn: 205192
* [CMake] Rename add_compiler_rt_static_runtime to add_compiler_rt_runtime.Alexey Samsonov2014-03-311-1/+1
| | | | | | | | Soon there will be an option to build compiler-rt parts as shared libraries on Linux. Extracted from http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov. llvm-svn: 205183
* [sanitizer] Intercept fgetpwent / fgetgrent.Evgeniy Stepanov2014-03-281-0/+42
| | | | | | | | These interceptors require deep unpoisoning of return values. While at it, we do the same for all other pw/gr interceptors to reduce dependency on libc implementation details. llvm-svn: 205004
* [sanitizer] Intercept getpwent/getgrent.Evgeniy Stepanov2014-03-281-0/+48
| | | | llvm-svn: 205000
* [msan] Implement __msan_set_death_callback.Evgeniy Stepanov2014-03-274-0/+14
| | | | llvm-svn: 204926
* [msan] Intercept several malloc-related functions.Evgeniy Stepanov2014-03-272-9/+46
| | | | llvm-svn: 204923
* Avoid aliases to weak aliases in interceptors.Rafael Espindola2014-03-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The interceptors had code that after macro expansion ended up looking like extern "C" void memalign() __attribute__((weak, alias("__interceptor_memalign"))); extern "C" void __interceptor_memalign() {} extern "C" void __interceptor___libc_memalign() __attribute__((alias("memalign"))); That is, * __interceptor_memalign is a function * memalign is a weak alias to __interceptor_memalign * __interceptor___libc_memalign is an alias to memalign Both gcc and clang produce assembly that look like __interceptor_memalign: ... .weak memalign memalign = __interceptor_memalign .globl __interceptor___libc_memalign __interceptor___libc_memalign = memalign What it means in the end is that we have 3 symbols pointing to the same position in the file, one of which is weak: 8: 0000000000000000 1 FUNC GLOBAL DEFAULT 1 __interceptor_memalign 9: 0000000000000000 1 FUNC WEAK DEFAULT 1 memalign 10: 0000000000000000 1 FUNC GLOBAL DEFAULT 1 __interceptor___libc_memalign In particular, note that __interceptor___libc_memalign will always point to __interceptor_memalign, even if we do link in a strong symbol for memalign. In fact, the above code produces exactly the same binary as extern "C" void memalign() __attribute__((weak, alias("__interceptor_memalign"))); extern "C" void __interceptor_memalign() {} extern "C" void __interceptor___libc_memalign() __attribute__((alias("__interceptor_memalign"))); If nothing else, this patch makes it more obvious what is going on. llvm-svn: 204823
* [msan] Enable SelectPartial test.Evgeniy Stepanov2014-03-251-1/+1
| | | | | | Fixed in r204716. llvm-svn: 204717
* [msan] Fix compiler warning in msan_test.cc.Evgeniy Stepanov2014-03-251-2/+2
| | | | llvm-svn: 204708
* [msan] A disabled test for inexact "select" instrumentation.Evgeniy Stepanov2014-03-251-0/+20
| | | | llvm-svn: 204707
* [CMake] Rename the variableAlexey Samsonov2014-03-241-1/+1
| | | | llvm-svn: 204602
* [CMake] Respect CMAKE_CXX_FLAGS in custom clang_compile commandsAlexey Samsonov2014-03-241-2/+4
| | | | llvm-svn: 204593
* Make MSan unittest -Werror=sign-compare cleanAlexey Samsonov2014-03-241-40/+43
| | | | llvm-svn: 204592
* [MSan] Add __msan_unpoison_string() to the public interface.Sergey Matveev2014-03-212-0/+7
| | | | | | | | Using __msan_unpoison() on null-terminated strings is awkward because strlen() can't be called on a poisoned string. This case warrants a special interface function. llvm-svn: 204448
* [libsanitizer] Introduce flag descriptions.Alexander Potapenko2014-03-201-9/+10
| | | | | | | | | Extend ParseFlag to accept the |description| parameter, add dummy values for all existing flags. As the flags are parsed their descriptions are stored in a global linked list. The tool can later call __sanitizer::PrintFlagDescriptions() to dump all the flag names and their descriptions. Add the 'help' flag and make ASan, TSan and MSan print the flags if 'help' is set to 1. llvm-svn: 204339
* [CMake] Build sanitizer unit tests with -std=c++11Alexey Samsonov2014-03-191-1/+1
| | | | llvm-svn: 204234
* [msan] Origin tracking with history, compiler-rt part.Evgeniy Stepanov2014-03-185-79/+178
| | | | | | | | Compiler-rt part of MSan implementation of advanced origin tracking, when we record not only creation point, but all locations where an uninitialized value was stored to memory, too. llvm-svn: 204152
* [msan] Test for aggregates passing through ellipsis.Evgeniy Stepanov2014-03-131-0/+35
| | | | llvm-svn: 203795
* [CMake] Make append_if semantics similar to those used in LLVMAlexey Samsonov2014-03-132-4/+4
| | | | llvm-svn: 203773
* [sanitizer] Simplify interceptors with user callbacks.Evgeniy Stepanov2014-03-061-2/+2
| | | | | | | Get rid of the context argument in UNPOISON_PARAM and INITIALIZE_RANGE. Get rid of all the thread-local contexts in interceptors. llvm-svn: 203119
* Add common interceptors for memchr/memrchrAlexey Samsonov2014-03-051-0/+32
| | | | llvm-svn: 202972
* [CMake] Test for libdl and libpthread presenceAlexey Samsonov2014-03-041-2/+2
| | | | llvm-svn: 202847
* [msan] Tests for X86 SIMD bitshift intrinsic support.Evgeniy Stepanov2014-03-031-0/+96
| | | | llvm-svn: 202713
* Reapply r201910. MSVC gets __func__ defined explicitly, even though itJoerg Sonnenberger2014-02-261-1/+1
| | | | | | can't build anything here. llvm-svn: 202297
* AdjustStackSizeLinux() is used in Lsan, Tsan and Msan non-Linux-specific ↵Kostya Serebryany2014-02-241-1/+1
| | | | | | | | | code so it seems it should have more generic name and moved to a common scope. Renamed to AdjustStackSize. Patch by Viktor Kutuzov. llvm-svn: 202011
* Revert "Replace __FUNCTION__ with __func__, the latter being standard ↵Reid Kleckner2014-02-221-1/+1
| | | | | | | | | | | | C99/C++11." This reverts commit r201910. While __func__ may be standard in C++11, it was only recently added to MSVC in 2013 CTP, and LLVM supports MSVC 2012. __FUNCTION__ may not be standard, but it's *very* portable. llvm-svn: 201916
* Replace __FUNCTION__ with __func__, the latter being standard C99/C++11.Joerg Sonnenberger2014-02-211-1/+1
| | | | llvm-svn: 201910
* [CMake] break dependency between unit tests and runtimes in standalone buildAlexey Samsonov2014-02-201-6/+16
| | | | llvm-svn: 201778
* [CMake] Introduce COMPILER_RT_INCLUDE_TESTS optionAlexey Samsonov2014-02-191-1/+1
| | | | llvm-svn: 201666
* [CMake] Add top-level target for each compiler-rt library, and add ↵Alexey Samsonov2014-02-181-0/+1
| | | | | | 'compiler-rt' target encompassing them all. llvm-svn: 201556
OpenPOWER on IntegriCloud