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

Comments

@jgautier
Copy link

commented Sep 19, 2019

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 label Sep 19, 2019
@MarkMcCaskey

This comment has been minimized.

Copy link
Contributor

commented Sep 20, 2019

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

This comment has been minimized.

Copy link
Contributor

commented Sep 20, 2019

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
Merge #820
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 in 977f3a6 Sep 20, 2019
@bors bors bot closed this in #820 Sep 20, 2019
@MarkMcCaskey

This comment has been minimized.

Copy link
Contributor

commented Sep 20, 2019

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
Projects
None yet
2 participants
You can’t perform that action at this time.