I am running Nagios 2 beta - CVS snapshot Feb 24 19:47 2005 on Solaris 8.
I have a problem where my host detail and status map options in the left
frame will die with a segmentation fault after displaying some of my
hosts. The number of hosts depends on the sort options.
Note that the "service detail" option will display *all* hosts and *all*
I am guessing I am hitting some sort of problem, where the code expects
to see something in memory, but it is not there. I think it may be in my
hosts definition, but I have 25 hosts defined so not sure if I have a
typo in any of the definitions.
Each entry basically looks like:
alias db server
Some hosts (not all) have partially filled out hostextinfo entries:
notes IMAP/POP3 Server
icon_image_alt Sun E450 Server
I can run the status CGI from the command line:
$ /usr/local/bin/gdb ./status.cgi
Starting program: /usr/local/nagios/src/nagios-cvs/cgi/status.cgi
Last-Modified: Thu, 03 Mar 2005 09:31:51 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Current Network Status
<TD CLASS='statusEven' nowrap>17d 1h 35m 54s</TD>
Program received signal SIGSEGV, Segmentation fault.
0xff2b3218 in strlen () from /lib/libc.so.1
#0 0xff2b3218 in strlen () from /lib/libc.so.1
#1 0xff306530 in _doprnt () from /lib/libc.so.1
#2 0xff3081d0 in printf () from /lib/libc.so.1
#3 0x0001a35c in show_host_detail () at status.c:2089
I am now at my limit in C and gdb, so was wondering if anyone had any
pointers as to how I debug the code to find out what the problem is? ie
how can I see the contents of the memory, and what the variables are set at?