[llvm-dev] BuildMI crashes on a certain probability on the exact same test

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Sun Nov 22 14:57:18 PST 2015


On 22 November 2015 at 14:42, Xiaochu Liu via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> 14 clang                    0x000000010e1bcb4d llvm::DebugLoc::DebugLoc(llvm::DebugLoc const&) + 29
>
> And the most strange thing is that this error does not happen
> everytime for the same test (it happens under certain probability) ?!
> Can anyone please show me some hints on how to debug this problem?

My best guess is that I == MBB.end(), in which case there is no
MachineInstr behind it and I->getDebugLoc() is accessing random memory
that may or may not resemble a MachineInstr. Try asserting it's valid
just before the BuildMI, or just stepping through in a debugger.

Cheers.

Tim.


More information about the llvm-dev mailing list