tests/fuzzers: fix goroutine leak in les fuzzer (#22455)
The oss-fuzz fuzzer has been reporting some failing testcases for les. They're all spurious, and cannot reliably be reproduced. However, running them showed that there was a goroutine leak: the tests created a lot of new clients, which started an exec queue that was never torn down. This PR fixes the goroutine leak, and also a log message which was erroneously formatted.
This commit is contained in:
committed by
GitHub
parent
faacc8e0fa
commit
bc47993692
@ -261,18 +261,18 @@ func (d dummyMsg) Decode(val interface{}) error {
|
||||
}
|
||||
|
||||
func (f *fuzzer) doFuzz(msgCode uint64, packet interface{}) {
|
||||
version := f.randomInt(3) + 2 // [LES2, LES3, LES4]
|
||||
peer := l.NewFuzzerPeer(version)
|
||||
enc, err := rlp.EncodeToBytes(packet)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
version := f.randomInt(3) + 2 // [LES2, LES3, LES4]
|
||||
peer, closeFn := l.NewFuzzerPeer(version)
|
||||
defer closeFn()
|
||||
fn, _, _, err := l.Les3[msgCode].Handle(dummyMsg{enc})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fn(f, peer, func() bool { return true })
|
||||
|
||||
}
|
||||
|
||||
func Fuzz(input []byte) int {
|
||||
|
Reference in New Issue
Block a user