tests/fuzzers: fix goroutine leak in les fuzzer #22455
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
WARN [03-08|10:35:15.880] GetBlockHeaders skip overflow attack id=0000000000000000 conn= current=0 skip=18446744073709551615 next=0 attacker="[123 10 32 32 34 101 110 111 100 101 34 58 32 34 101 110 111 100 101 58 47 47 110 117 108 108 46 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 34 44 10 32 32 34 105 100 34 58 32 34 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 34 44 10 32 32 34 110 97 109 101 34 58 32 34 34 44 10 32 32 34 99 97 112 115 34 58 32 110 117 108 108 44 10 32 32 34 110 101 116 119 111 114 107 34 58 32 123 10 32 32 32 32 34 108 111 99 97 108 65 100 100 114 101 115 115 34 58 32 34 112 105 112 101 34 44 10 32 32 32 32 34 114 101 109 111 116 101 65 100 100 114 101 115 115 34 58 32 34 112 105 112 101 34 44 10 32 32 32 32 34 105 110 98 111 117 110 100 34 58 32 102 97 108 115 101 44 10 32 32 32 32 34 116 114 117 115 116 101 100 34 58 32 102 97 108 115 101 44 10 32 32 32 32 34 115 116 97 116 105 99 34 58 32 102 97 108 115 101 10 32 32 125 44 10 32 32 34 112 114 111 116 111 99 111 108 115 34 58 32 123 125 10 125]"
vs
WARN [03-08|10:35:59.406] GetBlockHeaders skip overflow attack id=0000000000000000 conn= current=0 skip=18446744073709551615 next=0 attacker="{\n \"enode\": \"enode://null.0000000000000000000000000000000000000000000000000000000000000000\",\n \"id\": \"0000000000000000000000000000000000000000000000000000000000000000\",\n \"name\": \"\",\n \"caps\": null,\n \"network\": {\n \"localAddress\": \"pipe\",\n \"remoteAddress\": \"pipe\",\n \"inbound\": false,\n \"trusted\": false,\n \"static\": false\n },\n \"protocols\": {}\n}"