[PATCH] D84803: [ThinLTO][Legacy] Compute PreservedGUID based on IRName in Symtab

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 12:24:31 PDT 2020


steven_wu added a comment.

In D84803#2244918 <https://reviews.llvm.org/D84803#2244918>, @dmajor wrote:

> Hi, we're seeing an assertion failure in one of the Firefox LTO bots:
>
>   char llvm::StringRef::operator[](size_t) const: Assertion `Index < Length && "Invalid index!"' failed.
>
> I'm still working on finishing the bisection but I have a hunch that it may be this change. Unfortunately I can't seem to get a backtrace out of this particular bot.
>
> As a guess, could it be the `operator[]` in `getGlobalIdentifier` at https://github.com/llvm/llvm-project/blob/4cb016cd2d8467c572b2e5c5d34f376ee79e4ac1/llvm/lib/IR/Globals.cpp#L140 ? It looks like there was previously a check for `Name.size() > 0` that isn't checked anymore.

It would be good to have a test case for this. The only way that can happen is either:

- Firefox pass a preserved symbol that is empty string and thus that symbol has IRName of empty string
- Somehow the IRName associated with a non-empty symbol is empty string.

I can attempt a fix but I am not sure if any of the case above can happen.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84803/new/

https://reviews.llvm.org/D84803



More information about the llvm-commits mailing list