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

nil pointer in block watcher syncToLatestBlock #1803

Closed
yondonfu opened this issue Mar 18, 2021 · 1 comment · Fixed by #1809
Closed

nil pointer in block watcher syncToLatestBlock #1803

yondonfu opened this issue Mar 18, 2021 · 1 comment · Fixed by #1809
Assignees
Labels
tech debt type: bug Something isn't working

Comments

@yondonfu
Copy link
Member

Observed this error with an O connected to Rinkeby. There is probably a missing nil check somewhere in the block watcher code:

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

goroutine 47 [running]:
github.com/livepeer/go-livepeer/eth/blockwatch.(*Watcher).syncToLatestBlock(0xc000390360, 0x0, 0x0)
        /build/eth/blockwatch/block_watcher.go:162 +0xe9
github.com/livepeer/go-livepeer/eth/blockwatch.(*Watcher).Watch(0xc000390360, 0x1fec980, 0xc0009e2600, 0x1fcf4c0, 0xc000428300)
        /build/eth/blockwatch/block_watcher.go:123 +0x165
main.main.func6(0xc000390360, 0x1fec980, 0xc0009e2600, 0xc0009dcba0)
        /build/cmd/livepeer/livepeer.go:711 +0x45
created by main.main
        /build/cmd/livepeer/livepeer.go:710 +0x411f
@yondonfu yondonfu added the type: bug Something isn't working label Mar 18, 2021
@kyriediculous
Copy link
Contributor

kyriediculous commented Mar 23, 2021

Right... Good find ! If there are no blocks on the stack nil can be returned without returning an error due to the following code block in FindLatestMiniHeader

	if latestMiniHeader == nil {
		return nil, nil
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech debt type: bug Something isn't working
Projects
None yet
2 participants