-
Notifications
You must be signed in to change notification settings - Fork 895
-
Notifications
You must be signed in to change notification settings - Fork 895
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
Panic if channel in other function #3364
Comments
My guess is that by overriding the |
I have tried another function name but it still cannot work. |
Which tinygo version are you using? |
I use v0.26.0. I'll improve the demo |
wasmtime runtime code:
Cargo.toml
wasm:
output:
|
The problem with calling arbitrary functions without going through main is that the runtime is not properly initialized. In this case, the channel logic requires that the scheduler has been initialized, but by calling |
So what can I do to avoid this problem? |
@aykevl I wonder if we can export a user-callable runtime init function somehow or otherwise check that the required setup has happened? |
Closing as dupe of #2735 |
I write the code below. And use
tinygo build -o wasm.wasm -target wasi .
to compileAnd I use wasmtime to call start function. It will panic
If these code in main function, it won't panic.
The text was updated successfully, but these errors were encountered: