[llvm-bugs] [Bug 43250] New: lld crash on guid collision when using thinlto

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Sep 7 14:38:39 PDT 2019


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

            Bug ID: 43250
           Summary: lld crash on guid collision when using thinlto
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: the_jk at opera.com
                CC: llvm-bugs at lists.llvm.org, peter.smith at linaro.org

Created attachment 22479
  --> https://bugs.llvm.org/attachment.cgi?id=22479&action=edit
Full stacktrace

Happened upon a crash in lld when linking Chromium (see
https://crbug.com/1000691).

Two global symbols (one function and one variable) from different modules end
up with the same GUID.

When linking using thinlto this leads to a crash because code in
FunctionImportUtils.cpp treats any GlobalValue with a GlobalVarSummary attached
as a GlobalVariable but as both the symbols have the same GUID the global
function also has the GlobalVarSummary attached.

Assert:
ld.lld: chromium/src/third_party/llvm/llvm/include/llvm/Support/Casting.h:264:
typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X =
llvm::GlobalVariable, Y = llvm::GlobalValue]: Assertion `isa<X>(Val) &&
"cast<Ty>() argument of incompatible type!"' failed.

Top of stacktrace (full stacktrace attached):
#4  0x000056267cb57788 in llvm::cast<llvm::GlobalVariable, llvm::GlobalValue>
(Val=<optimized out>)
    at chromium/src/third_party/llvm/llvm/include/llvm/Support/Casting.h:264
#5  llvm::FunctionImportGlobalProcessing::processGlobalForThinLTO
(this=0x7f7ec9d06720, GV=...)
    at
chromium/src/third_party/llvm/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp:252
#6  0x000056267cb5792c in
llvm::FunctionImportGlobalProcessing::processGlobalsForThinLTO
(this=0x7f7ec9d06720)
    at
chromium/src/third_party/llvm/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp:296
#7  0x000056267cb57bfd in llvm::FunctionImportGlobalProcessing::run
(this=0x7f7ec9d06720)
    at
chromium/src/third_party/llvm/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp:312
#8  llvm::renameModuleForThinLTO (M=..., Index=..., GlobalsToImport=<optimized
out>)
    at
chromium/src/third_party/llvm/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp:319

-- 
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/20190907/65d92515/attachment.html>


More information about the llvm-bugs mailing list