Stream: git-wasmtime

Topic: wasmtime / Issue #2878 command export '_ZSt7nothrow' is n...


view this post on Zulip Wasmtime GitHub notifications bot (May 06 2021 at 20:10):

vshymanskyy opened Issue #2878:

Steps to Reproduce

git clone https://github.com/wasm3/wasm3-self-compiling.git

cd wasm3-self-compiling

wasmtime run --mapdir=/::. --mapdir=./::. ./wasm/clang.wasm -- -cc1 -triple wasm32-unknown-wasi -isysroot /sys -internal-isystem /sys/include -emit-obj -o source/hello/hello.o source/hello/hello.c -O3

Expected Results

Compilation succeeds

Actual Results

Error: failed to run main module `./wasm/clang.wasm`

Caused by:
    0: failed to instantiate "./wasm/clang.wasm"
    1: command export '_ZSt7nothrow' is not a function

Versions and Environment

Wasmtime version or commit: 0.26.0

Operating system: Ubuntu 21.04
Architecture: x86-64

Extra Info

A similar command works with Wasm3, Wasmer, Node.js (wasm-run)

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2021 at 20:10):

vshymanskyy labeled Issue #2878:

Steps to Reproduce

git clone https://github.com/wasm3/wasm3-self-compiling.git

cd wasm3-self-compiling

wasmtime run --mapdir=/::. --mapdir=./::. ./wasm/clang.wasm -- -cc1 -triple wasm32-unknown-wasi -isysroot /sys -internal-isystem /sys/include -emit-obj -o source/hello/hello.o source/hello/hello.c -O3

Expected Results

Compilation succeeds

Actual Results

Error: failed to run main module `./wasm/clang.wasm`

Caused by:
    0: failed to instantiate "./wasm/clang.wasm"
    1: command export '_ZSt7nothrow' is not a function

Versions and Environment

Wasmtime version or commit: 0.26.0

Operating system: Ubuntu 21.04
Architecture: x86-64

Extra Info

A similar command works with Wasm3, Wasmer, Node.js (wasm-run)

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2021 at 20:28):

peterhuene commented on Issue #2878:

@sunfishcode the repro clang.wasm exports a bunch of globals that aren't expected for "commands" to export.

Perhaps we should warn on or ignore non-function exports for commands (that we don't otherwise have a deprecation message for)?

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2021 at 20:35):

tschneidereit commented on Issue #2878:

Is this the same issue as in #2587?

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2021 at 20:38):

peterhuene commented on Issue #2878:

It appears to be.

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2021 at 20:39):

peterhuene edited a comment on Issue #2878:

It appears to be and I think your proposed solution there is a good one.

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2021 at 20:47):

vshymanskyy commented on Issue #2878:

Duplicate of #2587. Sorry didn't notice it!

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2021 at 20:47):

vshymanskyy closed Issue #2878:

Steps to Reproduce

git clone https://github.com/wasm3/wasm3-self-compiling.git

cd wasm3-self-compiling

wasmtime run --mapdir=/::. --mapdir=./::. ./wasm/clang.wasm -- -cc1 -triple wasm32-unknown-wasi -isysroot /sys -internal-isystem /sys/include -emit-obj -o source/hello/hello.o source/hello/hello.c -O3

Expected Results

Compilation succeeds

Actual Results

Error: failed to run main module `./wasm/clang.wasm`

Caused by:
    0: failed to instantiate "./wasm/clang.wasm"
    1: command export '_ZSt7nothrow' is not a function

Versions and Environment

Wasmtime version or commit: 0.26.0

Operating system: Ubuntu 21.04
Architecture: x86-64

Extra Info

A similar command works with Wasm3, Wasmer, Node.js (wasm-run)

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2021 at 20:49):

vshymanskyy edited a comment on Issue #2878:

Duplicate of #2587. Sorry didn't notice it!
Is there any workaround currently?

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2021 at 20:51):

tschneidereit commented on Issue #2878:

No worries at all—thank you for the report!

Is there any workaround currently?

I don't think there is, I'm afraid :( I think the solution in the other bug shouldn't be too hard to implement, but I unfortunately don't have the bandwidth to do so right now :(

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2021 at 21:13):

peterhuene commented on Issue #2878:

I have a fix ready that I'll put up a PR shortly for.

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2021 at 21:25):

sunfishcode commented on Issue #2878:

@vshymanskyy Can you describe how you produced the wasm file? Workarounds are one thing, but I'm also curious if there's an underlying bug in clang or wasm-ld here. Are you using any special flags, like --export-dynamic?

view this post on Zulip Wasmtime GitHub notifications bot (May 07 2021 at 06:24):

vshymanskyy commented on Issue #2878:

@sunfishcode it was found in the wild: https://wapm.io/package/clang :grinning:

view this post on Zulip Wasmtime GitHub notifications bot (May 07 2021 at 06:26):

vshymanskyy edited a comment on Issue #2878:

@sunfishcode it was found in the wild: https://wapm.io/package/clang :grinning:
The files were produced by @binji : https://github.com/binji/llvm-project/releases


Last updated: Nov 22 2024 at 16:03 UTC