How to print details of dns_name_t* when hitting a gdb breakpoint in dns_name_equal

Petr Špaček pspacek at isc.org
Tue Dec 3 14:56:22 UTC 2024


On 03. 12. 24 11:36, Kees Bakker via bind-users wrote:
> I have a CentOS FreeIPA setup with with multiple named (bind9 9.16.23) 
> servers.
> On two of my five servers, when I start named it fails a REQUIRE in 
> dns_name_equal
> 
>      /*
>       * Either name1 is absolute and name2 is absolute, or neither is.
>       */
>      REQUIRE((name1->attributes & DNS_NAMEATTR_ABSOLUTE) ==
>          (name2->attributes & DNS_NAMEATTR_ABSOLUTE));
> 
> My question: if I run gdb and break in "assertion_failed", then "go up",
> how can I print name1 and name2 in a meaningful manner,
> so that I can figure out what entries are causing this failure?
> 
> Just doing "p *name1" in gdb isn't very helpful for that.

Many years ago I wrote
https://github.com/pspacek/bind-gdb-pretty-printers
to help with this problem. I have no idea if it still works, but it 
might be worth a try, given the ancient version you are running!

> BTW My work around is to keep restarting named until it no longer fails
> on that REQUIRE.
> 
> Any help is greatly appreciated.

I'm the guy was responsible for (re)designing FreeIPA DNS integration 
with BIND between 2012-2016, so I can only repeat what I said to my 
superiors before I left FreeIPA project & Red Hat:

The whole bind-dyndb-ldap thing needs to be redesigned from ground up 
and properly integrated with BIND (or some other server) via clean APIs 
instead of poking at BIND guts at run-time.

If you or anyone else is interested in making this possible please 
contribute to design discussion in
https://gitlab.isc.org/isc-projects/bind9/-/issues/661
so we can add proper APIs to BIND.

-- 
Petr Špaček
Internet Systems Consortium


More information about the bind-users mailing list