[Nagiosplug-devel] [ nagiosplug-Bugs-1107524 ] check_ping, segfault, popen problems

SourceForge.net noreply at sourceforge.net
Sun May 1 13:17:08 CEST 2005


Bugs item #1107524, was opened at 2005-01-22 17:39
Message generated for change (Comment added) made by seanius
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1107524&group_id=29880

Category: Parsing problem
Group: CVS
>Status: Pending
Resolution: None
Priority: 7
Submitted By: gprosser (gprosser)
Assigned to: M. Sean Finney (seanius)
Summary: check_ping, segfault, popen problems

Initial Comment:
check_ping.c, including the current version in CVS,
installs a signal handler for SIGALRM called
popen_timeout_alarm_handler on startup, and sets an
alarm to interrupt it later so the plugin doesn't run
forever.

However, the popen handler is set to kill the processes
that was opened when an ALRM hits, and in certain
circumstances (DNS timeouts) the plugin is still
resolving the hostname of the target and has not yet
opened a command.

This leads to SIGSEGV when popen_timeout_(etc) tries to
dereference a null pointer looking for what process to
kill.

I would suggest a safer benign signal handler to handle
DNS timeouts be installed in the first case, and then
changed just before the process is actually popened to
the current handler.

Thanks.

-gnp

----------------------------------------------------------------------

>Comment By: M. Sean Finney (seanius)
Date: 2005-05-01 16:16

Message:
Logged In: YES 
user_id=226838

i've committed something i believe will solve this problem.
 can you test that it no longer segfaults?

----------------------------------------------------------------------

Comment By: M. Sean Finney (seanius)
Date: 2005-05-01 16:08

Message:
Logged In: YES 
user_id=226838

i think a fix for this wouldn't be too hard.  the culprit
seems to be in popen.c:247:

                kill (childpid[fileno (child_process)],
SIGKILL);

some simple error checking should do the trick.  i'm also
going to go ahead and initialize the file pointers in
popen.h =NULL, as it shouldn't do any harm and may catch
something else bad before it happens.

----------------------------------------------------------------------

Comment By: Daniel Graupner (dael)
Date: 2005-03-09 13:33

Message:
Logged In: YES 
user_id=577827

I have a similar problem, maybe it is related to this one. 
I have a lot of lines like
pid xxxxx (check_ping), uid 1002: exited on signal 11
in my /var/log/messages.

My notes on that:
We have Laserlink between our gateway and the "world",
everytime it is raining or snowing the connection is really
slow or temporarily crashes. We have some pings that "go"
over this line.

The time of the crashes seems to be at the same time the
laserlink is down.




----------------------------------------------------------------------

Comment By: Ton Voon (tonvoon)
Date: 2005-02-03 19:05

Message:
Logged In: YES 
user_id=664364

Raising priority on this one. Cannot reproduce myself. Any test cases 
available?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1107524&group_id=29880




More information about the Devel mailing list