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

Still fail to get the file discriptor? #4778

Open
Userzxcvbvnm opened this issue Jun 1, 2024 · 3 comments
Open

Still fail to get the file discriptor? #4778

Userzxcvbvnm opened this issue Jun 1, 2024 · 3 comments
Assignees
Labels
bug Something isn't working priority-high High priority issue

Comments

@Userzxcvbvnm
Copy link
Contributor

This is related to #4753, which may not be resolved.

@maminrayej
Copy link
Contributor

I figured out the difference in our setup. With wasix-libc, the provided test works, but using wasi-libc it does not.

@maminrayej maminrayej added the bug Something isn't working label Jun 2, 2024
@maminrayej maminrayej self-assigned this Jun 2, 2024
@syrusakbary syrusakbary added the priority-high High priority issue label Jun 6, 2024
@Userzxcvbvnm
Copy link
Contributor Author

This may be related to #4245

@Userzxcvbvnm
Copy link
Contributor Author

Userzxcvbvnm commented Jul 14, 2024

We checked different OS permission with different openstyle, and found that wasmer is different from other WASM runtimes, including wasmtime, WAMR and WasmEdge.
The behavior of other WASM runtimes is as expected.
There are two kinds of bugs in wasmer:
(FILENAME->0600 means change the permission of a file to 0600, rw-------
DIRNAME->0700 means change the permission of a directory to 0700, rwx------
FILENAME->O_RDONLY means open the file with O_RDONLY
DIRNAME->O_RDONLY | O_DIRECTORY means open the directory with O_RDONLY | O_DIRECTORY)

wasmer version 4.3.1

(1)It should have successfully obtained the file descriptor, but it failed.

DIRNAME->0700
DIRNAME->O_RDONLY | O_DIRECTORY

FILENAME->0600
FILENAME->O_WRONLY

FILENAME->0200
FILENAME->O_WRONLY | O_APPEND

FILENAME->0600
FILENAME->O_WRONLY | O_TRUNC | O_CREAT

FILENAME->0600
FILENAME->O_RDWR | O_CREAT

FILENAME->0600
FILENAME->O_RDWR | O_TRUNC | O_CREAT

FILENAME->0600
FILENAME->O_WRONLY | O_CREAT

DIRNAME->0500
DIRNAME->O_RDONLY | O_DIRECTORY

DIRNAME->0600
DIRNAME->O_RDONLY | O_DIRECTORY

FILENAME->0600
FILENAME->O_WRONLY | O_TRUNC

FILENAME->0600
FILENAME->O_RDWR

FILENAME->0200
FILENAME->O_WRONLY

FILENAME->0200
FILENAME->O_WRONLY | O_TRUNC | O_CREAT

FILENAME->0600
FILENAME->O_WRONLY | O_APPEND

DIRNAME->0400
DIRNAME->O_RDONLY | O_DIRECTORY

FILENAME->0600
FILENAME->O_RDWR | O_APPEND

FILENAME->0200
FILENAME->O_WRONLY | O_CREAT

FILENAME->0600
FILENAME->O_RDONLY

FILENAME->0200
FILENAME->O_WRONLY | O_TRUNC

FILENAME->0600
FILENAME->O_RDWR | O_TRUNC

FILENAME->0400
FILENAME->O_RDONLY

(2)It should not have successfully obtained the file descriptor, but it succeeded.

FILENAME->0400
FILENAME->O_RDWR | O_CREAT

FILENAME->0400
FILENAME->O_WRONLY | O_CREAT

FILENAME->0400
FILENAME->O_RDWR | O_TRUNC | O_CREAT

FILENAME->0200
FILENAME->O_RDWR | O_CREAT

FILENAME->0200
FILENAME->O_RDWR | O_TRUNC | O_CREAT

FILENAME->0400
FILENAME->O_WRONLY | O_TRUNC | O_CREAT

wasmer version 4.2.2

(1)It should have successfully obtained the file descriptor, but it failed.

FILENAME->0400
FILENAME->O_RDONLY

(2)It should not have successfully obtained the file descriptor, but it succeeded.

DIRNAME->0100
DIRNAME->O_RDONLY | O_DIRECTORY

DIRNAME->0300
DIRNAME->O_RDONLY | O_DIRECTORY

DIRNAME->0200
DIRNAME->O_RDONLY | O_DIRECTORY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-high High priority issue
Projects
None yet
Development

No branches or pull requests

3 participants