Comments (4)
A runtime is needed to run WebAssembly modules compiled from Go. What runtime are you using? Are you sure that the panic originates from the default branch but not somewhere else? And what message did you get exactly when the program panics?
from life.
I Wrote a simple version wasm go runtime.
https://gist.github.com/icexin/3123b51d2ae97c21aade3ea2975ecea2
The output is
Resolve func: go debug
Resolve func: go runtime.wasmExit
Resolve func: go runtime.wasmWrite
Resolve func: go runtime.nanotime
Resolve func: go runtime.walltime
Resolve func: go runtime.scheduleCallback
Resolve func: go runtime.clearScheduledCallback
Resolve func: go runtime.getRandomData
panic: f64
goroutine 1 [running]:
main.main()
/Users/icexin/test/wasm/switch.go:11 +0x16
return value = 0, duration = 20.195955ms
from life.
@losfair Any progress?
from life.
I've run into this same issue. Can reproduce. Although for me it seems to be related to how many switch cases are available. This runs the default branch:
net := "tcp"
switch net {
case "tcp", "tcp4", "tcp6", "udp", "udp4", "udp6":
fmt.Println("Should match")
case "ip", "ip4", "ip6":
fmt.Println("shouldn't match")
default:
log.Fatal("broken")
}
Altering this line to just three options runs successfully.
case "tcp", "tcp4", "tcp6":
from life.
Related Issues (20)
- too many arguments in call to disasm.Disassemble HOT 3
- SSA advantages HOT 1
- How AddGas injected? HOT 1
- I use emcc compile a simple cpp to wasm. but can't works in `life` HOT 1
- Can it load multiple wasm file?
- why retrun value 0 when enable polymerase?
- Add golangci linter
- WASI support
- No exported functions HOT 1
- Floating point operation is very inaccurate
- cannot return error while panic
- There is a problem in the judgment of was unreachable
- Snapshotting
- Compile once, execute many times
- inconsistent stack pattern: pt = false, lpt = false, ls = 2, sd = 0 HOT 2
- Comparison to V8
- Gas on StartSection
- User-friendly Fix: Need to panic that DefaultMemoryPages config option should be 1 or more HOT 2
- Is it possible to run go generated WASMs in the VM? HOT 1
- Call wasm function with string parameter?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from life.