[Nagiosplug-devel] [ nagiosplug-Bugs-1250191 ] ECHILD in waitpid (popen.c:spclose)

SourceForge.net noreply at sourceforge.net
Mon Sep 12 08:46:34 CEST 2005

Bugs item #1250191, was opened at 2005-08-02 13:39
Message generated for change (Settings changed) made by tonvoon
You can respond by visiting: 

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General plugin execution
Group: Release (specify)
>Status: Pending
>Resolution: Fixed
>Priority: 7
Submitted By: Peter Pramberger (peterpramb)
Assigned to: Ton Voon (tonvoon)
Summary: ECHILD in waitpid (popen.c:spclose)

Initial Comment:
After installing Nagios 2.0b3 and plugins 1.4/1.4.1 on
a CentOS 4.1 machine (a RedHat ES 4.1 clone,
kernel-2.6.9, glibc-2.3.4) I found that the check_dns
plugin always aborts with "DNS WARNING - nslookup
returned error status" except in the first run.

However running it in verbose mode always shows a
successful nslookup output. After some debugging I
found that the waitpid call in popen.c:spclose()
returns a ECHILD, which triggers a failure return value
to be passed back to check_dns. 

Cacthing the ECHILD always produces a reasonable
output, so the child with nslookup is really working.

>From the (linux) manpage: ECHILD if the process
specified in pid does not exist or is not a child of
the calling process. (This can happen for one's own
child if the action for SIGCHLD is set to SIG_IGN. See
also the LINUX NOTES section about threads.)

Shouldn't waitpid be successful in reading the exit
status of the child? Maybe a bug in glibc?

Anyone else seen this?


>Comment By: Ton Voon (tonvoon)
Date: 2005-09-12 16:45

Logged In: YES 

Have applied patch to CVS to fix this. Works by using Peter's patch 
surrounded by ifdefs. Configure checks whether this problem exists on 
the redhat system or not.

Will release 1.4.2 after confirmed builds.

Marking this item to pending closure.



Comment By: Ton Voon (tonvoon)
Date: 2005-09-05 17:27

Logged In: YES 

Agreed with Sean to take over this call.

Have created a testcase. Sascha Runschke is raising this to Red Hat.

New patch from Peter Pramberger attached.

Depending on reply from Red Hat, will apply patch next week.



Comment By: M. Sean Finney (seanius)
Date: 2005-09-02 12:03

Logged In: YES 

ECHLD is returned in this context when the child has already
exited, and shouldn't be treated as an error.  i'll commit a
change to cvs shortly.


You can respond by visiting: 

More information about the Devel mailing list