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

loop call wasmer instance export func will occur panic #391

Open
tianyu0901 opened this issue Apr 17, 2023 · 0 comments
Open

loop call wasmer instance export func will occur panic #391

tianyu0901 opened this issue Apr 17, 2023 · 0 comments
Labels
🐞 bug Something isn't working

Comments

@tianyu0901
Copy link

Work env

  1. OS: Ubuntu 22.04.1 LTS \n \l
  2. go version: go version go1.17.6 linux/amd64

I also use the newer version golang, but the same panic will occur.

Code

    //******
sum, err := instance.Exports.GetFunction("sum")
if err != nil {
	panic(fmt.Sprintln("Failed to get the `add_one` function:", err))
}

for i := 0; i < 10000*10; i++ {
	_, err = sum(1, 2)
	if err != nil {
		panic(fmt.Sprintln("Failed to call the `add_one` function:", err))
	}
}

Panic msg

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x7f2c5d9393df pc=0x7f2c5d9393df]

runtime stack:
runtime.throw({0x4b5e07, 0x0})
/home/m/soft/go1.7.6/src/runtime/panic.go:1198 +0x71
runtime.sigpanic()
/home/m/soft/go1.7.6/src/runtime/signal_unix.go:719 +0x396

goroutine 1 [syscall]:
runtime.cgocall(0x4926c0, 0xc000048bd8)
/home/m/soft/go1.7.6/src/runtime/cgocall.go:156 +0x5c fp=0xc000048bb0 sp=0xc000048b78 pc=0x40a31c
github.com/wasmerio/wasmer-go/wasmer._Cfunc_wasm_func_call(0x21382c0, 0xc000012190, 0xc000012180)
_cgo_gotypes.go:1239 +0x4d fp=0xc000048bd8 sp=0xc000048bb0 pc=0x489e2d
github.com/wasmerio/wasmer-go/wasmer.(*Function).Native.func1.5(0xc000012190, 0x2, 0xc00001a260)
/home/m/code/golang/pkg/mod/github.com/wasmerio/wasmer-go@v1.0.4/wasmer/function.go:317 +0xa7 fp=0xc000048c20 sp=0xc000048bd8 pc=0x48d567
github.com/wasmerio/wasmer-go/wasmer.(*Function).Native.func1({0xc00002a180, 0x2, 0xc000082340})
/home/m/code/golang/pkg/mod/github.com/wasmerio/wasmer-go@v1.0.4/wasmer/function.go:317 +0x40a fp=0xc000048dd0 sp=0xc000048c20 pc=0x48cf8a
main.main()
/home/m/code/gomod/wasmer-test/main.go:42 +0x222 fp=0xc000048f80 sp=0xc000048dd0 pc=0x491e62
runtime.main()
/home/m/soft/go1.7.6/src/runtime/proc.go:255 +0x227 fp=0xc000048fe0 sp=0xc000048f80 pc=0x43ac27
runtime.goexit()
/home/m/soft/go1.7.6/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc000048fe8 sp=0xc000048fe0 pc=0x463dc1

@tianyu0901 tianyu0901 added the 🐞 bug Something isn't working label Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant