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

LES panic due to nil balance tracker #20008

Closed
holiman opened this issue Aug 26, 2019 · 1 comment · Fixed by #20010
Closed

LES panic due to nil balance tracker #20008

holiman opened this issue Aug 26, 2019 · 1 comment · Fixed by #20010
Assignees

Comments

@holiman
Copy link
Contributor

holiman commented Aug 26, 2019

Happens on latest master, v1.9.2 is not affected.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xc7c3b6]
goroutine 8918 [running]:
github.com/ethereum/go-ethereum/les.(*balanceTracker).requestCost(0x0, 0x91fa8)
      /go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/les/balance.go:258 +0x26
  github.com/ethereum/go-ethereum/les.(*serverHandler).handleMsg.func2(0xf4711b098e35afa1, 0xc0, 0xc098b47540, 0x5f42c0)
      /go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/les/server_handler.go:246 +0x246
  github.com/ethereum/go-ethereum/les.(*serverHandler).handleMsg.func3(0xc04ada5240, 0xc077a50148, 0xc0b5ad84e0, 0xc048569220, 0xc045965680, 0xc0b383ed80)
      /go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/les/server_handler.go:362 +0xc96
  created by github.com/ethereum/go-ethereum/les.(*serverHandler).handleMsg
      /go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/les/server_handler.go:276 +0xd9c
@holiman holiman changed the title LES panic dueto balance tracker LES panic due to nil balance tracker Aug 26, 2019
@rjl493456442
Copy link
Member

After some investigation, I think there exist at least two issues:

  • If a new inbound peer is not accepted by client pool(client pool is full), we should disconnect this peer instead of assigning a "fake" balance tracker which used for testing.
  • Whenever server handler receives a msg from client peer, it will put the processing procedure in a routine. But if the peer is evicted, we should check all in-flight routines before removing it(for example, assign the balanceTracker to nil).

Working on the fix now.

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

Successfully merging a pull request may close this issue.

3 participants