llvm / llvm/llvm-project

[AArch64] Assertion `E <= size() && "Attempted to reset out-of-bounds range!"' failed.

Open
#167,838 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backend:AArch64 crash
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Reproduer:
https://godbolt.org/z/4Y7czPrx4

Backtrace:
```console
llc: /root/llvm-project/llvm/include/llvm/ADT/BitVector.h:424: llvm::BitVector& llvm::BitVector::reset(unsigned int, unsigned int): Assertion `E <= size() && "Attempted to reset out-of-bounds range!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel
1. Running pass 'Function Pass Manager' on module ''.
2. Running pass 'Prologue/Epilogue Insertion & Frame Finalization' on function '@warn_vla'
#0 0x00000000041c2638 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x41c2638)
#1 0x00000000041bf4e4 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#2 0x000075e072042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x000075e0720969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x000075e072042476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x000075e0720287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x000075e07202871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#7 0x000075e072039e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#8 0x000000000326282b llvm::BitVector::reset(unsigned int, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x326282b)
#9 0x0000000003269c07 (anonymous namespace)::PEIImpl::calculateFrameObjectOffsets(llvm::MachineFunction&) PrologEpilogInserter.cpp:0:0
#10 0x000000000326b22c (anonymous namespace)::PEIImpl::run(llvm::MachineFunction&) (.constprop.0) PrologEpilogInserter.cpp:0:0
#11 0x000000000326dc3a (anonymous namespace)::PEILegacy::runOnMachineFunction(llvm::MachineFunction&) PrologEpilogInserter.cpp:0:0
#12 0x00000000030a1219 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#13 0x00000000036f0a06 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36f0a06)
#14 0x00000000036f0db1 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36f0db1)
#15 0x00000000036f161f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36f161f)
#16 0x00000000008fca42 compileModule(char**, llvm::LLVMContext&, std::__cxx11::basic_string, std::allocator>&) llc.cpp:0:0
#17 0x00000000007c84f9 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c84f9)
#18 0x000075e072029d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#19 0x000075e072029e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#20 0x00000000008f1275 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8f1275)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Godbolt reproducer and the llc Prologue/Epilogue Insertion & Frame Finalization pass named in the backtrace. Inspect llvm/ADT/BitVector.h:424 and PrologEpilogInserter.cpp, especially calculateFrameObjectOffsets, then reproduce with an assertions-enabled llc build. Done means the reproducer no longer triggers the out-of-bounds reset assertion.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.