Re: processes stuck in skb_recv_datagram

Zack Weinberg (zack@bitmover.com)
Sat, 24 Jul 1999 18:02:34 -0700


> > Rob Riggs wrote:
> > > Multiple threads calling gethostbyname_r() (and using DNS
> > > to resolve) ends up with threads stuck in skb_recv_datagram.
> >
> > [snip]
> >
> > All the userspace code appears correct;
>
> Yuck! I take it back!
>
> The res_send.c code in glibc2.1.1 (and all prior versions, inc 2.0.x)
> resolv library looks fundamentally broken for any threaded environments.
> There are gaping, wide-open race conditions.

libresolv in glibc (both 2.0 and 2.1) is BIND 4.9.something more or
less verbatim. I'm not at all surprised to hear that it's not thread
safe.

BINDv8 *appears* to have been made thread safe - this is me doing a
cursory inspection, not a formal check. I was planning to update
libc's code, but it doesn't look like I'm going to have time anytime
soon. If you are interested in doing it, I'd be happy to lend a hand
and see it gets into the official release.

zw

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/