Stream: general

Topic: debugging llvm assertions

mikeyhew (Oct 17 2018 at 23:53, on Zulip):

Does anyone have experience debugging failing llvm assertions? I managed to get a partial backtrace using lldb, but it's missing all the "in between" call locations (the ones that are inlined). I'm not sure it would actually help, either

mikeyhew (Oct 17 2018 at 23:54, on Zulip):

This is the one I'm getting:

rustc: /users/mahewson/rust2/src/llvm/lib/IR/Value.cpp:256: void llvm::Value::setNameImpl(const llvm::Twine&): Assertion `!getType()->isVoidTy() && "Cannot assign a name to void values!"' failed.
nagisa (Oct 18 2018 at 14:01, on Zulip):

Usually what I do is first see what is the source of an assertion

nagisa (Oct 18 2018 at 14:02, on Zulip):

if it comes from deep within LLVM while it is optimising stuff, it is usually an LLVM’s fault

nagisa (Oct 18 2018 at 14:02, on Zulip):

in that case I just use LLVM’s logging functionality (-debug, -print-after-all, -print-before-all and friends)

mikeyhew (Oct 18 2018 at 23:07, on Zulip):

OK thanks. Yeah, it's during lto, so I guess a full backtrace wouldn't show any of the code that I worked on, instead it's the generated IR that's triggering the assertion failure somehow

Last update: Jan 28 2020 at 08:15UTC