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

Hello world samples are not working #818

Closed
jgautier opened this issue Sep 19, 2019 · 3 comments · Fixed by #820
Closed

Hello world samples are not working #818

jgautier opened this issue Sep 19, 2019 · 3 comments · Fixed by #820
Labels
bug Something isn't working

Comments

@jgautier
Copy link

Describe the bug

fd_write for stdout does not appear to be working. I tried running the example here (https://wapm.io/package/chai2010/wasi-hello) using wapm and did not see any output. Then I ran the example here https://github.com/CraneStation/wasmtime/blob/master/docs/WASI-tutorial.md#web-assembly-text-example using wasmer and also did not see any output.

wasmer 0.7.0 | rustc 1.34.2 (6c2484dc3 2019-05-13) | x86_64

Steps to reproduce

  1. wapm install chai2010/wasi-hello
  2. wapm run wasi-hello

Expected behavior

see hello world printed to console

Actual behavior

nothing is printed

@jgautier jgautier added the bug Something isn't working label Sep 19, 2019
@MarkMcCaskey
Copy link
Contributor

Thanks for the issue! This is actually a null-pointer deref issue. We don't deref null pointers from Wasm, using any memory address but 0 should work.

I'll look into what the standard says, but checking null has helped us catch bugs in the Wasm earlier in the past

@MarkMcCaskey
Copy link
Contributor

It seems that null deref is fine in general, but not for Emscripten. I'll move the null-checks from runtime-core into emscripten -- thanks!

bors bot added a commit that referenced this issue Sep 20, 2019
820: Remove null pointer checks generally, re-add them in Emscripten r=MarkMcCaskey a=MarkMcCaskey

Resolves #818 

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
@bors bors bot closed this as completed in 977f3a6 Sep 20, 2019
@bors bors bot closed this as completed in #820 Sep 20, 2019
@MarkMcCaskey
Copy link
Contributor

This now works on master, let me know if you have any other issues!

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