Re: OpenDNSSEC signer engine: Bus error: How to get debug information?

2020-09-23 Thread Why 42? The lists account.


Hi All,

By the way, I just wanted to say how great this is.
I have problem, I ask for help, I get (good) help. With relative easy I
can build the necessary debugging tool and use it to find out that the OS
has helped to identify a problem in the application.

Pretty nice and not necessarily my everyday experience in IT.

Thanks again.

Cheers,
Robb.



Re: OpenDNSSEC signer engine: Bus error: How to get debug information?

2020-09-22 Thread Theo de Raadt
> > #1  0x084fca6e4e55 in ixfr_del_rr (ixfr=0x852782d0d80, 
> > rr=0xdfdfdfdfdfdfdfdf) at signer/ixfr.c:134
> this is a use after free 
> 

damn right



Re: OpenDNSSEC signer engine: Bus error: How to get debug information?

2020-09-22 Thread Florian Obser
On Tue, Sep 22, 2020 at 04:08:16PM +0200, Why 42? The lists account. wrote:
> 
> On Tue, Sep 22, 2020 at 07:12:47AM -, Stuart Henderson wrote:
> > 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").
> 
> Hi Stuart,
> 
> Thanks for that, concise and really helpful. The debug build process was
> easier than I expected :).
> 
> For what is worth the results in egdb are:
> Thread 2 received signal SIGBUS, Bus error.
> [Switching to thread 478985]
> 0x0851fb90f5f5 in ldns_rr_clone () from /usr/local/lib/libldns.so.7.1
> (gdb) bt
> #0  0x0851fb90f5f5 in ldns_rr_clone () from /usr/local/lib/libldns.so.7.1
> #1  0x084fca6e4e55 in ixfr_del_rr (ixfr=0x852782d0d80, 
> rr=0xdfdfdfdfdfdfdfdf) at signer/ixfr.c:134
 this is a use after free 


> #2  0x084fca6ea0da in rrset_sign (ctx=0x8522842d800, rrset= out>, signtime=1600781131) at signer/rrset.c:758
> #3  0x084fca6ddd6c in drudge (worker=0x8521a9e4000) at 
> daemon/signertasks.c:196
> #4  0x084fca714e0b in runthread (data=0x851d1fc6300) at janitor.c:318
> #5  0x0852553ad0d1 in _rthread_start (v=) at 
> /usr/src/lib/librthread/rthread.c:96
> #6  0x0851f742dc38 in __tfork_thread () at 
> /usr/src/lib/libc/arch/amd64/sys/tfork_thread.S:77
> #7  0x in ?? ()
> (gdb) info args
> No symbol table info available.
> (gdb) info local
> No symbol table info available.
> (gdb) up
> #1  0x084fca6e4e55 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 = 
> 
> I'm not a gdb expert, but I wonder why it says "No symbol table info
> available" ...
> 
> In any case, I've forwarded the info. on to the opendnssec developer
> list.
> 
> Thanks again.
> 
> Cheers,
> Robb.
> 

-- 
I'm not entirely sure you are real.



Re: OpenDNSSEC signer engine: Bus error: How to get debug information?

2020-09-22 Thread Why 42? The lists account.


On Tue, Sep 22, 2020 at 07:12:47AM -, Stuart Henderson wrote:
> 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").

Hi Stuart,

Thanks for that, concise and really helpful. The debug build process was
easier than I expected :).

For what is worth the results in egdb are:
Thread 2 received signal SIGBUS, Bus error.
[Switching to thread 478985]
0x0851fb90f5f5 in ldns_rr_clone () from /usr/local/lib/libldns.so.7.1
(gdb) bt
#0  0x0851fb90f5f5 in ldns_rr_clone () from /usr/local/lib/libldns.so.7.1
#1  0x084fca6e4e55 in ixfr_del_rr (ixfr=0x852782d0d80, 
rr=0xdfdfdfdfdfdfdfdf) at signer/ixfr.c:134
#2  0x084fca6ea0da in rrset_sign (ctx=0x8522842d800, rrset=, 
signtime=1600781131) at signer/rrset.c:758
#3  0x084fca6ddd6c in drudge (worker=0x8521a9e4000) at 
daemon/signertasks.c:196
#4  0x084fca714e0b in runthread (data=0x851d1fc6300) at janitor.c:318
#5  0x0852553ad0d1 in _rthread_start (v=) at 
/usr/src/lib/librthread/rthread.c:96
#6  0x0851f742dc38 in __tfork_thread () at 
/usr/src/lib/libc/arch/amd64/sys/tfork_thread.S:77
#7  0x in ?? ()
(gdb) info args
No symbol table info available.
(gdb) info local
No symbol table info available.
(gdb) up
#1  0x084fca6e4e55 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 = 

I'm not a gdb expert, but I wonder why it says "No symbol table info
available" ...

In any case, I've forwarded the info. on to the opendnssec developer
list.

Thanks again.

Cheers,
Robb.



Re: OpenDNSSEC signer engine: Bus error: How to get debug information?

2020-09-22 Thread Stuart Henderson
On 2020-09-21, Why 42? The lists account.  wrote:
>
> Hi All,
>
> I am attempting to setup secure DNS on an OpenBSD 6.7 system using NSD,
> Unbound and a package called Opendnssec.
>
> I seem to have arrived at a point where one of the Opendnssec daemons,
> "ods-signerd", crashes on startup i.e.
>> # ods-signerd -dv
>> OpenDNSSEC signer engine version 2.1.6
>> Bus error in ldns_rr_clone
>> Threaddump
>> Threaddump
>> Threaddump
>> Threaddump
>> Threaddump
>> Threaddump
>> Threaddump
>> Threaddump
>> Threaddump
>> Threaddump
>> Bus error
>
> I'm not sure exactly what Threaddump means but, as far as I can tell, no
> core file is dumped/written.

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").




OpenDNSSEC signer engine: Bus error: How to get debug information?

2020-09-21 Thread Why 42? The lists account.


Hi All,

I am attempting to setup secure DNS on an OpenBSD 6.7 system using NSD,
Unbound and a package called Opendnssec.

I seem to have arrived at a point where one of the Opendnssec daemons,
"ods-signerd", crashes on startup i.e.
> # ods-signerd -dv
> OpenDNSSEC signer engine version 2.1.6
> Bus error in ldns_rr_clone
> Threaddump
> Threaddump
> Threaddump
> Threaddump
> Threaddump
> Threaddump
> Threaddump
> Threaddump
> Threaddump
> Threaddump
> Bus error

I'm not sure exactly what Threaddump means but, as far as I can tell, no
core file is dumped/written.

Is there something I can/should do in order to enable a core dump, or to
gather some more debug info. that I can pass on to the Opendnssec
developers?

Alternatively, if anyone has any ideas about what could be causing the
problem, or how to avoid it, that would be even better :-).

The other daemon started by Opendnssec seems to be running "as expected"
e.g.
> # ps aux | grep ods
> _opendns 67028  0.0  1.1 24140 33728 ??  I7Sep209:02.01 
> /usr/local/sbin/ods-enforcerd

Thanks in advance!

Cheers,
Robb.