Skip to content
Cosmopediaby Unity Nodes
DiscussionsCosmos-SDKWhat could cause sync.Mutex.Lock() to have a nil pointer dereference?Forum ↗

What could cause sync.Mutex.Lock() to have a nil pointer dereference?

Cosmos-SDK2 posts2,184 viewsLast activity Dec 2020
RA
randomshinichiOP
Dec 2020

I’m getting this error under very specific circumstances: I have deployed a VM via docker-machine. I want to run a docker container with the stock starport project, it’s called launchpayloadcli/launchpayloadd inside it. If I run `docker-machine ssh machinename docker run --volume=/home/docker/nodeconfig:/payload/config -p 1317:1317 apeunit/launchpayload /payload/runlightclient.sh 192.168.99.100 drop-28b10d4eff415a7b0b2c`, or put the command in a .sh file in the VM, this error DOES NOT appear when I access a particular API endpoint (`GET IP:1317/txs/TXHASH`) If I write a Golang program to run this exact same command, including the docker-machine ssh part, it will give this error when I access that particular API endpoint: ``` E[2020-12-11|05:33:04.222] Panic in RPC HTTP handler module=rest-server err="runtime error: invalid memory address or nil pointer dereference" stack="goroutine 27 [running]: runtime/debug.Stack(0xfe61a0, 0xfd93e0, 0x1ab62a0) /usr/lib/go/src/runtime/debug/stack.go:24 +0x9f github.com/tendermint/tendermint/rpc/jsonrpc/server.RecoverAndLogHandler.func1.2(0xc0012b5200, 0x1438060, 0xc001284260, 0xbfecdf040d1b3443, 0x481d37f73, 0x1ad6b40,…

Excerpt (1198 of 4787 characters). Read the whole post on the forum ↗

SA
santegoeds
Dec 2020

It appears to me that DynamicVerifier is nil. So the dereference occurs on access to dv.mtx and is not from sync.Mutex.Lock().

← Back to Discussions