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

Mempool tx.Hash nil pointer dereference in frontend/service.go:480 #402

Closed
skyl opened this issue Jul 11, 2022 · 2 comments · Fixed by #403
Closed

Mempool tx.Hash nil pointer dereference in frontend/service.go:480 #402

skyl opened this issue Jul 11, 2022 · 2 comments · Fixed by #403
Labels
bug Something isn't working

Comments

@skyl
Copy link

skyl commented Jul 11, 2022

lightwalletd crashed a few times. Restarting seems to get it going again and it's running again for now.

This is on mainnet with the debian 5.1.0 release of zcashd and db2795a version of lightwalletd.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0xa1009c]

goroutine 133 [running]:
github.com/zcash/lightwalletd/frontend.(*lwdStreamer).GetMempoolTx(0xc00000f7a0, 0xc000d86500, {0xd513e0, 0xc0002688f0})
	free2z/zcash/lightwalletd/frontend/service.go:480 +0x3fc
github.com/zcash/lightwalletd/walletrpc._CompactTxStreamer_GetMempoolTx_Handler({0xb51a00, 0xc0014f1340}, {0xd4de80, 0xc00000f7a0})
	free2z/zcash/lightwalletd/walletrpc/service_grpc.pb.go:632 +0xd0
github.com/grpc-ecosystem/go-grpc-prometheus.(*ServerMetrics).StreamServerInterceptor.func1({0xb51a00, 0xc0014f1340}, {0xd4dfa0, 0xc00024a5b0}, 0x8, 0xc85fb0)
	go/pkg/mod/github.com/grpc-ecosystem/[email protected]/server_metrics.go:121 +0x109
github.com/grpc-ecosystem/go-grpc-middleware.ChainStreamServer.func1.1.1({0xb51a00, 0xc0014f1340}, {0xd4dfa0, 0xc00024a5b0})
	go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:49 +0x3a
github.com/grpc-ecosystem/go-grpc-middleware.ChainStreamServer.func1({0xb51a00, 0xc0014f1340}, {0xd4dfa0, 0xc00024a5b0}, 0xa5eae0, 0xc0002688e0)
	go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:58 +0xbf
google.golang.org/grpc.(*Server).processStreamingRPC(0xc000238540, {0xd54568, 0xc000285a00}, 0xc000263b00, 0xc0002a3170, 0x11f2c00, 0x0)
	go/pkg/mod/google.golang.org/[email protected]/server.go:1549 +0xe8e
google.golang.org/grpc.(*Server).handleStream(0xc000238540, {0xd54568, 0xc000285a00}, 0xc000263b00, 0x0)
	go/pkg/mod/google.golang.org/[email protected]/server.go:1624 +0x9e5
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	go/pkg/mod/google.golang.org/[email protected]/server.go:922 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	go/pkg/mod/google.golang.org/[email protected]/server.go:920 +0x294

I haven't looked into it yet but it's the tx.Hash in:

	for _, txid := range MempoolFilter(mempoolList, excludeHex) {
		tx := (*mempoolMap)[txid]
		if len(tx.Hash) > 0 {
@skyl skyl added the bug Something isn't working label Jul 11, 2022
@skyl
Copy link
Author

skyl commented Jul 11, 2022

happened again, I think that makes 5 times in about an hour after not happening for 24 hours ... zcashd seems to be running fine .. although some logging I'm not familiar with happened at the same time

2022-07-11T03:30:41.503203Z  INFO main: keypool reserve 1
2022-07-11T03:30:41.503255Z  INFO main: keypool return 1
2022-07-11T03:30:48.750634Z  INFO main: keypool reserve 1
2022-07-11T03:30:48.750699Z  INFO main: keypool return 1

@LarryRuane
Copy link
Collaborator

Thanks for the report! This will be fixed by #403, awaiting review. The failure isn't exactly dereferencing a nil pointer, it's indexing a Go map using a nonexistent key. We should have this fixed within a few days.

While investigating this problem, I discovered that this gRPC, GetMempoolTx, isn't returning any entries at all. This will be fixed by #404.

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

Successfully merging a pull request may close this issue.

2 participants