Unbound segfaults

Unbound has started to segfault on one of my servers. It's set up as
an iterator - cache and forwarder.

This is the error
Apr 1 16:33:07 kernel: [13600580.130222] unbound[27581]: segfault at
c ip 0806e0af sp bf86dc70 error 4 in unbound[8048000+a3000]
Apr 3 12:49:29 kernel: [13759961.676284] unbound[6045]: segfault at c
ip 0806e0af sp bffdbe60 error 4 in unbound[8048000+a3000]
Apr 3 12:56:01 kernel: [13760354.457757] unbound[5095]: segfault at c
ip 0806e0af sp bfaed910 error 4 in unbound[8048000+a3000]

I have probably brought this on myself as I've been running the SVN
version (for many months) and regularly upgrading. However, I've never
had this issue before.

Everything has been fine until the svn upgrade on 3-24, the crash
didn't happen until 4-1. On 4-1 I installed the latest svn and it
crashed today, and immediately again upon a restart; although after
another restart it is up and running (for now).

If it helps the previous svn upgrade, the one before the 3-24 one that
crashed was on 2-18.

Thank you,

Chris

Hi Chris,

Thanks for the heads up. This does not affect the 1.4.20 release, as
this code is newer.

I suspect two changes of causing it (I am supposedly on holiday, so
I'll make it short). The first is a binary API version change in
libunbound; this should likely not affect you, but if your install is
not 'clean', it could be that you now have two libunbound.so.x
versions, and if you compile with --export-all-symbols then this could
cause segfaults in the unbound daemon if it picks the wrong library
out of your libdir.

The other is a codechange, to do with private-address functionality;
are you using private-address? This is the only real codechange in
this timeframe, and touches on a lot of pointers... I thought it was
fine, but then you always do until you find the bug :slight_smile:

That would be this patch that then causes the issue:
svn diff http://unbound.net/svn/trunk/iterator -r2867:2868 > file
this code does fire even if you do not have private-addresses
configured, but it does not seem to fail in unit tests.
patch -r reverses the patch if you want to try that.

Best regards,
   Wouter

I suspect two changes of causing it (I am supposedly on holiday, so
I'll make it short). The first is a binary API version change in
libunbound; this should likely not affect you, but if your install is
not 'clean', it could be that you now have two libunbound.so.x
versions, and if you compile with --export-all-symbols then this could
cause segfaults in the unbound daemon if it picks the wrong library
out of your libdir.

Only one version - libunbound.so.2.2.1

The other is a codechange, to do with private-address functionality;
are you using private-address? This is the only real codechange in
this timeframe, and touches on a lot of pointers... I thought it was
fine, but then you always do until you find the bug :slight_smile:

Yes, using private-addresses!

That would be this patch that then causes the issue:
svn diff http://unbound.net/svn/trunk/iterator -r2867:2868 > file
this code does fire even if you do not have private-addresses
configured, but it does not seem to fail in unit tests.
patch -r reverses the patch if you want to try that.

I'll give this a try.

Thanks,

Chris

Hi Chris,

The bug has been fixed in svn trunk. Thanks for the report!

No official releases suffer from this issue, the segfault was caused
by an error in a bugfix that has not been released yet.

Best regards,
   Wouter

Great! I'll give a try. No crashes after reverting to rev 2867.

Chris