[nsd-users] NSD 4 beta 5

Patrik Lundin patrik.lundin.swe at gmail.com
Tue Jul 16 18:00:42 UTC 2013


Hello,

On Mon, Jul 15, 2013 at 03:29:02PM +0200, W.C.A. Wijngaards wrote:
> 
> The new beta for NSD4 is available, NSD 4.0.0b5:
> http://nlnetlabs.nl/downloads/nsd/nsd-4.0.0b5.tar.gz
>

I ran into a segfault on my OpenBSD based box. The problem seems to
arise when running with chroot and not having a logfile set:

# gdb /usr/local/sbin/nsd nsd.core
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-unknown-openbsd5.3"...
Core was generated by `nsd'.
Program terminated with signal 11, Segmentation fault.
Loaded symbols for /usr/local/sbin/nsd
Reading symbols from /usr/lib/libssl.so.19.0...done.
Loaded symbols for /usr/lib/libssl.so.19.0
Reading symbols from /usr/lib/libcrypto.so.22.0...done.
Loaded symbols for /usr/lib/libcrypto.so.22.0
Reading symbols from /usr/lib/libevent.so.3.1...done.
Loaded symbols for /usr/lib/libevent.so.3.1
Reading symbols from /usr/lib/libc.so.66.2...done.
Loaded symbols for /usr/lib/libc.so.66.2
Reading symbols from /usr/libexec/ld.so...done.
Loaded symbols for /usr/libexec/ld.so
#0  0x00000e3f40540a50 in main (argc=Variable "argc" is not available.
) at ./nsd.c:1015
1015                    if (nsd.log_filename[0] == '/')
(gdb) print nsd.log_filename
$1 = 0x0

I worked around this with the following diff:

--- nsd.c.orig	Tue Jul 16 19:46:43 2013
+++ nsd.c	Tue Jul 16 19:47:34 2013
@@ -1012,8 +1012,10 @@
 
 		/* strip chroot from pathnames if they're absolute */
 		nsd.options->zonesdir += l;
-		if (nsd.log_filename[0] == '/')
-			nsd.log_filename += l;
+		if (nsd.log_filename){
+			if (nsd.log_filename[0] == '/')
+				nsd.log_filename += l;
+		}
 		if (nsd.pidfile[0] == '/')
 			nsd.pidfile += l;
 		if (nsd.dbfile[0] == '/')

Regards,
Patrik Lundin



More information about the nsd-users mailing list