NLnetLabs / nsd

The NLnet Labs Name Server Daemon (NSD) is an authoritative, RFC compliant DNS nameserver.

Home Page:https://nlnetlabs.nl/nsd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NSD: handle_tcp_reading: Assertion `buffer_remaining(data->query->packet) > 0' failed.

pettai opened this issue · comments

Hi,

After building a resent git version of NSD with feature branch merged (#281 and adding some query load on it, I've started to see these messages now and then in the logs:

Sep 21 11:08:59 snusmumrik nsd[282331]: nsd: server.c:4186: handle_tcp_reading: Assertion `buffer_remaining(data->query->packet) > 0' failed.
Sep 21 11:08:59 snusmumrik nsd[244653]: server 282331 died unexpectedly, restarting
Sep 21 11:08:59 snusmumrik nsd[244653]: process 282331 terminated with status 134

I'm just guessing here, it's could be then this happens below (since these messages disappeared too):

Sep 21 16:45:07 snusmumrik nsd[1023183]: failed reading from 164.90.202.89 tcp: Connection reset by peer

The feature branch works fine alone (we've used it from the start) but since it's basically done and will be merged soon, I thought it would be good to bring light on this now so it can be fixed before the merge.

Thanks for the test report! The issue was caused by a second query on the TCP channel, or TLS channel. The query data structure was not reset properly, and this caused the assertion failure. The commit dfcdadb fixes the issue.

That closes the issue, the fix is part of #281.

Yes! The assertion hasn't showed up in the logs since I pushed your fix into the server.
Many thanks for quick handling of this issue!