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

No error print? #386

Open
orangeC23 opened this issue Apr 11, 2023 · 0 comments
Open

No error print? #386

orangeC23 opened this issue Apr 11, 2023 · 0 comments
Labels
❓ question Further information is requested

Comments

@orangeC23
Copy link

orangeC23 commented Apr 11, 2023

Summary

Related to https://github.com/wasmerio/wasmer-python/issues/713
The go file is:

package main

import (
	"fmt"
	"github.com/wasmerio/wasmer-go/wasmer"
	"io/ioutil"
)

func main() {
    wasmBytes, _ := ioutil.ReadFile("./tmp.wasm")

    engine := wasmer.NewEngine()
    store := wasmer.NewStore(engine)

    // Compiles the module
    module, err := wasmer.NewModule(store, wasmBytes)

    if err != nil {
        fmt.Println("Failed to compile module:", err)
    }

    importObject := wasmer.NewImportObject()
    instance, err := wasmer.NewInstance(module, importObject)

    if err != nil {
        panic(fmt.Sprintln("Failed to instantiate the module:", err))
    }
    start, err := instance.Exports.GetWasiStartFunction()

	start()

}

Additional details

wasmer go also print nothing, did not report the error as wasmer does.
wasmer go print:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4099a19]

goroutine 1 [running]:
main.main()
tmp.go:31 +0x119
exit status 2

@orangeC23 orangeC23 added the ❓ question Further information is requested label Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant