[llvm-bugs] [Bug 40219] New: WebAssembly: handleWeakUndefines(): Assertion `FuncSym->Signature' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 3 13:20:18 PST 2019


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

            Bug ID: 40219
           Summary: WebAssembly: handleWeakUndefines(): Assertion
                    `FuncSym->Signature' failed.
           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

Running emcc on this testcase:

===
#include <stdio.h>

extern int __attribute__((weak)) externWeak();

int main() {
  printf("%p\n", externWeak);
  if (externWeak) externWeak();
  printf("ok.\n");
}
===

fails with

===
$ emcc a.cpp
wasm-ld: lld/wasm/Driver.cpp:309: void handleWeakUndefines(): Assertion
`FuncSym->Signature' failed.
Stack dump:
0.      Program arguments: llvm/build/bin/wasm-ld --export-dynamic -z
stack-size=5242880 --global-base=1024 --initial-memory=16777216 -o
/tmp/emscripten_temp_sTTiBb/a.out.wasm --no-entry --allow-undefined
--import-memory --import-table --export __wasm_call_ctors --export __data_end
--lto-O0 /tmp/emscripten_temp_sTTiBb/a_0.o .emscripten_cache/wasm_bc/libc.bc
.emscripten_cache/wasm_bc/libc-wasm.bc .emscripten_cache/wasm_bc/libdlmalloc.bc
.emscripten_cache/wasm_bc/libcompiler_rt.a
.emscripten_cache/wasm_bc/libcompiler_rt_wasm.a
.emscripten_cache/wasm_bc/libc_rt_wasm.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 
#0 0x000055a51502006a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(llvm/build/bin/wasm-ld+0x52a06a)
#1 0x000055a51501e594 llvm::sys::RunSignalHandlers()
(llvm/build/bin/wasm-ld+0x528594)
#2 0x000055a51501e6c2 SignalHandler(int) (llvm/build/bin/wasm-ld+0x5286c2)
#3 0x00007f67cd2f70c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x110c0)
#4 0x00007f67cbacefcf gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x32fcf)
#5 0x00007f67cbad03fa abort (/lib/x86_64-linux-gnu/libc.so.6+0x343fa)
#6 0x00007f67cbac7e37 (/lib/x86_64-linux-gnu/libc.so.6+0x2be37)
#7 0x00007f67cbac7ee2 (/lib/x86_64-linux-gnu/libc.so.6+0x2bee2)
#8 0x000055a514f09ced handleWeakUndefines() (llvm/build/bin/wasm-ld+0x413ced)
#9 0x000055a51524e707 (anonymous
namespace)::LinkerDriver::link(llvm::ArrayRef<char const*>) (.constprop.320)
(llvm/build/bin/wasm-ld+0x758707)
#10 0x000055a51524ef3f lld::wasm::link(llvm::ArrayRef<char const*>, bool,
llvm::raw_ostream&) (llvm/build/bin/wasm-ld+0x758f3f)
#11 0x000055a514f75577 main (llvm/build/bin/wasm-ld+0x47f577)
#12 0x00007f67cbabc2b1 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x202b1)
#13 0x000055a515007e4a _start (llvm/build/bin/wasm-ld+0x511e4a)
===

See also

 * https://github.com/kripken/emscripten-fastcomp/pull/248
 * https://github.com/kripken/emscripten/pull/7805

-- 
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/20190103/b201d096/attachment.html>


More information about the llvm-bugs mailing list