[syslog-ng]Re: syslog-ng and Solaris 8

Balazs Scheidler bazsi@balabit.hu
Tue, 12 Nov 2002 08:43:06 +0100


On Mon, Nov 11, 2002 at 12:45:18PM -0800, Rude Yak wrote:
>   Hello, Baszi.  I'm having some stability issues on Solaris 8 and I'm not
> quite sure how to best go about resolving them.  Occasionally, I will notice
> syslog-ng crashing, most often after receiving a UDP-based message.  Running in
> debug mode, I see the following:
> 
> bash-2.05a# /apps/syslog-ng/current/sbin/syslog-ng -vdF -f
> /apps/syslog-ng/etc/syslog-ng.conf
> binding fd 3, inetaddr: 0.0.0.0, port: 514
> io.c: Preparing fd 3 for reading
> io.c: connecting using fd 7
> connecting fd 7 to inetaddr 10.130.230.162, port 514
> io.c: connecting using fd 8
> connecting fd 8 to inetaddr 10.120.230.161, port 514
> syslog-ng version 1.5.17 starting
> io.c: Preparing fd 8 for writing
> io.c: Preparing fd 7 for writing
> io.c: Preparing fd 9 for writing
> io.c: sockaddr2info(): Unsupported address family 0.
> Abort (core dumped)
> 
> I'm building syslog-ng with gcc 3.1 on Solaris 8 with the following setup:
> 
> syslog-ng 1.5.23
> libol 0.3.5
> CFLAGS -m64 -O3
> 
> 
> I'm attaching the core dump just in case.  In this particular case, syslog-ng
> crashes as soon as spamd (from the spamassassin package) connects.  The lines
> in spamd are something like:
> 
> if ($log_facility ne 'stderr') {
>   eval {
>     setlogsock('unix');
>     syslog('debug', 'spamd starting');  # required to actually open the socket
>   };
> 
> Is there something in my syslog-ng configuration that may be causing issues?

no, as it seems solaris doesn't return a sensible address for unix domain
socket peers. btw: solaris does not usually use unix domain sockets for log
transport, what driver do you use for /dev/log? (usually it is a STREAMS device)

this patch should fix it (touch io.c.x after applying):

diff -u -r1.31 io.c
--- io.c	14 Oct 2002 08:05:38 -0000	1.31
+++ io.c	12 Nov 2002 07:40:01 -0000
@@ -1024,13 +1024,17 @@
 		struct sockaddr_un *un = (struct sockaddr_un *) addr;
 		return &make_unix_address(c_format("%z", un->sun_path))->super;
 	}
+	case AF_UNSPEC:
+		break;
 #if 0
 	case AF_INETv6:
 		break;
 #endif
 	default:
-		fatal("io.c: sockaddr2info(): Unsupported address family %i.\n", addr->sa_family);
+		werror("io.c: sockaddr2info(): Unsupported address family %i (addrlen=%i).\n", addr->sa_family, addr_len);
+		break;
 	}
+	return NULL;
 }
 
 #if 0


-- 
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1