atom feed1 message in net.sourceforge.lists.nagios-develRe: [Nagios-devel] SIGSEGV in check.c...
FromSent OnAttachments
Ethan GalstadOct 15, 2008 8:33 am 
Subject:Re: [Nagios-devel] SIGSEGV in check.c on Solaris when plugin output is empty
From:Ethan Galstad (nag@nagios.org)
Date:Oct 15, 2008 8:33:04 am
List:net.sourceforge.lists.nagios-devel

thue@sachsendv.de wrote:

Hi list,

nagios dumps core with SIGSEV on Solaris 10 when a plugin does not print any output. Using gdb I found it happening in line 803 of base/checks.c, where checkresult_dbuf.buf is 0x0 on empty plugin output.

Versions: - nagios-3.0.3 and nagios-cvs (as of 24. Sept 2008) - Solaris 10 x86 - both Sun Studio 11 and gcc

I tried a fix just in place by inserting a NULL pointer check just before the fprintf in line 803 ... maybe there is a more elegant solution.

On linux, glibc seems to handel this problem in printf("output=%s", NULL) by returning the string "(null)".

Regards, Torsten ===

Thanks! Patch will be in CVS shortly.