Skip to content

wasm error running example #7

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

Closed
goliatone opened this issue Nov 12, 2022 · 12 comments · Fixed by #9
Closed

wasm error running example #7

goliatone opened this issue Nov 12, 2022 · 12 comments · Fixed by #9

Comments

@goliatone
Copy link

Running the host-functions example I get the following error:

2022/11/12 14:42:05 Sending a HTTP request...
2022/11/12 14:42:05 wasm error: unreachable
wasm stack trace:
	.runtime.runtimePanic(i32,i32)
	.runtime.lookupPanic()
	.malloc(i32) i32 (recovered by wazero)
wasm stack trace:
	env.log(i32,i32) i64
	.greeter_greet(i32,i32) i64
  • go version go1.18.7 darwin/arm64
  • macOS 12.6.1
  • Chip M1 Max
@knqyf263
Copy link
Owner

Which version did you try?

@knqyf263
Copy link
Owner

@codefromthecrypt Is it relevant to the recent update of wazero?

@mathetake
Copy link
Contributor

it seems something to do with the memory management change in TinyGo, but haven't looked into yet

@mathetake
Copy link
Contributor

maybe adds the test dimension with TinyGo versions since i see go-plugin is only tested with TinyGo 0.24 which is two versions behind the latest

@knqyf263
Copy link
Owner

@mathetake Thanks for your insight.
@goliatone Which version of TinyGo are you using?

@goliatone
Copy link
Author

@knqyf263 tinygo version 0.26.0 darwin/amd64 (using go version go1.18.7 and LLVM version 14.0.0)

@mathetake
Copy link
Contributor

mathetake commented Nov 20, 2022

I imagine this commit is the root cause tinygo-org/tinygo@03d1c44. since that commit (included in 0.26), passing size=0 to the malloc results in panic.

@mathetake
Copy link
Contributor

cc @anuraaga

This was referenced Nov 20, 2022
@mathetake
Copy link
Contributor

#9 fixes!

@knqyf263
Copy link
Owner

@goliatone Do you mind trying the latest commit?

@codefromthecrypt
Copy link
Collaborator

I verified tinygo 0.26 works via #10 also

@anuraaga
Copy link

Thanks for the pointer, sent tinygo-org/tinygo#3303 to fix in TinyGo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants