From: Ian Campbell Subject: Re: [PATCH 5/7] libxl: fork: Provide libxl_childproc_sigchld_occurred Date: Fri, 17 Jan 2014 11:29:59 +0000 Message-ID: <1389958199.6697.80.camel@kazak.uk.xensource.com> References: <1389892942-8452-1-git-send-email-ian.jackson@eu.citrix.com> <1389892942-8452-6-git-send-email-ian.jackson@eu.citrix.com> <1389957773.6697.76.camel@kazak.uk.xensource.com> <21209.5013.712955.967233@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21209.5013.712955.967233@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Jim Fehlig , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Fri, 2014-01-17 at 11:27 +0000, Ian Jackson wrote: > Ian Campbell writes ("Re: [PATCH 5/7] libxl: fork: Provide libxl_childproc_sigchld_occurred"): > > On Thu, 2014-01-16 at 17:22 +0000, Ian Jackson wrote: > > > + /* it must have finished but we don't know its status */ > > > + status = 255<<8; /* no wait.h macro for this! */ > > > + assert(WIFEXITED(status)); > > > + assert(WEXITSTATUS(status)==255); > > > + assert(!WIFSIGNALED(status)); > > > + assert(!WIFSTOPPED(status)); > > > > This is quite exciting! How can this happen? Kernel bug or similar? > > In principle it would be possible (and standards-compliant) for a > system to encode its wait status in a different way to usual. I don't > think any such system really exists - at least, not one we'll be > running libxl on. > > Of course this code is only reached if DISASTER returns... Sorry, I meant how can we get here at all, i.e. with a waitpid returning -1/ECHLD when we think there is actually a child. Thinking about it this way I now realise this could be a bug in libxl or the application which caused the process to be reaped elsewhere. Ian.