[Nagios-devel] [Nagios-users] external commands and segfault -- again

Andreas Ericsson ae at op5.se
Mon Jan 8 15:48:50 UTC 2007


David G Schlecht wrote:
> Helmut W. Januschka <h.januschka <at> krone.at> writes:
> 
>> You may move the strlen() to a sperate variable
>> And after that reproduce the gbd session and use "info locales" to see 
>> What are the actual values of the variables and maybe just the strlen fails
>>
>> Also try "print name1" and "print name1[i]" and look if there are some
> unterminated strings 
>> And backtrace to  where the call to the hashfunc2 occurs and have a look at
> the value wich originally gots
>> sended in
>>
>> Maybe its just a old version or a bad implemantion of the tool submitting the
> external command (sure nagios
>> should do a segfault at all ;)) 
>>
> 
> 
> Thanks for your reply, Helmut. From the segfault, it appears that
> both name1 and name2 are corrupt as both are outside the program's
> address space. Since name1 is received as a const, it's unlikely
> that this routine (hashfunc2) is causing the problem. The calling
> routine (find_service) doesn't change the contents of the variable
> so it's not likely the problem. Tracing all the way back,
> event_execution_loop seems the most likely cause of the segfault.
> However this is not a trivial routine and I'm not able to debug it.
> Is there anyone familiar enough with the code available to take a look?
> 
> This problem doesn't occur with each external command, but only
> once every 200-300 times.
> 
> Any help would be most appreciated.
> 

I think you'd have better luck posting this to the nagios-devel list, so 
I'm cross-posting it there now. Provided you're subscribed there, we 
should be able to drop this from the nagios-users list where it really 
doesn't belong.

Anyways...

What command is being sent into the command-pipe when nagios crashes?
Have you made any modifications to the code?
Does this happen with latest CVS code (without any local modifications)?

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231




More information about the Nagios-devel mailing list