Go to file
Kostya Serebryany 5b53a2f292 Fix AddressSanitizer on s390 (31-bit)
Summary:
GET_CALLER_PC doesn't work properly on 31-bit s390, as pointers are 31-bit, the MSB bit can be set when the return address is copied into integer.
This causes e.g. errors like:
    #0 0xfdadb129  (<unknown module>)
    #1 0x7da5e1d1 in __asan::GetStackTraceWithPcBpAndContext(__sanitizer::BufferedStackTrace*, unsigned long, unsigned long, unsigned long, void*, bool) ../../../../../libsanitizer/asan/asan_stack.h:50
    #2 0x7da5e1d1 in __asan::ErrorGeneric::Print() ../../../../../libsanitizer/asan/asan_errors.cc:482
    #3 0x7db178d5 in __asan::ErrorDescription::Print() ../../../../../libsanitizer/asan/asan_errors.h:360
    #4 0x7db178d5 in __asan::ScopedInErrorReport::~ScopedInErrorReport() ../../../../../libsanitizer/asan/asan_report.cc:167
    #5 0x7db178d5 in __asan::ReportGenericError(unsigned long, unsigned long, unsigned long, unsigned long, bool, unsigned long, unsigned int, bool) ../../../../../libsanitizer/asan/asan_report.cc:397
    #6 0x7dadb14f in __interceptor_memcmp ../../../../../libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:626
    #7 0x400cf5 in main /home/jakub/gcc/gcc/testsuite/c-c++-common/asan/memcmp-1.c:14
    #8 0x7d807215 in __libc_start_main (/lib/libc.so.6+0x1a215)
    #9 0x4007ed  (/home/jakub/gcc/obj/gcc/testsuite/memcmp-1.exe+0x4007ed)

The actual return PC inside __interceptor_memcmp was 0x7dadb129 rather than 0xfdadb129.

Reviewers: koriakin, kcc

Reviewed By: kcc

Subscribers: kubamracek

Differential Revision: https://reviews.llvm.org/D29824

llvm-svn: 294793
2017-02-10 22:26:19 +00:00
clang [c++1z] Require an initializer for deduced class template specialization types. 2017-02-10 21:40:29 +00:00
clang-tools-extra [clangd] Move isDone from the JSONOutput to ShutdownHandler. 2017-02-10 17:25:38 +00:00
compiler-rt Fix AddressSanitizer on s390 (31-bit) 2017-02-10 22:26:19 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc math: Add native_rsqrt builtin function 2017-02-09 18:39:26 +00:00
libcxx Make lcm/gcd work better in edge cases. Fixes a UBSAN failure. 2017-02-10 20:49:08 +00:00
libcxxabi Fix path to libc++'s python test module 2017-02-09 23:58:54 +00:00
libunwind Revert "[libunwind][CMake] Use libc++ headers when available" 2017-02-09 03:56:47 +00:00
lld Relax tests a bit. 2017-02-10 20:10:16 +00:00
lldb Fix another build issue with shared libraries on Linux 2017-02-10 18:39:26 +00:00
llgo [llgo] Remove support for LLVM attributes 2016-12-06 19:22:04 +00:00
llvm [lib/LTO] Rework optimization remarkers setup. 2017-02-10 22:16:17 +00:00
openmp libomptarget: Disable on Win32 2017-02-10 17:13:28 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly Porting the example illustrating Polly from HTML to reStructuredText 2017-02-10 11:46:57 +00:00