Skip to content
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

Flushing bug? #4340

Closed
Userzxcvbvnm opened this issue Dec 2, 2023 · 2 comments · Fixed by #4348
Closed

Flushing bug? #4340

Userzxcvbvnm opened this issue Dec 2, 2023 · 2 comments · Fixed by #4348
Labels
bug Something isn't working 📦 lib-vfs About wasmer-vfs 📦 lib-wasi About wasmer-wasi priority-medium Medium priority issue
Milestone

Comments

@Userzxcvbvnm
Copy link
Contributor

Userzxcvbvnm commented Dec 2, 2023

Describe the bug

The test case is uploaded:
sync-wasm.txt
sync-c.txt
sync.c is uploaded as sync-c.txt, sync.wasm is uploaded as sync-wasm.txt.

Steps to reproduce

wasmer run --dir=./Data sync.wasm

Expected behavior

Successfully sync to the disk and prints "File data in 'Data/hello.txt' synchronized to disk successfully."

Actual behavior

wasmer sync fails and prints:
Error synchronizing file data to disk.

Additional context

We checked the wasmer source code and found that the bug could be in wasmer_wasix::fs:lib/wasix/src/fs/mod.rs.
This is because the fd_datasync method implemented in wasmer calls the flush method, which checks whether the current file descriptor has the FD_DATASYNC permission. If it does, it returns Errno::Access, causing the error in the output information. The permission check here needs to be corrected. It should be modified to return Errno::Access only if the permission is not included.
截屏2023-12-02 16 51 52

@theduke
Copy link
Contributor

theduke commented Dec 5, 2023

Looks related to #4323 .

@theduke theduke added bug Something isn't working 📦 lib-wasi About wasmer-wasi 📦 lib-vfs About wasmer-vfs priority-medium Medium priority issue labels Dec 5, 2023
@theduke theduke added this to the v4.3 milestone Dec 5, 2023
@Userzxcvbvnm
Copy link
Contributor Author

We add a pull request :#4348

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📦 lib-vfs About wasmer-vfs 📦 lib-wasi About wasmer-wasi priority-medium Medium priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants