INSIST in lwdclient.c

Kory Keith korykeith.tx at gmail.com
Wed Aug 5 21:01:34 UTC 2015


I have an application that is using BIND lightweight resolver ~9.4 -
although I've checked the 9.10.2 code and it looks the same.

I'm seeing an INSIST check failing in lwdclient.c:
INSIST((cm->flags & NS_LWDCLIENTMGR_FLAGRECVPENDING) != 0);

I have multi-threading enabled - I have 3 worker threads running in the
resolver.

My question about lwdclient.c is how can the resolver support multiple
threads with no locking mechanism on the ns_lwdclientmgr_t?

Through debugging I'm seeing one thread creating the event and another
thread waking up to process that event before the first thread has set this
flag, and thus the INSIST check fails.

I understand that the timing has to be incredibly precise for this case to
happen, but with multiple threads acting on the same client manager, isn't
it just a matter of time until things go bad?

Am I missing some key piece of code that should prevent this?

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/bind-users/attachments/20150805/8e8332c2/attachment-0001.html>


More information about the bind-users mailing list