[llvm-bugs] [Bug 37643] New: [llvm-mca] crashes in ResourceManager::mustIssueImmediately()

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 31 11:52:23 PDT 2018


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

            Bug ID: 37643
           Summary: [llvm-mca] crashes in
                    ResourceManager::mustIssueImmediately()
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: TableGen
          Assignee: unassignedbugs at nondot.org
          Reporter: lebedev.ri at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 20367
  --> https://bugs.llvm.org/attachment.cgi?id=20367&action=edit
the sched model that causes the crash

I don't know if this is actually a mca bug, or maybe tablegen should
have somehow handled it.
I also don't quite have a good reproducer, since this happens on
my WIP-and-broken bdver2 sched model.

If you apply the patch, and run:
$ llvm-mca -mtriple=x86_64-unknown-linux-gnu -mcpu=bdver2 -iterations=10000
-timeline-max-cycles=80 -timeline-max-iterations=20 -all-stats -all-views new.s

It will crash:
$ /build/llvm-build-Clang6-release/bin/llvm-mca
-mtriple=x86_64-unknown-linux-gnu -mcpu=bdver2 -iterations=10000
-timeline-max-cycles=80 -timeline-max-iterations=20 -all-stats -all-views
/tmp/new.s 
llvm-mca: /build/llvm/tools/llvm-mca/Scheduler.cpp:169: auto
mca::ResourceManager::mustIssueImmediately(const mca::InstrDesc &)::(anonymous
class)::operator()(const unsigned int) const: Assertion `Resources[BufferMask]
&& "crash!"' failed.
Stack dump:
0.      Program arguments: /build/llvm-build-Clang6-release/bin/llvm-mca
-mtriple=x86_64-unknown-linux-gnu -mcpu=bdver2 -iterations=10000
-timeline-max-cycles=80 -timeline-max-iterations=20 -all-stats -all-views
/tmp/new.s 
#0 0x00007f9fad035884 PrintStackTraceSignalHandler(void*)
(/build/llvm-build-Clang6-release/bin/../lib/libLLVMSupport.so.7+0x13d884)
#1 0x00007f9fad03376e llvm::sys::RunSignalHandlers()
(/build/llvm-build-Clang6-release/bin/../lib/libLLVMSupport.so.7+0x13b76e)
#2 0x00007f9fad035a42 SignalHandler(int)
(/build/llvm-build-Clang6-release/bin/../lib/libLLVMSupport.so.7+0x13da42)
#3 0x00007f9facca1f50 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11f50)
#4 0x00007f9fabfcce7b gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x34e7b)
#5 0x00007f9fabfce231 abort (/lib/x86_64-linux-gnu/libc.so.6+0x36231)
#6 0x00007f9fabfc59da (/lib/x86_64-linux-gnu/libc.so.6+0x2d9da)
#7 0x00007f9fabfc5a52 (/lib/x86_64-linux-gnu/libc.so.6+0x2da52)
#8 0x000000000022d2c8 bool
__gnu_cxx::__ops::_Iter_negate<mca::ResourceManager::mustIssueImmediately(mca::InstrDesc
const&)::$_1>::operator()<__gnu_cxx::__normal_iterator<unsigned long const*,
std::vector<unsigned long, std::allocator<unsigned long> > >
>(__gnu_cxx::__normal_iterator<unsigned long const*, std::vector<unsigned long,
std::allocator<unsigned long> > >)
(/build/llvm-build-Clang6-release/bin/llvm-mca+0x22d2c8)
#9 0x000000000022a6cf mca::ResourceManager::mustIssueImmediately(mca::InstrDesc
const&) (/build/llvm-build-Clang6-release/bin/llvm-mca+0x22a6cf)
#10 0x000000000022b417 mca::Scheduler::scheduleInstruction(mca::InstRef&)
(/build/llvm-build-Clang6-release/bin/llvm-mca+0x22b417)
#11 0x0000000000216b78 mca::DispatchStage::dispatch(mca::InstRef)
(/build/llvm-build-Clang6-release/bin/llvm-mca+0x216b78)
#12 0x0000000000216c5c mca::DispatchStage::execute(mca::InstRef&)
(/build/llvm-build-Clang6-release/bin/llvm-mca+0x216c5c)
#13 0x00000000002152bf mca::Backend::runCycle(unsigned int)
(/build/llvm-build-Clang6-release/bin/llvm-mca+0x2152bf)
#14 0x00000000002151f7 mca::Backend::run()
(/build/llvm-build-Clang6-release/bin/llvm-mca+0x2151f7)
#15 0x0000000000221149 main
(/build/llvm-build-Clang6-release/bin/llvm-mca+0x221149)
#16 0x00007f9fabfb9a87 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21a87)
#17 0x000000000021502a _start
(/build/llvm-build-Clang6-release/bin/llvm-mca+0x21502a)
Aborted

Somehow even if the sched model is broken (it surely is, i don't know what i'm
doing :),
it shouldn't crash, probably, i think.

-- 
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/20180531/fdeb18c6/attachment-0001.html>


More information about the llvm-bugs mailing list