[llvm-bugs] [Bug 45457] New: Crash in MarkLive

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 7 05:05:15 PDT 2020


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

            Bug ID: 45457
           Summary: Crash in MarkLive
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: wasm
          Assignee: unassignedbugs at nondot.org
          Reporter: sks_f at mail.ru
                CC: llvm-bugs at lists.llvm.org, sbc at chromium.org

I have crash in wasm-lld, here is stack trace:

 #4 0x00007f392408fb20 __restore_rt (/lib64/libpthread.so.0+0x14b20)
 #5 0x00007f3922856625 raise (/lib64/libc.so.6+0x3c625)
 #6 0x00007f392283f8d9 abort (/lib64/libc.so.6+0x258d9)
 #7 0x00007f392283f7a9 _nl_load_domain.cold (/lib64/libc.so.6+0x257a9)
 #8 0x00007f392284ea66 (/lib64/libc.so.6+0x34a66)
 #9 0x00007f3923fa1c58 lld::wasm::Symbol::markLive()
llvm_source/tools/lld/wasm/Symbols.cpp:129:40
#10 0x00007f3923f8f7e5 lld::wasm::(anonymous
namespace)::MarkLive::enqueue(lld::wasm::Symbol*)
llvm_source/tools/lld/wasm/MarkLive.cpp:65:40
#11 0x00007f3923f8fe5b lld::wasm::(anonymous namespace)::MarkLive::mark()
llvm_source/tools/lld/wasm/MarkLive.cpp:151:14
#12 0x00007f3923f8fc3d lld::wasm::(anonymous namespace)::MarkLive::run()
llvm_source/tools/lld/wasm/MarkLive.cpp:111:1
#13 0x00007f3923f8ff31 lld::wasm::markLive()
llvm_source/tools/lld/wasm/MarkLive.cpp:166:15
#14 0x00007f3923f4f4ec lld::wasm::(anonymous
namespace)::LinkerDriver::link(llvm::ArrayRef<char const*>)
llvm_source/tools/lld/wasm/Driver.cpp:792:14
#15 0x00007f3923f4ad25 lld::wasm::link(llvm::ArrayRef<char const*>, bool,
llvm::raw_ostream&) llvm_source/tools/lld/wasm/Driver.cpp:93:3
#16 0x00000000004037fd main llvm_source/tools/lld/tools/lld/lld.cpp:160:12
#17 0x00007f39228411a3 __libc_start_main (/lib64/libc.so.6+0x271a3)

I was able to debug lld to see what's happening, so there is my observations:

Crash occurs because symbol is discarded due comdat. This symbol has local
binding (sym.isBindingLocal() == true) in InputFiles.cpp, It is created here
https://github.com/llvm/llvm-project/blob/aff75e1a1facbc6cc274070690ff3d725325c0f1/lld/wasm/InputFiles.cpp#L401
as DefinedFunction (but discarded == true). 

Later, in MarkLive::run() some relocation has reference to this symbol and in
ASSERT(isDiscarded) cause this crash.

Is this bug in wasm-ld, that incorrectly handles isBindingLocal == true with
comdat or this is CodeGen bug, that incorrectly generates comdat for that
symbol ?
Is it legal to have isBindingLocal == true simultaneosly with comdat group?

-- 
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/20200407/4a4777f9/attachment-0001.html>


More information about the llvm-bugs mailing list