[llvm-bugs] [Bug 42719] New: Unit tests in Analysis/BasicAliasAnalysisTest.cpp failing on linux

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 22 19:41:08 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42719

            Bug ID: 42719
           Summary: Unit tests in Analysis/BasicAliasAnalysisTest.cpp
                    failing on linux
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: douglas_yung at playstation.sony.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

I recently noticed that the two unit tests in
llvm/unittests/Analysis/BasicAliasAnalysisTest.cpp started failing in our
internal linux build bot:

LLVM-Unit::BasicAATest.AliasInstWithFullObjectOfImpreciseSize
LLVM-Unit::BasicAATest.AliasInstWithObjectOfImpreciseSize

These tests have also been failing for a while it seems in two of the upstream
build bots:

http://lab.llvm.org:8011/builders/clang-cmake-x86_64-avx2-linux/builds/10285
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/24658

For the upstream bot clang-cmake-x86_64-avx2-linux, it started failing in build
#10285 (testing r365700-r365711), but I don't think any of those changes
actually caused the problem.

For the upstream bot clang-cmake-x86_64-sde-avx512-linux, the failure appears
in the bot history as far back as it currently goes (currently the oldest build
is the build of r366312).

Internally, our build bot started hitting the failure somewhere between r365857
and r365866. I highly doubt that any of these changes were actually the cause
of the problem, as I was able to go back to when the test was added and
reproduce the failure internally at that point. What is even odder is that
sometimes the test would fail when run within the LIT test framework, but when
run on its own, it would fail!

When the failing unit test is run in gdb, the error is a SIGSEGV due to an
invalid address. The one time I was able to get a stack trace, here is what it
looked like:

#0  0x00005555555b16b6 in
__gnu_cxx::__normal_iterator<std::unique_ptr<llvm::AAResults::Concept,
std::default_delete<llvm::AAResults::Concept> >*,
std::vector<std::unique_ptr<llvm::AAResults::Concept,
std::default_delete<llvm::AAResults::Concept> >,
std::allocator<std::unique_ptr<llvm::AAResults::Concept,
std::default_delete<llvm::AAResults::Concept> > > > >::__normal_iterator
(this=0x7fffffffdb10, __i=<error reading variable>)
    at /usr/include/c++/8/bits/stl_iterator.h:784
#1  0x00005555555b17de in std::vector<std::unique_ptr<llvm::AAResults::Concept,
std::default_delete<llvm::AAResults::Concept> >,
std::allocator<std::unique_ptr<llvm::AAResults::Concept,
std::default_delete<llvm::AAResults::Concept> > >>::begin (this=0x1013) at
/usr/include/c++/8/bits/stl_vector.h:699
#2  0x00005555556c74cd in llvm::AAResults::alias (this=0x100b, LocA=...,
LocB=...)
    at /mnt/sources/git/merge/llvm/lib/Analysis/AliasAnalysis.cpp:104
#3  0x00005555556f01ae in
llvm::AAResultBase<llvm::BasicAAResult>::AAResultsProxy::alias
(this=0x7fffffffdcb0,
    LocA=..., LocB=...) at
/mnt/sources/git/merge/llvm/include/llvm/Analysis/AliasAnalysis.h:896
#4  0x00005555556ec2df in llvm::BasicAAResult::aliasCheck (this=0x55555666f918,
V1=0x555556684ac0, V1Size=...,
    V1AAInfo=..., V2=0x555556686488, V2Size=..., V2AAInfo=...,
O1=0x555556684ac0, O2=0x555556686488)
    at /mnt/sources/git/merge/llvm/lib/Analysis/BasicAliasAnalysis.cpp:1787
#5  0x00005555556e89da in llvm::BasicAAResult::alias (this=0x55555666f918,
LocA=..., LocB=...)
    at /mnt/sources/git/merge/llvm/lib/Analysis/BasicAliasAnalysis.cpp:780
#6  0x00005555555b804b in
BasicAATest_AliasInstWithObjectOfImpreciseSize_Test::TestBody
(this=0x55555666f260)
    at
/mnt/sources/git/merge/llvm/unittests/Analysis/BasicAliasAnalysisTest.cpp:93
#7  0x0000555555e3a8e4 in
testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>
(
    object=0x55555666f260, method=&virtual testing::Test::TestBody(),
location=0x555556319b3b "the test body")
    at /mnt/sources/git/merge/llvm/utils/unittest/googletest/src/gtest.cc:2402
#8  0x0000555555e352c2 in
testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> (
    object=0x55555666f260, method=&virtual testing::Test::TestBody(),
location=0x555556319b3b "the test body")
    at /mnt/sources/git/merge/llvm/utils/unittest/googletest/src/gtest.cc:2455
#9  0x0000555555e1d842 in testing::Test::Run (this=0x55555666f260)
    at /mnt/sources/git/merge/llvm/utils/unittest/googletest/src/gtest.cc:2474
#10 0x0000555555e1e000 in testing::TestInfo::Run (this=0x555556657d70)
    at /mnt/sources/git/merge/llvm/utils/unittest/googletest/src/gtest.cc:2656
#11 0x0000555555e1e5ea in testing::TestCase::Run (this=0x555556657f10)
    at /mnt/sources/git/merge/llvm/utils/unittest/googletest/src/gtest.cc:2774
#12 0x0000555555e244f8 in testing::internal::UnitTestImpl::RunAllTests
(this=0x555556657120)
    at /mnt/sources/git/merge/llvm/utils/unittest/googletest/src/gtest.cc:4649
#13 0x0000555555e3ba52 in
testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl,
bool> (object=0x555556657120,
    method=(bool
(testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const))
0x555555e24226 <testing::internal::UnitTestImpl::RunAllTests()>,
    location=0x55555631a378 "auxiliary test code (environments or event
listeners)")
    at /mnt/sources/git/merge/llvm/utils/unittest/googletest/src/gtest.cc:2402
#14 0x0000555555e35cc9 in
testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl,
bool> (object=0x555556657120,
    method=(bool
(testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const))
0x555555e24226 <testing::internal::UnitTestImpl::RunAllTests()>,
    location=0x55555631a378 "auxiliary test code (environments or event
listeners)")
    at /mnt/sources/git/merge/llvm/utils/unittest/googletest/src/gtest.cc:2455
#15 0x0000555555e23389 in testing::UnitTest::Run (this=0x555556644680
<testing::UnitTest::GetInstance()::instance>)
    at /mnt/sources/git/merge/llvm/utils/unittest/googletest/src/gtest.cc:4257
#16 0x0000555555e16b1b in RUN_ALL_TESTS ()
    at
/mnt/sources/git/merge/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233
#17 0x0000555555e16a95 in main (argc=1, argv=0x7fffffffe378)
    at /mnt/sources/git/merge/llvm/utils/unittest/UnitTestMain/TestMain.cpp:51

Unfortunately I do not know what revision I was building/testing with, but this
should give some context hopefully.

I did run the failure once in LLDB, but it was also not able to find symbols
and couldn't give much more information, but I am including it here in case it
helps:

[----------] 2 tests from BasicAATest
[ RUN      ] BasicAATest.AliasInstWithObjectOfImpreciseSize
Process 16335 stopped
* thread #1: tid = 16335, 0x0000000000525199
AnalysisTests`llvm::AAResults::alias(llvm::MemoryLocation const&,
llvm::MemoryLocation const&, llvm::AAQueryInfo&) + 41, name = 'AnalysisTests',
stop reason = signal SIGSEGV: invalid address
(fault address: 0xfffffffffffffffe)
    frame #0: 0x0000000000525199
AnalysisTests`llvm::AAResults::alias(llvm::MemoryLocation const&,
llvm::MemoryLocation const&, llvm::AAQueryInfo&) + 41
AnalysisTests`llvm::AAResults::alias:
->  0x525199 <+41>: movq   (%rbx), %rdi
    0x52519c <+44>: movq   %r12, %rcx
    0x52519f <+47>: movq   %r13, %rdx
    0x5251a2 <+50>: movq   %r14, %rsi
(lldb) bt
* thread #1: tid = 16335, 0x0000000000525199
AnalysisTests`llvm::AAResults::alias(llvm::MemoryLocation const&,
llvm::MemoryLocation const&, llvm::AAQueryInfo&) + 41, name = 'AnalysisTests',
stop reason = signal SIGSEGV: invalid address
(fault address: 0xfffffffffffffffe)
  * frame #0: 0x0000000000525199
AnalysisTests`llvm::AAResults::alias(llvm::MemoryLocation const&,
llvm::MemoryLocation const&, llvm::AAQueryInfo&) + 41
    frame #1: 0x000000000053de1c
AnalysisTests`llvm::BasicAAResult::aliasCheck(llvm::Value const*,
llvm::LocationSize, llvm::AAMDNodes, llvm::Value const*, llvm::LocationSize,
llvm::AAMDNodes, llvm::AAQueryInfo&, llvm::Value const*, llvm::Value const*) +
2300
    frame #2: 0x000000000053fcb8
AnalysisTests`llvm::BasicAAResult::alias(llvm::MemoryLocation const&,
llvm::MemoryLocation const&, llvm::AAQueryInfo&) + 568
    frame #3: 0x0000000000435acb
AnalysisTests`BasicAATest_AliasInstWithObjectOfImpreciseSize_Test::TestBody() +
1003
    frame #4: 0x0000000000848b72 AnalysisTests`testing::Test::Run() + 162
    frame #5: 0x0000000000848cb0 AnalysisTests`testing::TestInfo::Run() + 272
    frame #6: 0x0000000000848d75 AnalysisTests`testing::TestCase::Run() + 165
    frame #7: 0x000000000084c7a7
AnalysisTests`testing::internal::UnitTestImpl::RunAllTests() + 599
    frame #8: 0x000000000084cac1 AnalysisTests`testing::UnitTest::Run() + 81
    frame #9: 0x0000000000427fc5 AnalysisTests`main + 117
    frame #10: 0x00007ffff6d3a830
libc.so.6`__libc_start_main(main=(AnalysisTests`main), argc=1,
argv=0x00007fffffffe4e8, init=<unavailable>, fini=<unavailable>,
rtld_fini=<unavailable>, stack_end=0x00007fffffffe4d8) + 240 at
libc-start.c:291
    frame #11: 0x00000000004285b9 AnalysisTests`_start + 41

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190723/e19af632/attachment.html>


More information about the llvm-bugs mailing list