external commands and segfault -- again

David G Schlecht dschlecht at doit.nv.gov
Mon Jan 8 16:38:57 CET 2007


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.

-Dave



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list