[clang] [clang-repl] Pass triple to IncrementalCompilerBuilder as explicit argument (PR #84174)

Florian Mayer via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 6 13:50:43 PST 2024


fmayer wrote:

This triggers the leak detector in our HWASan build bot

```
Note: This is test shard 1 of 23.
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from IncrementalCompilerBuilder
[ RUN      ] IncrementalCompilerBuilder.SetCompilerArgs
[       OK ] IncrementalCompilerBuilder.SetCompilerArgs (12 ms)
[----------] 1 test from IncrementalCompilerBuilder (12 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (12 ms total)
[  PASSED  ] 1 test.
=================================================================
==2996657==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 33 byte(s) in 1 object(s) allocated from:
    #0 0xaaaac1507a9c in operator new(unsigned long) /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/compiler-rt/lib/hwasan/hwasan_new_delete.cpp:64:3
    #1 0xaaaac2593884 in operator new(unsigned long, (anonymous namespace)::NamedBufferAlloc const&) /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/lib/Support/MemoryBuffer.cpp:82:35
    #2 0xaaaac2593550 in llvm::MemoryBuffer::getMemBuffer(llvm::StringRef, llvm::StringRef, bool) /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/lib/Support/MemoryBuffer.cpp:124:15
    #3 0xaaaac39509d4 in CreateCI /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/lib/Interpreter/Interpreter.cpp:111:28
    #4 0xaaaac39509d4 in clang::IncrementalCompilerBuilder::create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::vector<char const*, std::__1::allocator<char const*>>&) /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/lib/Interpreter/Interpreter.cpp:178:10
    #5 0xaaaac3953298 in clang::IncrementalCompilerBuilder::CreateCpp() /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/lib/Interpreter/Interpreter.cpp:189:10
    #6 0xaaaac1509c10 in (anonymous namespace)::IncrementalCompilerBuilder_SetCompilerArgs_Test::TestBody() /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/unittests/Interpreter/IncrementalCompilerBuilderTest.cpp:24:25
    #7 0xaaaac273ec98 in HandleExceptionsInMethodIfSupported<testing::Test, void> /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/googletest/src/gtest.cc
    #8 0xaaaac273ec98 in testing::Test::Run() /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/googletest/src/gtest.cc:2687:5
    #9 0xaaaac2742074 in testing::TestInfo::Run() /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/googletest/src/gtest.cc:2836:11
    #10 0xaaaac2744284 in testing::TestSuite::Run() /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/googletest/src/gtest.cc:3015:30
    #11 0xaaaac276ac1c in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/googletest/src/gtest.cc:5920:44
    #12 0xaaaac27695e8 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/googletest/src/gtest.cc
    #13 0xaaaac27695e8 in testing::UnitTest::Run() /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/googletest/src/gtest.cc:5484:10
    #14 0xaaaac2700288 in RUN_ALL_TESTS /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:2317:73
    #15 0xaaaac2700288 in main /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/UnitTestMain/TestMain.cpp:55:10
    #16 0xffff98856dbc  (/lib/aarch64-linux-gnu/libc.so.6+0x26dbc) (BuildId: b3e2fd825ee86277a10a2c20b9fc836b101a2b7f)
    #17 0xffff98856e94 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x26e94) (BuildId: b3e2fd825ee86277a10a2c20b9fc836b101a2b7f)
    #18 0xaaaac14cf22c in _start (/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/tools/clang/unittests/Interpreter/ClangReplInterpreterTests+0x3fdf22c)
SUMMARY: HWAddressSanitizer: 33 byte(s) leaked in 1 allocation(s).
libc++abi: Pure virtual function called!
--
exit: -6
--
********************
Testing:  0.. 10.. 20
FAIL: Clang-Unit :: Interpreter/./ClangReplInterpreterTests/1/23 (19683 of 78329)
******************** TEST 'Clang-Unit :: Interpreter/./ClangReplInterpreterTests/1/23' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/tools/clang/unittests/Interpreter/./ClangReplInterpreterTests-Clang-Unit-2413105-1-23.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=23 GTEST_SHARD_INDEX=1 /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/tools/clang/unittests/Interpreter/./ClangReplInterpreterTests
--
Note: This is test shard 2 of 23.
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from IncrementalCompilerBuilder
[ RUN      ] IncrementalCompilerBuilder.SetTargetTriple
[       OK ] IncrementalCompilerBuilder.SetTargetTriple (15 ms)
[----------] 1 test from IncrementalCompilerBuilder (15 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (16 ms total)
[  PASSED  ] 1 test.
=================================================================
==2996658==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 33 byte(s) in 1 object(s) allocated from:
    #0 0xaaaaaf737a9c in operator new(unsigned long) /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/compiler-rt/lib/hwasan/hwasan_new_delete.cpp:64:3
    #1 0xaaaab07c3884 in operator new(unsigned long, (anonymous namespace)::NamedBufferAlloc const&) /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/lib/Support/MemoryBuffer.cpp:82:35
    #2 0xaaaab07c3550 in llvm::MemoryBuffer::getMemBuffer(llvm::StringRef, llvm::StringRef, bool) /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/llvm/lib/Support/MemoryBuffer.cpp:124:15
    #3 0xaaaab1b809d4 in CreateCI /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/lib/Interpreter/Interpreter.cpp:111:28
    #4 0xaaaab1b809d4 in clang::IncrementalCompilerBuilder::create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::vector<char const*, std::__1::allocator<char const*>>&) /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/lib/Interpreter/Interpreter.cpp:178:10
    #5 0xaaaab1b8321c in clang::IncrementalCompilerBuilder::CreateCpp() /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/lib/Interpreter/Interpreter.cpp:189:10
    #6 0xaaaaaf73b01c in (anonymous namespace)::IncrementalCompilerBuilder_SetTargetTriple_Test::TestBody() /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/clang/unittests/Interpreter/IncrementalCompilerBuilderTest.cpp:31:25
    #7 0xaaaab096ec98 in HandleExceptionsInMethodIfSupported<testing::Test, void> /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/googletest/src/gtest.cc
    #8 0xaaaab096ec98 in testing::Test::Run() /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/googletest/src/gtest.cc:2687:5
    #9 0xaaaab0972074 in testing::TestInfo::Run() /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/googletest/src/gtest.cc:2836:11
    #10 0xaaaab0974284 in testing::TestSuite::Run() /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/googletest/src/gtest.cc:3015:30
    #11 0xaaaab099ac1c in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/googletest/src/gtest.cc:5920:44
    #12 0xaaaab09995e8 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/googletest/src/gtest.cc
    #13 0xaaaab09995e8 in testing::UnitTest::Run() /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/googletest/src/gtest.cc:5484:10
    #14 0xaaaab0930288 in RUN_ALL_TESTS /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:2317:73
    #15 0xaaaab0930288 in main /b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm-project/third-party/unittest/UnitTestMain/TestMain.cpp:55:10
    #16 0xffffb75a6dbc  (/lib/aarch64-linux-gnu/libc.so.6+0x26dbc) (BuildId: b3e2fd825ee86277a10a2c20b9fc836b101a2b7f)
    #17 0xffffb75a6e94 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x26e94) (BuildId: b3e2fd825ee86277a10a2c20b9fc836b101a2b7f)
    #18 0xaaaaaf6ff22c in _start (/b/sanitizer-aarch64-linux-bootstrap-hwasan/build/llvm_build_hwasan/tools/clang/unittests/Interpreter/ClangReplInterpreterTests+0x3fdf22c)
SUMMARY: HWAddressSanitizer: 33 byte(s) leaked in 1 allocation(s).
libc++abi: Pure virtual function called!
```

https://github.com/llvm/llvm-project/pull/84174


More information about the cfe-commits mailing list