Page 1 of 1

[Nagios-devel] SIGSEGV in check.c on Solaris when plugin output is

Posted: Wed Sep 24, 2008 1:10 pm
by Guest
Dies ist eine mehrteilige Nachricht im MIME-Format.
--=_alternative 004DD2F3C12574CE_=
Content-Type: text/plain; charset="utf-8"
content-transfer-encoding: quoted-printable

Hi list,

nagios dumps core with SIGSEV on Solaris 10 when a plugin does not print=20
any output.
Using gdb I found it happening in line 803 of base/checks.c, where=20
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=20
the fprintf in line 803 ... maybe there is a more elegant solution.
=20
On linux, glibc seems to handel this problem in printf("output=3D%s", NULL)=
=20
by returning the string "(null)".


Regards,
Torsten
=3D=3D=3D


_________________________________________________________________

Sachsen DV Betriebs- und Servicegesellschaft mbH
T=C3=A4ubchenweg 26
04317 Leipzig
Amtsgericht Leipzig, HRB 18545

Gesch=C3=A4ftsf=C3=BChrer: Herbert Roller Brand=C3=A3o, Dr. Jean-Michael Pf=
itzner

Aufsichtsratsvorsitzender: Andreas Benninger
--=_alternative 004DD2F3C12574CE_=
Content-Type: text/html; charset="utf-8"
content-transfer-encoding: quoted-printable


Hi list,

nagios dumps core with SIGSEV on Sol=
aris
10 when a plugin does not print any output.
Using gdb I found it happening in li=
ne
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 inser=
ting
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=3D%s", NULL) by returning the string
"(null)".


Regards,
Torsten
=3D=3D=3D


_________________________________________________________________

Sachsen DV Betriebs- und Servicegesellschaft mbH
T=C3=A4ubchenweg 26
04317 Leipzig
Amtsgericht Leipzig, HRB 18545

Gesch=C3=A4ftsf=C3=BChrer: Herbert Roller Brand=C3=A3o, Dr. Jean-Micha=
el Pfitzner

Aufsichtsratsvorsitzender: Andreas Benninger
--=_alternative 004DD2F3C12574CE_=--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]