Skip to content

inconsistent stack pattern: pt = false, lpt = false, ls = 2, sd = 0 #104

Open
@mfateev

Description

I'm trying to execute the simple Go program compiled to wasm:

maxpro:gowasm maxim$ cat wasm.go
package main

func main() {
}
maxpro:gowasm maxim$ GOOS=js GOARCH=wasm go build -o main.wasm
maxpro:gowasm maxim$ wasm-validate ./main.wasm
maxpro:gowasm maxim$

When trying to execute it using life/main.go I'm getting the following panic:

panic: Error: inconsistent stack pattern: pt = false, lpt = false, ls = 2, sd = 0
---GO TRACEBACK---
goroutine 1 [running]:
runtime/debug.Stack(0x4195060, 0xc000b13a30, 0x4240480)
        /usr/local/go/src/runtime/debug/stack.go:24 +0x9d
github.com/perlin-network/life/utils.CatchPanic(0xc000195a40)
        /Users/maxim/temporal/life/utils/catch.go:11 +0x72
panic(0x4195060, 0xc000b13a30)
        /usr/local/go/src/runtime/panic.go:679 +0x1b2
github.com/perlin-network/life/compiler.(*SSAFunctionCompiler).Compile(0xc000195988, 0xc00000ad00, 0x13, 0x20)
        /Users/maxim/temporal/life/compiler/ssa.go:339 +0xcb95
github.com/perlin-network/life/compiler.(*Module).CompileForInterpreter(0xc00000e040, 0x0, 0x0, 0xc00016a000, 0x6c5, 0x6cc, 0x0, 0x0)
        /Users/maxim/temporal/life/compiler/module.go:264 +0xa5f
github.com/perlin-network/life/exec.NewVirtualMachine(0xc000162000, 0x228953, 0x228b53, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x10000, ...)
        /Users/maxim/temporal/life/exec/vm.go:437 +0xd0
main.main()
        /Users/maxim/temporal/life/main.go:82 +0x300


goroutine 1 [running]:
main.main()
        /Users/maxim/temporal/life/main.go:89 +0xbe1

Process finished with exit code 2

I do understand that really executing Go program would require polyfilling functions that Go needs, but at least it would be nice to be able to compile and run it until it fails with the first such function.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions