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

Opening /dev/null leads to panic: not yet implemented #1565

Closed
mejedi opened this issue Aug 26, 2020 · 0 comments · Fixed by #1566
Closed

Opening /dev/null leads to panic: not yet implemented #1565

mejedi opened this issue Aug 26, 2020 · 0 comments · Fixed by #1566
Assignees
Labels
bug Something isn't working

Comments

@mejedi
Copy link

mejedi commented Aug 26, 2020

Describe the bug

If a program attempts to open /dev/null or any other device file, Wasmer panics with the error saying "not yet implemented".

$ echo "`wasmer -V` | `rustc -V` | `uname -m`"
zsh: command not found: rustc
wasmer 0.17.1 |  | x86_64

Steps to reproduce

  1. Put the following code in opendevnull.c:
#include <stdio.h>
int main() {
  fputs("open: /dev/null\n", stderr);
  if (fopen("/dev/null", "r")==NULL) perror("open");
  return 0;
}
  1. Compile using wasienv:
$ wasicc opendevnull.c -o opendevnull.wasm
  1. Run
$ wasmer run --dir=/ opendevnull.wasm
open: /dev/null
thread 'main' panicked at 'not yet implemented: state::get_inode_at_path unknown file type: not file, directory, or symlink', lib/wasi/src/state/mod.rs:818:33
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
Error: error: User(Any)

Expected behavior

Opening /dev/null should've succeeded.

Actual behavior

Wasmer panics with the error saying "not yet implemented.

Additional context

I want to use the existing test suite to ensure that the program ported to Wasmer works as expected. I'd like to have as few modifications to the test suite as possible.

The test suite depends heavily on /dev/null. I could make it work for the output going to /dev/null easily with --mapdir feature (so that it actually goes to a file named "null" in a temporary dir). Unfortunately, /dev/null is also often used for input and I don't have a workaround.

@mejedi mejedi added the bug Something isn't working label Aug 26, 2020
@MarkMcCaskey MarkMcCaskey self-assigned this Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants