[llvm-bugs] [Bug 46348] New: Assertion failure during report of duplicate symbol error

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 16 03:53:49 PDT 2020


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

            Bug ID: 46348
           Summary: Assertion failure during report of duplicate symbol
                    error
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: jh7370.2008 at my.bristol.ac.uk
                CC: llvm-bugs at lists.llvm.org, smithp352 at googlemail.com

Created attachment 23620
  --> https://bugs.llvm.org/attachment.cgi?id=23620&action=edit
Reproducer

Whilst experimenting with a script to generate some objects with debug data and
then linking them, I ran into an assertion produced by LLD whilst it was
reporting a duplicate symbol error. The full output is:

PS C:\Work\TOOLCHAIN-5886> C:\llvm\build\Debug\bin\ld.lld.exe test.o test2.o -o
test.elf --reproduce=repro.tar
Assertion failed: Val && "isa<> used on a null pointer", file
C:\llvm\llvm-project\llvm\include\llvm/Support/Casting.h, line 104
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0.      Program arguments: C:\llvm\build\Debug\bin\ld.lld.exe test.o test2.o -o
test.elf --reproduce=repro.tar
 #0 0x00007ff639c3839c HandleAbort
c:\llvm\llvm-project\llvm\lib\support\windows\signals.inc:408:0
 #1 0x00007ff9aac9c3e1 (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0x6c3e1)
 #2 0x00007ff9aac9e039 (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0x6e039)
 #3 0x00007ff9aaca3c65 (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0x73c65)
 #4 0x00007ff9aaca37d7 (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0x737d7)
 #5 0x00007ff9aaca1841 (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0x71841)
 #6 0x00007ff9aaca41cf (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0x741cf)
 #7 0x00007ff639f8aecc llvm::isa_impl_cl<class lld::elf::Defined, class
lld::elf::Symbol const *>::doit(class lld::elf::Symbol const *)
c:\llvm\llvm-project\llvm\include\llvm\support\casting.h:104:0
 #8 0x00007ff639f8b5fb llvm::isa_impl_wrap<class lld::elf::Defined, class
lld::elf::Symbol const *, class lld::elf::Symbol const *>::doit(class
lld::elf::Symbol const *const &)
c:\llvm\llvm-project\llvm\include\llvm\support\casting.h:132:0
 #9 0x00007ff639f8b647 llvm::isa_impl_wrap<class lld::elf::Defined, class
lld::elf::Symbol *const, class lld::elf::Symbol const *>::doit(class
lld::elf::Symbol *const &)
c:\llvm\llvm-project\llvm\include\llvm\support\casting.h:124:0
#10 0x00007ff639f5aff8 llvm::isa<class lld::elf::Defined, class
lld::elf::Symbol *>(class lld::elf::Symbol *const &)
c:\llvm\llvm-project\llvm\include\llvm\support\casting.h:143:0
#11 0x00007ff639f53168 llvm::dyn_cast<class lld::elf::Defined, class
lld::elf::Symbol>(class lld::elf::Symbol *)
c:\llvm\llvm-project\llvm\include\llvm\support\casting.h:339:0
#12 0x00007ff63a042d6f lld::elf::InputSectionBase::getObjMsg(unsigned __int64)
c:\llvm\llvm-project\lld\elf\inputsection.cpp:350:0
#13 0x00007ff63a074d6a reportDuplicate
c:\llvm\llvm-project\lld\elf\symbols.cpp:643:0
#14 0x00007ff63a073861 lld::elf::Symbol::resolveDefined(class lld::elf::Defined
const &) c:\llvm\llvm-project\lld\elf\symbols.cpp:691:0
#15 0x00007ff63a0731a4 lld::elf::Symbol::resolve(class lld::elf::Symbol const
&) c:\llvm\llvm-project\lld\elf\symbols.cpp:425:0
#16 0x00007ff63a036ab8 lld::elf::ObjFile<struct llvm::object::ELFType<1,
1>>::initializeSymbols(void) c:\llvm\llvm-project\lld\elf\inputfiles.cpp:1142:0
#17 0x00007ff63a03b5c4 lld::elf::ObjFile<struct llvm::object::ELFType<1,
1>>::parse(bool) c:\llvm\llvm-project\lld\elf\inputfiles.cpp:402:0
#18 0x00007ff639fb2625 doParseFile<llvm::object::ELFType<1,1> >
c:\llvm\llvm-project\lld\elf\inputfiles.cpp:209:0
#19 0x00007ff639fafeff lld::elf::parseFile(class lld::elf::InputFile *)
c:\llvm\llvm-project\lld\elf\inputfiles.cpp:222:0
#20 0x00007ff639f5b90f lld::elf::LinkerDriver::link<struct
llvm::object::ELFType<1, 1>>(class llvm::opt::InputArgList &)
c:\llvm\llvm-project\lld\elf\driver.cpp:1870:0
#21 0x00007ff639f299b5 lld::elf::LinkerDriver::main(class llvm::ArrayRef<char
const *>) c:\llvm\llvm-project\lld\elf\driver.cpp:526:0
#22 0x00007ff639f2b55c lld::elf::link(class llvm::ArrayRef<char const *>, bool,
class llvm::raw_ostream &, class llvm::raw_ostream &)
c:\llvm\llvm-project\lld\elf\driver.cpp:119:0
#23 0x00007ff639b50942 main c:\llvm\llvm-project\lld\tools\lld\lld.cpp:149:0
#24 0x00007ff6404485c4 invoke_main
d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:79:0
#25 0x00007ff6404484ae __scrt_common_main_seh
d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0
#26 0x00007ff64044836e __scrt_common_main
d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:331:0
#27 0x00007ff640448659 mainCRTStartup
d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp:17:0
#28 0x00007ff9f4307bd4 (C:\WINDOWS\System32\KERNEL32.DLL+0x17bd4)
#29 0x00007ff9f488ce51 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x6ce51)

I'll attach the repro.tar file too.

-- 
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/20200616/9c79c906/attachment-0001.html>


More information about the llvm-bugs mailing list