[llvm-bugs] [Bug 40204] New: [WebAssembly] SDL2_mixer crash on linking with --relocatable

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 2 10:36:25 PST 2019


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

            Bug ID: 40204
           Summary: [WebAssembly] SDL2_mixer crash on linking with
                    --relocatable
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: alonzakai at gmail.com
                CC: llvm-bugs at lists.llvm.org, peter.smith at linaro.org

Created attachment 21284
  --> https://bugs.llvm.org/attachment.cgi?id=21284&action=edit
libSDL2_mixer.a

Original report in

https://github.com/kripken/emscripten/issues/7702

Simplified STR:

wasm-ld --export-dynamic -z stack-size=5242880 --global-base=1024
--initial-memory=16777216 -o playwave --no-entry --allow-undefined
--import-memory --import-table --export __wasm_call_ctors --export __data_end
--lto-O0 playwave.o libSDL2_mixer.a --max-memory=16777216 -mllvm
-combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm
-disable-lsr --export main --export malloc --export free --export setThrew
--export __errno_location --export fflush --relocatable

Crash:

wasm-ld: /home/username/Dev/llvm/tools/lld/wasm/Symbols.cpp:78: uint32_t
lld::wasm::Symbol::getOutputSymbolIndex() const: Assertion `OutputSymbolIndex
!= INVALID_INDEX' failed.
Stack dump:
0.      Program arguments: /home/username/Dev/llvm/build/bin/wasm-ld
--export-dynamic -z stack-size=5242880 --global-base=1024
--initial-memory=16777216 -o playwave --no-entry --allow-undefined
--import-memory --import-table --export __wasm_call_ctors --export __data_end
--lto-O0 playwave.o libSDL2_mixer.a --max-memory=16777216 -mllvm
-combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm
-disable-lsr --export main --export malloc --export free --export setThrew
--export __errno_location --export fflush --relocatable 
#0 0x0000558a870103fa llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/username/Dev/llvm/build/bin/wasm-ld+0x5313fa)
#1 0x0000558a8700e924 llvm::sys::RunSignalHandlers()
(/home/username/Dev/llvm/build/bin/wasm-ld+0x52f924)
#2 0x0000558a8700ea52 SignalHandler(int)
(/home/username/Dev/llvm/build/bin/wasm-ld+0x52fa52)
#3 0x00007f329486e0c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x110c0)
#4 0x00007f3293489fcf gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x32fcf)
#5 0x00007f329348b3fa abort (/lib/x86_64-linux-gnu/libc.so.6+0x343fa)
#6 0x00007f3293482e37 (/lib/x86_64-linux-gnu/libc.so.6+0x2be37)
#7 0x00007f3293482ee2 (/lib/x86_64-linux-gnu/libc.so.6+0x2bee2)
#8 0x0000558a873c64a5 lld::wasm::Symbol::getOutputSymbolIndex() const
(/home/username/Dev/llvm/build/bin/wasm-ld+0x8e74a5)
#9 0x0000558a873adf55
lld::wasm::ObjFile::calcNewIndex(llvm::wasm::WasmRelocation const&) const
(/home/username/Dev/llvm/build/bin/wasm-ld+0x8cef55)
#10 0x0000558a873abd33
lld::wasm::InputChunk::writeRelocations(llvm::raw_ostream&) const
(/home/username/Dev/llvm/build/bin/wasm-ld+0x8ccd33)
#11 0x0000558a873e989a
lld::wasm::CodeSection::writeRelocations(llvm::raw_ostream&) const
(/home/username/Dev/llvm/build/bin/wasm-ld+0x90a89a)
#12 0x0000558a873cb8ba (anonymous namespace)::Writer::createRelocSections()
(/home/username/Dev/llvm/build/bin/wasm-ld+0x8ec8ba)
#13 0x0000558a873ce1bd (anonymous namespace)::Writer::createSections()
(/home/username/Dev/llvm/build/bin/wasm-ld+0x8ef1bd)
#14 0x0000558a873d1426 (anonymous namespace)::Writer::run()
(/home/username/Dev/llvm/build/bin/wasm-ld+0x8f2426)
#15 0x0000558a873d1b3b lld::wasm::writeResult()
(/home/username/Dev/llvm/build/bin/wasm-ld+0x8f2b3b)
#16 0x0000558a873a4ef4 (anonymous
namespace)::LinkerDriver::link(llvm::ArrayRef<char const*>)
(/home/username/Dev/llvm/build/bin/wasm-ld+0x8c5ef4)
#17 0x0000558a873a17d9 lld::wasm::link(llvm::ArrayRef<char const*>, bool,
llvm::raw_ostream&) (/home/username/Dev/llvm/build/bin/wasm-ld+0x8c27d9)
#18 0x0000558a86ff70d9 main
(/home/username/Dev/llvm/build/bin/wasm-ld+0x5180d9)
#19 0x00007f32934772b1 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x202b1)
#20 0x0000558a86ff505a _start
(/home/username/Dev/llvm/build/bin/wasm-ld+0x51605a)
Aborted

-- 
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/20190102/b99c36f1/attachment.html>


More information about the llvm-bugs mailing list