problem with cgiutils.c on solaris 10?

Brian Peterson brian at kaostech.com
Wed May 10 01:51:00 CEST 2006


I'm having a problem getting the avail.cgi and trend.cgi scripts  
working on Solaris 10.  They both seem to seg fault while processing  
the archive logs in a memcpy function found in cgiutils.c.  Has  
anyone else seen this or know how to get around this problem?  The  
problem seems to exist in 2.0 as well as 2.3.

Here's a quick dbx trace of the seg fault.

#244  dbx avail.cgi
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.5' in  
your .dbxrcReading avail.cgi
Reading ld.so.1
Reading librt.so.1
Reading libc.so.1
Reading libaio.so.1
Reading libmd5.so.1
(dbx) run
Running: avail.cgi
(process id 8256)
Cache-Control: no-store
Pragma: no-cache
Last-Modified: Tue, 09 May 2006 23:39:55 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-type: text/html

<html>
<head>
<title>
Nagios Availability
</title>
<LINK REL='stylesheet' TYPE='text/css' HREF='/nagios/stylesheets/ 
common.css'>
<LINK REL='stylesheet' TYPE='text/css' HREF='/nagios/stylesheets/ 
avail.css'>
</head>
<BODY CLASS='avail'>

<!-- Produced by Nagios (http://www.nagios.org).  Copyright (c)  
1999-2003 Ethan Galstad. -->
<table border=0 width=100% cellspacing=0 cellpadding=0>
<tr>
<td align=left valign=top width=33%>
<TABLE CLASS='infoBox' BORDER=1 CELLSPACING=0 CELLPADDING=0>
<TR><TD CLASS='infoBox'>
<DIV CLASS='infoBoxTitle'>Host Availability Report</DIV>
Last Updated: Tue May 9 16:39:55 PDT 2006<BR>
Nagios® - <A HREF='http://www.nagios.org' TARGET='_new'  
CLASS='homepageURL'>www.nagios.org</A><BR>
Logged in as <i>guest</i><BR>
</TD></TR>
</TABLE>
</td>
<td align=center valign=top width=33%>
<DIV ALIGN=CENTER CLASS='dataTitle'>
All Hosts</DIV>
<BR>
<IMG SRC='/nagios/images/trends.gif' BORDER=0 ALT='Availability  
Report' TITLE='Availability Report'>
<BR CLEAR=ALL>
<div align=center class='reportRange'>05-08-2006 15:41:29 to  
05-09-2006 15:41:29</div>
<div align=center class='reportDuration'>Duration: 1d 0h 0m 0s</div>
</td>
<td align=right valign=bottom width=33%>
<table border=0 CLASS='optBox'>
<form method="GET" action="avail.cgi">
<input type='hidden' name='t1' value='1147128089'>
<input type='hidden' name='t2' value='1147214489'>
<input type='hidden' name='show_log_entries' value=''>
<input type='hidden' name='host' value='all'>
<input type='hidden' name='assumeinitialstates' value='yes'>
<input type='hidden' name='assumestateretention' value='yes'>
<input type='hidden' name='assumestatesduringnotrunning' value='yes'>
<input type='hidden' name='includesoftstates' value='no'>
<tr><td valign=top align=left class='optBoxItem'>First assumed host  
state:</td><td valign=top align=left class='optBoxItem'>First assumed  
service state</td></tr>
<tr>
<td valign=top align=left class='optBoxItem'>
<select name='initialassumedhoststate'>
<option value=0 SELECTED>Unspecified
<option value=-1 >Current State
<option value=3 >Host Up
<option value=4 >Host Down
<option value=5 >Host Unreachable
</select>
</td>
<td CLASS='optBoxItem'>
<select name='initialassumedservicestate'>
<option value=0 SELECTED>Unspecified
<option value=-1 >Current State
<option value=6 >Service Ok
<option value=8 >Service Warning
<option value=7 >Service Unknown
<option value=9 >Service Critical
</select>
</td>
</tr>
<tr><td valign=top align=left class='optBoxItem'>Report period:</ 
td><td valign=top align=left class='optBoxItem'>Backtracked  
archives:</td></tr>
<tr>
<td valign=top align=left class='optBoxItem'>
<select name='timeperiod'>
<option SELECTED>[ Current time range ]
<option value=today >Today
<option value=last24hours >Last 24 Hours
<option value=yesterday >Yesterday
<option value=thisweek >This Week
<option value=last7days >Last 7 Days
<option value=lastweek >Last Week
<option value=thismonth >This Month
<option value=last31days >Last 31 Days
<option value=lastmonth >Last Month
<option value=thisyear >This Year
<option value=lastyear >Last Year
</select>
</td>
<td valign=top align=left CLASS='optBoxItem'>
<input type='text' size='2' maxlength='2' name='backtrack' value='4'>
</td>
</tr>
<tr><td valign=top align=left></td>
<td valign=top align=left CLASS='optBoxItem'>
<input type='submit' value='Update'>
</td>
</tr>
</form>
<tr><td></td><td align=right valign=bottom>
</td></tr>
</table>
</td>
</tr>
</table>
signal SEGV (no mapping at the fault address) in _memcpy at 0xfeed43f2
0xfeed43f2: _memcpy+0x0032:     movb     0x00000002(%esi),%cl
Current function is mmap_fgets
1206           memcpy(buf,(char *)(temp_mmapfile->mmap_buf 
+temp_mmapfile->current_position),len);
(dbx) where
   [1] _memcpy(0x8047780, 0x80661dd, 0x8774cc8, 0xfebd5fbe), at  
0xfeed43f2
=>[2] mmap_fgets(temp_mmapfile = 0x8147380), line 1206 in "cgiutils.c"
   [3] scan_log_file_for_archived_state_data(filename = 0x8047090 "/ 
opt/nagios/var/archives/nagios-05-08-2006-00.log"), line 2911 in  
"avail.c"
   [4] read_archived_state_data(), line 2878 in "avail.c"
   [5] main(argc = 1, argv = 0x80477c4), line 994 in "avail.c"


Brian Peterson
brian at kaostech.com





-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the Developers mailing list