Aha!
I was thinking that the recent patches to CVS might solve this problem,
but I doubt they will. A little detective work revealed that a SIGBUS
interrupt may occur if the underlying file that is mmap()ed is
truncated. Since the status file is updated regularly, its size may be
larger or smaller than it was previously, so this could be causing the
SIGBUS.
Therefore I assume that I should *not* be mmap()ing the following files:
status, comment, and downtime. Instead, I should be using the standard
fgets() calls. Can anyone else chime in and verify my suspicion? It
seems strange that more people have not reported errors, but the
implementation of mmap() across different systems may prevent this error
from occuring for others...
Alessandro Ren wrote:
>
> Ethan,
>
> that's where status.cgi sometimes crash according to GDB.
>
> Program received signal SIGBUS, Bus error.
> mmap_fgets (temp_mmapfile=0x828f050) at cgiutils.c:1194
> 1194 if(*(char *)(temp_mmapfile->mmap_buf+x)=='\n')
>
> []s.
>
> Alessandro Ren wrote:
Ethan Galstad,
Nagios Developer
---
Email: [email protected]
Website: http://www.nagios.org
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]