Hi, I have a very old and trusty bind setup that used to work for some decades now. Lately I noticed that my external bind is constantly crashing. It uses a mysql db to store the dns entries. Beside creating a core dump in /var/bind, nothing is logged. It does not crash for simple queries, but I can reliably trigger it by using https://dnschecker.org/#A/. So next I tried to run the daemon in the foreground with `named -f -c /etc/bind/named.conf`. This at least gave me some cryptic feedback: unknown: debugger aborting because missing DBUG_RETURN or DBUG_VOID_RETURN macro in function "?func". Aborted (core dumped) I was also able to get a useful stack trace with gdb at some point (with FEATURES="nostrip"), which clearly pointed in the direction of mysql dlz. After a lot of unsuccessful tries to find any indication what could be the problem on the net, I finally came across https://serverfault.com/questions/379292/bind9-dlz-mysql-at-ubuntu-segfault-libmysqlclient-so: The problem: (from http://bind-dlz.sourceforge.net/mysql_driver.html) > The MySQL driver has one additional limitation. MySQL uses thread local > storage in its C api. Thus MySQL requires that each thread of an application > execute a MySQL "thread initialization" to setup the thread local storage. > This is impossible to do safely while staying within the DLZ driver API. > This is a limitation caused by MySQL, and not the DLZ API. Because of this > BIND MUST only run with a single thread when using the MySQL driver. To > ensure BIND runs with a single thread pass "-n 1" on the command line when > starting BIND (named). This should not be a limitation on most UN*X systems > as BIND is normally compiled single threaded (there are some exceptions). > Even if BIND is compiled to support threads passing "-n 1" on the command > line will cause it to use a single thread. Also, if the MySQL driver is > compiled into BIND but NOT USED then "-n 1" is not required. The "-n 1" > command line parameters are only required when the MySQL driver is USED. I opened this bug report in order to make this error message better searchable, but also to ask if it would be possible to either directly enable CPU="1" in /etc/conf.d/named if USE="dlz mysql" is detected and/or to at least add another comment to that option mentioning the above limitation. Btw. I recently migrated the server from old hardware to a VM, which has 8 cores instead of 2. This probably explains why I didn't have the issue before. Thank you and have a nice day!
It seems maintainers are aware of this, as per top comment in the build file: https://github.com/gentoo/gentoo/blob/master/net-dns/bind/bind-9.15.6.ebuild. IMO a warning during pkg_postinst would also work!
*** This bug has been marked as a duplicate of bug 641694 ***