Regression in libbind's resolver initialization

Adam Tkac atkac at
Thu Jun 28 17:45:48 UTC 2007

Hi all,

looks that

2119.   [compat]        libbind: allow res_init() to succeed enough to
                        return the default domain even if it was unable
                        to allocate memory.

change brings regression and libbind resolver is now completely 
unusable. I tried this code:

#include <bind/netdb.h>
#include <bind/resolv.h>

int main() {
  (void) gethostbyname("asdf");
  return 0;

and compile it against libbind's resolver. Program gets sigsegv due 
unbounded recursion. __res_vinit() function needs initialised h_errno 
and h_errno needs initialised resolver (looks like problem for me) so 
calls like init-h_errno -> init-resolver -> init-h_errno .. never ends. 
When I take back change 2119 all works as expected. I think if we need 
this "feature" we could use local variable instead h_errno.

Regards, Adam

More information about the bind-workers mailing list