-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Path bytes returned from wasi::fd_prestat_dir_name
appended by 0
#3025
Comments
This indeed seems like a bug and we should fix it. Thanks for creating the issue! |
This one is fixed by #3061 |
Openned a ticket in WASI specs site to get clarity on the behaviour: WebAssembly/WASI#492 |
@Mo-Fatah the fix is merge in master, you can test and see it's fixed now. |
ptitSeb
added a commit
that referenced
this issue
Oct 20, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I used this wasi crate to compare the behavior of
WASI
implementations betweenwasmtime
andwasmer
.Initially, I used wasi::fd_prestat_get and wasi::fd_prestat_dir_name .
Apparently all path/dir/file names (in bytes) returned from
fd_prestat_dir_name
are appended by0
.I am using
Steps to reproduce
I wrote a simple program here that prints either
wasmer
orwasmtime
based on the directory name returned fromfd_prestat_dir_name
.1- The program takes an environment variable which is the directory name , this will be arg
2- Then, I used
fd_prestat_get
andfd_prestat_dir_name
to access the directory passed to the engine throughWASI
interface which will be stored in dst variable.3- I compared the dir name bytes which passed to the program (
arg
) against the name bytes returned from theWASI
interfacehttps://github.com/Mo-Fatah/wasi-testsuite/blob/13ccd4d9ebd6d326dcb487ebadf2917088c07223/engines-diff/end-of-path/src/main.rs#L37-L46
Expected behavior
Assuming that the directory name is
scratch_dir
and it is located in the root of the program.wasmtime
bywasmtime --dir scratch_dir ./target/wasm32-wasi/debug/end-of-path.wasm scratch_dir
the
arg
bytes anddst
bytes will be exactly the same (as they should be)wasmer
should get the exact outputActual behavior
2- Executing with
wasmer
bywasmer run --dir scratch_dir ./target/wasm32-wasi/debug/end-of-path.wasm scratch_dir
the
dst
variable will be appended by0
Additional context
I am testing
wasi
implementation of different engines. I started withwasmtime
andwasmer
and I noticed this behavior fromwasmer
which I assume not correct.The text was updated successfully, but these errors were encountered: