Subject: bin/11128: bind coredumps in 1.5_ALPHA
To: None <>
From: Ian Dall <>
List: netbsd-bugs
Date: 10/04/2000 07:47:18
>Number:         11128
>Category:       bin
>Synopsis:       The name daemon (bind) dumps core
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 04 07:47:00 PDT 2000
>Originator:     Ian Dall
>Release:        Sep 30, 2000
System: NetBSD 1.5_ALPHA NetBSD 1.5_ALPHA (SIBYL) #0: Sun Aug 13 15:28:38 CST 2000 pc532

Running named on the pc532 platform core dumps almost immediately.
Start named.
The problem seems to be due to writing beyond the end of the _res variable.
This happens in res_init.c:184, but is due to a problem in irs_data.c.

Bind uses its own version of resolv.h. The bind resolv.h defines
a bind___res_state structure and a bind__res instance of that structure.
__res_state and _res are cpp defines for convenience.

In irs_data.c there following appears:

 #undef _res 
 extern struct __res_state _res;

However, this undoes exactly the clash which was prevented by defining
_res to be bind__res. There may be other libc modules which have _res

So, there is an external variable defined with different sizes in different
modules. I am not sure exactly what the linker does with this, but it doesn't
allocate enough space.

Removing the "#undef _res" fixes the problem (which begs the question of
why it was there in the first place). The extern statement is redundant
because it appears in resolv.h.