[Opendnssec-user] OpenDNSSEC signer engine: Crashes on OpenBSD with: Bus error in ldns_rr_clone

Robb rlp at tson.de
Tue Sep 22 13:58:31 UTC 2020

On 22 Sep, (Berry) A.W. van Halderen wrote:
> ...
> I've see the issue and know of one other person having it.  It is really
> (Open)BSD related, and I've not seen it elsewhere, even not on our other
> FreeBSD machines (production and testing).  It seems content related,
> perhaps you can share this.  Nearly all of the cases you can clear the
> problem away by removing the files in /usr/local/var/lib/opendnssec/tmp
> and /usr/local/var/lib/opendnssec/signer, which are all transient state
> files, this should be done after stopping OpenDNSSEC and restarting
> it afterwards.

Hi Berry(?),

Thanks for the prompt response!

FYI: I also received some feedback from the OpenBSD misc list as follows:
>> Sounds like they are trapping sigbus themselves but the handler isn't
>> giving useful information.
>> Try just running it under gdb
>> pkg_add gdb
>> egdb ods-signerd
>> set args -dv
>> run
>> and see if you can get a backtrace. You may need to build opendnssec
>> with debug symbols to get a usable trace though (checkout the ports tree
>> and build it with "make DEBUG=-g repackage reinstall").

So I have built and installed a debug version as suggested. It gives me the
following information when run in egdb, maybe it is useful to you:
# egdb /usr/local/sbin/ods-signerd
(gdb) set args -dv
(gdb) run
Starting program: /usr/local/sbin/ods-signerd -dv
OpenDNSSEC signer engine version 2.1.6
[New thread 478985]
[New thread 113589]
[New thread 209604]
[New thread 609992]
[New thread 114470]
[New thread 107172]
[New thread 359177]
[New thread 512579]
[New thread 229322]
[New thread 305401]
[New thread 585910]

Thread 2 received signal SIGBUS, Bus error.
[Switching to thread 478985]
0x00000851fb90f5f5 in ldns_rr_clone () from /usr/local/lib/libldns.so.7.1
(gdb) bt
#0  0x00000851fb90f5f5 in ldns_rr_clone () from /usr/local/lib/libldns.so.7.1
#1  0x0000084fca6e4e55 in ixfr_del_rr (ixfr=0x852782d0d80, rr=0xdfdfdfdfdfdfdfdf) at signer/ixfr.c:134
#2  0x0000084fca6ea0da in rrset_sign (ctx=0x8522842d800, rrset=<optimized out>, signtime=1600781131) at signer/rrset.c:758
#3  0x0000084fca6ddd6c in drudge (worker=0x8521a9e4000) at daemon/signertasks.c:196
#4  0x0000084fca714e0b in runthread (data=0x851d1fc6300) at janitor.c:318
#5  0x00000852553ad0d1 in _rthread_start (v=<optimized out>) at /usr/src/lib/librthread/rthread.c:96
#6  0x00000851f742dc38 in __tfork_thread () at /usr/src/lib/libc/arch/amd64/sys/tfork_thread.S:77
#7  0x0000000000000000 in ?? ()

(gdb) info args
No symbol table info available.
(gdb) info local
No symbol table info available.

(gdb) up
#1  0x0000084fca6e4e55 in ixfr_del_rr (ixfr=0x852782d0d80, rr=0xdfdfdfdfdfdfdfdf) at signer/ixfr.c:134
134	    ldns_rr* rr_copy = ldns_rr_clone(rr);
(gdb) info args
ixfr = 0x852782d0d80
rr = 0xdfdfdfdfdfdfdfdf

(gdb) info local
rr_copy = <optimized out>
(gdb) list
129	 *
130	 */
131	void
132	ixfr_del_rr(ixfr_type* ixfr, ldns_rr* rr)
133	{
134	    ldns_rr* rr_copy = ldns_rr_clone(rr);
136	    ods_log_assert(ixfr)
137	    ods_log_assert(rr);
138	    ods_log_assert(ixfr->part[0]);

(gdb) down
#0  0x00000851fb90f5f5 in ldns_rr_clone () from /usr/local/lib/libldns.so.7.1
(gdb) list
139	    ods_log_assert(ixfr->part[0]->min);
141	    if (!ldns_rr_list_push_rr(ixfr->part[0]->min, rr_copy)) {
142	        ldns_rr_free(rr_copy);
143	        ods_fatal_exit("[%s] fatal unable to -RR: ldns_rr_list_push_rr() failed",
144	            ixfr_str);
145	    }
146	    if (ldns_rr_get_type(rr_copy) == LDNS_RR_TYPE_SOA) {
147	        ixfr->part[0]->soamin = rr_copy;
148	    }

(gdb) quit
A debugging session is active.
	Inferior 1 [process 72706] will be killed.
Quit anyway? (y or n) y

# ls -l /usr/local/sbin/ods-signerd
-rwxr-xr-x  1 root  bin  1457688 Sep 22 14:13 /usr/local/sbin/ods-signerd

# ldd /usr/local/sbin/ods-signerd
	Start            End              Type  Open Ref GrpRef Name
	00000ccf21763000 00000ccf217ce000 exe   2    0   0      /usr/local/sbin/ods-signerd
	00000cd150eb2000 00000cd150f1f000 rlib  0    1   0      /usr/local/lib/libldns.so.7.1
	00000cd12fcf0000 00000cd12ff25000 rlib  0    2   0      /usr/lib/libcrypto.so.46.1
	00000cd1a3a25000 00000cd1a3bdd000 rlib  0    1   0      /usr/local/lib/libxml2.so.16.1
	00000cd2113fa000 00000cd211407000 rlib  0    3   0      /usr/lib/libpthread.so.26.1
	00000cd146000000 00000cd14601b000 rlib  0    2   0      /usr/lib/libz.so.5.0
	00000cd12da15000 00000cd12da43000 rlib  0    2   0      /usr/local/lib/liblzma.so.2.1
	00000cd1cf810000 00000cd1cf912000 rlib  0    2   0      /usr/local/lib/libiconv.so.7.0
	00000cd1e7b2f000 00000cd1e7b5e000 rlib  0    2   0      /usr/lib/libm.so.10.1
	00000cd1d88ca000 00000cd1d89bd000 rlib  0    1   0      /usr/lib/libc.so.96.0
	00000cd16afc9000 00000cd16afc9000 ld.so 0    1   0      /usr/libexec/ld.so

I hope that there is something useful there, I am not a gdb expert. In any
case I will re-initialise the opendnssec configuration as you suggest and
try again.

> If you are able to share your zone file that causes this problem,
> including the state in the above mentioned directories, perhaps I can then
> more targetfully approach the issue.
Will also check if I can do that, there could easily be some error there too


More information about the Opendnssec-user mailing list