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

wasmd internal api error #1497

Closed
oleksandr-code opened this issue Jul 11, 2023 · 6 comments
Closed

wasmd internal api error #1497

oleksandr-code opened this issue Jul 11, 2023 · 6 comments

Comments

@oleksandr-code
Copy link

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x2 addr=0x7f2f1afbb000 pc=0x7f2f916d9cd0]

runtime stack:
runtime.throw({0x1e89c89?, 0x7f2f1ab7b179?})
	/root/.go/src/runtime/panic.go:1047 +0x5d fp=0x7f2f63fbd1a0 sp=0x7f2f63fbd170 pc=0x43e4dd
runtime.sigpanic()
	/root/.go/src/runtime/signal_unix.go:819 +0x369 fp=0x7f2f63fbd1f0 sp=0x7f2f63fbd1a0 pc=0x454fc9

goroutine 2401 [syscall]:
runtime.cgocall(0x1a3eab0, 0xc0300924f8)
	/root/.go/src/runtime/cgocall.go:158 +0x5c fp=0xc030092460 sp=0xc030092428 pc=0x4083dc
github.com/CosmWasm/wasmvm/internal/api._C2func_query(0x7f2f54007b00, {0x0, 0xc030216480, 0x20}, {0x0, 0xc00ad26a80, 0xbb}, {0x0, 0xc030098140, 0x44}, ...)
	_cgo_gotypes.go:589 +0x85 fp=0xc0300924f8 sp=0xc030092460 pc=0x126a285
github.com/CosmWasm/wasmvm/internal/api.Query.func1({0x1ca5ae0?}, {0x60?, 0xc030216480?, 0x2?}, {0x99?, 0xc00ad26a80?, 0x1?}, {0x0, 0xc030098140, 0x44}, ...)
	/root/go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.2.3/internal/api/lib.go:372 +0x21e fp=0xc030092670 sp=0xc0300924f8 pc=0x1273f7e
github.com/CosmWasm/wasmvm/internal/api.Query({0x20?}, {0xc030216480?, 0x14?, 0x18?}, {0xc00ad26a80?, 0xc0300929f0?, 0x411fbf?}, {0xc030098140, 0x44, 0x50}, ...)
	/root/go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.2.3/internal/api/lib.go:372 +0x571 fp=0xc030092910 sp=0xc030092670 pc=0x1273a71
github.com/CosmWasm/wasmvm.(*VM).Query(0xc00558ea10, {0xc030216480, 0x20, 0x20}, {{0x3e0027, 0x1770ac3071b2ed84, {0xc029be0f80, 0x9}}, 0x0, {{0xc03021ad40, ...}}}, ...)
	/root/go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.2.3/lib.go:221 +0x24f fp=0xc030092a38 sp=0xc030092910 pc=0x127ab0f
github.com/CosmWasm/wasmd/x/wasm/keeper.Keeper.QuerySmart({{0x291ed08, 0xc005553390}, {0x294acd8, 0xc0010c91e0}, {0x2933960, 0xc000b42f30}, {0x291b6a0, 0xc00558ea30}, {0x29188e0, 0xc000d68bf8}, ...}, ...)
	/root/go/pkg/mod/github.com/!cosm!wasm/wasmd@v0.31.0/x/wasm/keeper/keeper.go:665 +0x94f fp=0xc030094350 sp=0xc030092a38 pc=0x161e14f
github.com/CosmWasm/wasmd/x/wasm/keeper.(*Keeper).QuerySmart(_, {{0x2934d08, 0xc0000541c8}, {0x29442f0, 0xc03009ad80}, {{0xb, 0x0}, {0xc029be0f80, 0x9}, 0x3e0027, ...}, ...}, ...)
	<autogenerated>:1 +0xea fp=0xc030094818 sp=0xc030094350 pc=0x16436ea
github.com/CosmWasm/wasmd/x/wasm/keeper.grpcQuerier.SmartContractState({{0x294acd8, 0xc0010c91e0}, {0x291ed08, 0xc005553390}, {0x2947920, 0xc000561668}, 0x2dc6c0}, {0x2934d78, 0xc008093170}, 0xc0080931a0)
	/root/go/pkg/mod/github.com/!cosm!wasm/wasmd@v0.31.0/x/wasm/keeper/querier.go:196 +0x416 fp=0xc0300955d8 sp=0xc030094818 pc=0x1635a56
github.com/CosmWasm/wasmd/x/wasm/keeper.(*grpcQuerier).SmartContractState(0x1d564e0?, {0x2934d78?, 0xc008093170?}, 0x40fa0b?)
	<autogenerated>:1 +0xa9 fp=0xc030095670 sp=0xc0300955d8 pc=0x1649709
github.com/CosmWasm/wasmd/x/wasm/types._Query_SmartContractState_Handler({0x1d313e0?, 0xc00012b0c0}, {0x2934d78, 0xc008093170}, 0xc08f726e60, 0x0)
	/root/go/pkg/mod/github.com/!cosm!wasm/wasmd@v0.31.0/x/wasm/types/query.pb.go:1607 +0x170 fp=0xc0300956c8 sp=0xc030095670 pc=0x12bc8b0
github.com/cosmos/cosmos-sdk/baseapp.(*GRPCQueryRouter).RegisterService.func1({{0x2934d08, 0xc0000541c8}, {0x29442f0, 0xc03009ad80}, {{0xb, 0x0}, {0xc029be0f80, 0x9}, 0x3e0027, {0x13a9cd84, ...}, ...}, ...}, ...)
	/root/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.45.16/baseapp/grpcrouter.go:85 +0x230 fp=0xc030095b90 sp=0xc0300956c8 pc=0xeb6950
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).handleQueryGRPC(0xc001084fc0, 0xc005592870, {{0xc001c047e0, 0x86, 0x120}, {0xc00567a1b0, 0x2a}, 0x3e0027, 0x0})
	/root/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.45.16/baseapp/abci.go:601 +0x1cf fp=0xc0300964d0 sp=0xc030095b90 pc=0xeaf32f
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).Query(0xc001084fc0, {{0xc001c047e0, 0x86, 0x120}, {0xc00567a1b0, 0x2a}, 0x3e0027, 0x0})
	/root/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.45.16/baseapp/abci.go:445 +0x6ee fp=0xc030096880 sp=0xc0300964d0 pc=0xeada4e
github.com/tendermint/tendermint/abci/client.(*localClient).QuerySync(0xc015810360, {{0xc001c047e0, 0x86, 0x120}, {0xc00567a1b0, 0x2a}, 0x0, 0x0})
	/root/go/pkg/mod/github.com/cometbft/cometbft@v0.34.28/abci/client/local_client.go:256 +0x171 fp=0xc030096a10 sp=0xc030096880 pc=0x16e94f1
github.com/tendermint/tendermint/proxy.(*appConnQuery).QuerySync(0x2?, {{0xc001c047e0, 0x86, 0x120}, {0xc00567a1b0, 0x2a}, 0x0, 0x0})
	/root/go/pkg/mod/github.com/cometbft/cometbft@v0.34.28/proxy/app_conn.go:159 +0x6e fp=0xc030096a60 sp=0xc030096a10 pc=0x16ed22e
github.com/tendermint/tendermint/rpc/core.ABCIQuery(0x8?, {0xc00567a1b0?, 0xc00ad26540?}, {0xc001c047e0?, 0x4?, 0xc02df57700?}, 0x2?, 0x59?)
	/root/go/pkg/mod/github.com/cometbft/cometbft@v0.34.28/rpc/core/abci.go:20 +0xa6 fp=0xc030096af8 sp=0xc030096a60 pc=0x17e3ec6
runtime.call64(0xc006feb230, 0x26c1f20, 0x0, 0x0, 0x0, 0x40, 0xc030097058)
	/root/.go/src/runtime/asm_amd64.s:726 +0x49 fp=0xc030096b48 sp=0xc030096af8 pc=0x470e89
runtime.reflectcall(0x1b11560?, 0xc02f0d78ad?, 0x8?, 0x1e48c4b?, 0x0?, 0x12?, 0x1b11560?)
	<autogenerated>:1 +0x3c fp=0xc030096b88 sp=0xc030096b48 pc=0x47521c
reflect.Value.call({0x1bf1260?, 0x26c1f20?, 0x80?}, {0x1e33b2d, 0x4}, {0xc04e347e80, 0x5, 0x18?})
	/root/.go/src/reflect/value.go:584 +0x8c5 fp=0xc030097178 sp=0xc030096b88 pc=0x4a6345
reflect.Value.Call({0x1bf1260?, 0x26c1f20?, 0x159?}, {0xc04e347e80?, 0xc08f726d20?, 0x7a45706b6b776267?})
	/root/.go/src/reflect/value.go:368 +0xbc fp=0xc0300971f0 sp=0xc030097178 pc=0x4a583c
github.com/tendermint/tendermint/rpc/jsonrpc/server.makeJSONRPCHandler.func1({0x29324c0, 0xc02f0eaa38}, 0xc02f093b00)
	/root/go/pkg/mod/github.com/cometbft/cometbft@v0.34.28/rpc/jsonrpc/server/http_json_handler.go:108 +0x11f9 fp=0xc030097788 sp=0xc0300971f0 pc=0x164ee79
github.com/tendermint/tendermint/rpc/jsonrpc/server.handleInvalidJSONRPCPaths.func1({0x29324c0?, 0xc02f0eaa38?}, 0xc02f098cf1?)
	/root/go/pkg/mod/github.com/cometbft/cometbft@v0.34.28/rpc/jsonrpc/server/http_json_handler.go:140 +0x5d fp=0xc0300977c0 sp=0xc030097788 pc=0x164f57d
net/http.HandlerFunc.ServeHTTP(0x0?, {0x29324c0?, 0xc02f0eaa38?}, 0x504f68?)
	/root/.go/src/net/http/server.go:2109 +0x2f fp=0xc0300977e8 sp=0xc0300977c0 pc=0x8f13ef
net/http.(*ServeMux).ServeHTTP(0xc000566300?, {0x29324c0, 0xc02f0eaa38}, 0xc02f093b00)
	/root/.go/src/net/http/server.go:2487 +0x149 fp=0xc030097838 sp=0xc0300977e8 pc=0x8f2d89
github.com/rs/cors.(*Cors).Handler.func1({0x29324c0, 0xc02f0eaa38}, 0xc02f093b00)
	/root/go/pkg/mod/github.com/rs/cors@v1.8.2/cors.go:231 +0x1c4 fp=0xc030097890 sp=0xc030097838 pc=0x17902e4
net/http.HandlerFunc.ServeHTTP(0x38a8fa0?, {0x29324c0?, 0xc02f0eaa38?}, 0x4fec6a?)
	/root/.go/src/net/http/server.go:2109 +0x2f fp=0xc0300978b8 sp=0xc030097890 pc=0x8f13ef
github.com/tendermint/tendermint/rpc/jsonrpc/server.maxBytesHandler.ServeHTTP({{0x291d460?, 0xc000052a20?}, 0x412307?}, {0x29324c0?, 0xc02f0eaa38}, 0xc02f093b00)
	/root/go/pkg/mod/github.com/cometbft/cometbft@v0.34.28/rpc/jsonrpc/server/http_server.go:256 +0x124 fp=0xc030097918 sp=0xc0300978b8 pc=0x1652824
github.com/tendermint/tendermint/rpc/jsonrpc/server.(*maxBytesHandler).ServeHTTP(0x1ce2b60?, {0x29324c0?, 0xc02f0eaa38?}, 0xd?)
	<autogenerated>:1 +0x4e fp=0xc030097958 sp=0xc030097918 pc=0x165850e
github.com/tendermint/tendermint/rpc/jsonrpc/server.RecoverAndLogHandler.func1({0x2933570?, 0xc02dce5dc0}, 0xc02f093b00)
	/root/go/pkg/mod/github.com/cometbft/cometbft@v0.34.28/rpc/jsonrpc/server/http_server.go:229 +0x37f fp=0xc030097aa0 sp=0xc030097958 pc=0x16518df
net/http.HandlerFunc.ServeHTTP(0x0?, {0x2933570?, 0xc02dce5dc0?}, 0x8fff74?)
	/root/.go/src/net/http/server.go:2109 +0x2f fp=0xc030097ac8 sp=0xc030097aa0 pc=0x8f13ef
net/http.serverHandler.ServeHTTP({0x2920130?}, {0x2933570, 0xc02dce5dc0}, 0xc02f093b00)
	/root/.go/src/net/http/server.go:2947 +0x30c fp=0xc030097b78 sp=0xc030097ac8 pc=0x8f47ec
net/http.(*conn).serve(0xc004cf3d60, {0x2934d78, 0xc002126300})
	/root/.go/src/net/http/server.go:1991 +0x607 fp=0xc030097fb8 sp=0xc030097b78 pc=0x8efec7
net/http.(*Server).Serve.func3()
	/root/.go/src/net/http/server.go:3102 +0x2e fp=0xc030097fe0 sp=0xc030097fb8 pc=0x8f512e
runtime.goexit()
	/root/.go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc030097fe8 sp=0xc030097fe0 pc=0x472a21
created by net/http.(*Server).Serve
	/root/.go/src/net/http/server.go:3102 +0x4db

I cannot find the solution for this error.
Thanks.

@alpe
Copy link
Member

alpe commented Jul 11, 2023

It is hard to tell without more context. I can see from the stacktrace that you are doing a smart query to a contract. Can you share some more information? Which chain, Contract code and query would be helpful

@oleksandr-code
Copy link
Author

wasm_err1.log

This is full log trace.
The chain is working properly at first. Whenever there is a query for wasmd module, then the chain stops.
Thanks.

@oleksandr-code
Copy link
Author

@alpe is this a wasm cache related issue?

@alpe
Copy link
Member

alpe commented Jul 11, 2023

The stacktrace does not contain any new information. It is hard to tell what causes this.
Please try to clear the cache and/ or use the wasmvm 1.2.4
Can you query the contract info for the contract? I don't know which chain you are using but I have learned that there can be missing code-infos on Terra

@oleksandr-code
Copy link
Author

This issue is solved by removing data/wasm/cache folder.
Thanks

@webmaster128
Copy link
Member

This is most likely the issue you were hitting:
CosmWasm/wasmvm#426

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants