1. Mar 08, 2019
    • Julian Lettner's avatar
      [NFC][TSan] Remove unnecessary #include · a30357d1
      Julian Lettner authored
      llvm-svn: 355620
      a30357d1
    • Julian Lettner's avatar
      [TSan][Linux] Fix libdispatch interception macros compilation errors · 011a90b9
      Julian Lettner authored
      Most libdispatch functions come in two variants: callbacks can be
      specified via blocks or function pointers. Some of our interceptors for
      the block variant actually forward to the function variant. However, on
      Linux, `DECLARE_REAL(name)` has to appear before `REAL(name)`.
      
      This patch reorders _f variant interceptors before _b variants
      where possible and forward declares the _f variant in the remaining
      cases (cyclic dependency between _f and _b interceptors).
      
      Also rename macro to DISPATCH_INTERCEPT_ASYNC_F for better consistency.
      
      Reviewed By: dvyukov
      
      Differential Revision: https://reviews.llvm.org/D59067
      
      llvm-svn: 355619
      011a90b9
    • Julian Lettner's avatar
      [NFC][TSan] Add libdispatch tests for non-Darwin platforms · 9ee68fff
      Julian Lettner authored
      Add new sets of tests (copy instead of move existing tests) because
      there could be subtle differences between C/Obj-C and with/without
      Foundation etc.
      
      Reviewed By: dvyukov
      
      Differential Revision: https://reviews.llvm.org/D59047
      
      llvm-svn: 355618
      9ee68fff
    • Julian Lettner's avatar
      [Sanitizer] Add 'dispatch' feature to be used in compiler-rt tests · 98a00def
      Julian Lettner authored
      Reviewed By: dvyukov
      
      Differential Revision: https://reviews.llvm.org/D59037
      
      llvm-svn: 355617
      98a00def
    • Mitch Phillips's avatar
      Rollback of rL355585. · 92dd321a
      Mitch Phillips authored
      Introduces memory leak in FunctionTest.GetPointerAlignment that breaks sanitizer buildbots:
      
      ```
      =================================================================
      ==2453==ERROR: LeakSanitizer: detected memory leaks
      
      Direct leak of 128 byte(s) in 1 object(s) allocated from:
          #0 0x610428 in operator new(unsigned long) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:105
          #1 0x16936bc in llvm::User::operator new(unsigned long) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/User.cpp:151:19
          #2 0x7c3fe9 in Create /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/IR/Function.h:144:12
          #3 0x7c3fe9 in (anonymous namespace)::FunctionTest_GetPointerAlignment_Test::TestBody() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/IR/FunctionTest.cpp:136
          #4 0x1a836a0 in HandleExceptionsInMethodIfSupported<testing::Test, void> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
          #5 0x1a836a0 in testing::Test::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2474
          #6 0x1a85c55 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2656:11
          #7 0x1a870d0 in testing::TestCase::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2774:28
          #8 0x1aa5b84 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4649:43
          #9 0x1aa4d30 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
          #10 0x1aa4d30 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4257
          #11 0x1a6b656 in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46
          #12 0x1a6b656 in main /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/UnitTestMain/TestMain.cpp:50
          #13 0x7f5af37a22e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
      
      Indirect leak of 40 byte(s) in 1 object(s) allocated from:
          #0 0x610428 in operator new(unsigned long) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:105
          #1 0x151be6b in make_unique<llvm::ValueSymbolTable> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/ADT/STLExtras.h:1349:29
          #2 0x151be6b in llvm::Function::Function(llvm::FunctionType*, llvm::GlobalValue::LinkageTypes, unsigned int, llvm::Twine const&, llvm::Module*) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/Function.cpp:241
          #3 0x7c4006 in Create /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/IR/Function.h:144:16
          #4 0x7c4006 in (anonymous namespace)::FunctionTest_GetPointerAlignment_Test::TestBody() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/IR/FunctionTest.cpp:136
          #5 0x1a836a0 in HandleExceptionsInMethodIfSupported<testing::Test, void> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
          #6 0x1a836a0 in testing::Test::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2474
          #7 0x1a85c55 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2656:11
          #8 0x1a870d0 in testing::TestCase::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2774:28
          #9 0x1aa5b84 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4649:43
          #10 0x1aa4d30 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
          #11 0x1aa4d30 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4257
          #12 0x1a6b656 in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46
          #13 0x1a6b656 in main /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/UnitTestMain/TestMain.cpp:50
          #14 0x7f5af37a22e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
      
      SUMMARY: AddressSanitizer: 168 byte(s) leaked in 2 allocation(s).
      ```
      
      See http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/11358/steps/check-llvm%20asan/logs/stdio for more information.
      
      Also introduces use-of-uninitialized-value in ConstantsTest.FoldGlobalVariablePtr:
      ```
      ==7070==WARNING: MemorySanitizer: use-of-uninitialized-value
          #0 0x14e703c in User /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/User.h:79:5
          #1 0x14e703c in Constant /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/Constant.h:44
          #2 0x14e703c in llvm::GlobalValue::GlobalValue(llvm::Type*, llvm::Value::ValueTy, llvm::Use*, unsigned int, llvm::GlobalValue::LinkageTypes, llvm::Twine const&, unsigned int) /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/GlobalValue.h:78
          #3 0x14e5467 in GlobalObject /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/GlobalObject.h:34:9
          #4 0x14e5467 in llvm::GlobalVariable::GlobalVariable(llvm::Type*, bool, llvm::GlobalValue::LinkageTypes, llvm::Constant*, llvm::Twine const&, llvm::GlobalValue::ThreadLocalMode, unsigned int, bool) /b/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/Globals.cpp:314
          #5 0x6938f1 in llvm::(anonymous namespace)::ConstantsTest_FoldGlobalVariablePtr_Test::TestBody() /b/sanitizer-x86_64-linux-fast/build/llvm/unittests/IR/ConstantsTest.cpp:565:18
          #6 0x1a240a1 in HandleExceptionsInMethodIfSupported<testing::Test, void> /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc
          #7 0x1a240a1 in testing::Test::Run() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2474
          #8 0x1a26d26 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2656:11
          #9 0x1a2815f in testing::TestCase::Run() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2774:28
          #10 0x1a43de8 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:4649:43
          #11 0x1a42c47 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc
          #12 0x1a42c47 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:4257
          #13 0x1a0dfba in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46
          #14 0x1a0dfba in main /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/UnitTestMain/TestMain.cpp:50
          #15 0x7f2081c412e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
          #16 0x4dff49 in _start (/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/unittests/IR/IRTests+0x4dff49)
      
      SUMMARY: MemorySanitizer: use-of-uninitialized-value /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/User.h:79:5 in User
      ```
      
      See http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/30222/steps/check-llvm%20msan/logs/stdio for more information.
      
      llvm-svn: 355616
      92dd321a
    • Davide Italiano's avatar
      [testsuite] Spring cleaning: this tests `stty`, not `lldb`. · 2f94dcec
      Davide Italiano authored
      llvm-svn: 355615
      2f94dcec
    • Alexey Bataev's avatar
      [OPENMP 5.0]Add initial support for 'allocate' directive. · 25ed0c07
      Alexey Bataev authored
      Added parsing/sema analysis/serialization/deserialization support for
      'allocate' directive.
      
      llvm-svn: 355614
      25ed0c07
    • Florian Hahn's avatar
      [InterleavedAccessAnalysis] Fix integer overflow in insertMember. · 6ca0985a
      Florian Hahn authored
      Without checking for integer overflow, invalid members can be added
       e.g. if the calculated key overflows, becomes positive and the largest key.
      
      This fixes
            https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7560
            https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13128
            https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13229
      
      Reviewers: Ayal, anna, hsaito, efriedma
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D55538
      
      llvm-svn: 355613
      6ca0985a
    • Davide Italiano's avatar
      [testsuite] Drop characters that can't be decoded, restoring parity with Py2. · bd53e768
      Davide Italiano authored
      Tests that check the output of `memory find` may trip over
      unreadable characters, and in Python 3 this is an error.
      
      llvm-svn: 355612
      bd53e768
    • Jan Kratochvil's avatar
      Fix TestDataFormatter.test uninitialized variable · 8a4efd21
      Jan Kratochvil authored
      After D55626 I see a failure in my Fedora buildbot.
      
      There is uninitialized variable as the Foo constructor has not been run and foo
      is an autovariable.
      
      (lldb) breakpoint set -f foo.cpp -l 11
      Breakpoint 1: where = TestDataFormatter.test.tmp.out`main + 30 at foo.cpp:11:7, address = 0x000000000040112e
      (lldb) run
      Process 801065 stopped
      * thread #1, name = 'TestDataFormatt', stop reason = breakpoint 1.1
          frame #0: 0x000000000040112e TestDataFormatter.test.tmp.out`main(argc=1, argv=0x00007fffffffcc48) at foo.cpp:11:7
         8   	};
         9
         10  	int main(int argc, char **argv) {
      -> 11  	  Foo foo(1, 2.22);
         12  	  return 0;
         13  	}
      
      Process 801065 launched: '.../tools/lldb/lit/Reproducer/Functionalities/Output/TestDataFormatter.test.tmp.out' (x86_64)
      (lldb) frame var
      (int) argc = 1
      (char **) argv = 0x00007fffffffcc48
      (Foo) foo = (m_i = 4198432, m_d = 0)
      
      While the testcase expects m_i will be 0.
      
      Differential Revision: https://reviews.llvm.org/D59088
      
      llvm-svn: 355611
      8a4efd21
    • Jonas Devlieghere's avatar
      [Reproducers] Disable registering lldb::thread_t everywhere · 0ccc0b1a
      Jonas Devlieghere authored
      As discussed on the mailing list, default serialization for thread ids
      is not correct, even if they're represented as basic types. I'm
      purposely leaving the corresponding record macros in place so that we
      don't break the API boundary detection.
      
      llvm-svn: 355610
      0ccc0b1a
    • Anastasia Stulova's avatar
      [Sema] Change addr space diagnostics in casts to follow C++ style. · 6f7c536e
      Anastasia Stulova authored
      This change adds a new diagnostic for mismatching address spaces
      to be used for C++ casts (only enabled in C style cast for now,
      the rest will follow!).
      
      The change extends C-style cast rules to account for address spaces.
      It also adds a separate function for address space cast checking that
      can be used to map from a separate address space cast operator
      addrspace_cast (to be added as a follow up patch).
      
      Note, that after this change clang will no longer allows arbitrary
      address space conversions in reinterpret_casts because they can lead
      to accidental errors. The implicit safe conversions would still be
      allowed.
      
      Differential Revision: https://reviews.llvm.org/D58346
      
      llvm-svn: 355609
      6f7c536e
    • Anastasia Stulova's avatar
      [PR40778][Sema] Adjust addr space of operands in builtin operators. · 27e5c212
      Anastasia Stulova authored
      Adjust address space for references and pointer operands of builtin operators.
      
      Currently this change only fixes addr space in assignment (= and |=) operator,
      that is needed for the test case reported in the bug. Wider support for all
      other operations will follow.
      
      Differential Revision: https://reviews.llvm.org/D58719
      
      llvm-svn: 355608
      27e5c212
    • Petar Jovanovic's avatar
      [DebugInfo] Fix the type of the formated variable · 95817d36
      Petar Jovanovic authored
      Change the format type of *Personality and *LSDAAddress to PRIx64 since
      they are of type uint64_t.
      The problem was detected on mips builds, where it was printing junk values
      and causing test failure.
      
      Patch by Milos Stojanovic.
      
      Differential Revision: https://reviews.llvm.org/D58451
      
      llvm-svn: 355607
      95817d36
    • Anastasia Stulova's avatar
      [PR40778] Preserve addr space in Derived to Base cast. · 94049554
      Anastasia Stulova authored
      The address space for the Base class pointer when up-casting
      from Derived should be taken from the Derived class pointer.
      
      Differential Revision: https://reviews.llvm.org/D53818
      
      llvm-svn: 355606
      94049554
  2. Mar 07, 2019