[lkml]   [1998]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: Possible bug in wait4(), 2.1.126-129 ?
On Sun, 22 Nov 1998, Greaves Tristan TM wrote:

> [cut lots of stuff]
> I missed the original posting here - could someone please tell me what
> the actual symptons are, as I suspect I know what may be causing the
> problem.

Basically, a perl script running another command using the backticks
syntax (`foo`), from cron (this is important for some reason), ends up
receiving ECHILD for the child's exit status.

Simplest test case:

`cmp -s /bin/ls /bin/ls`;
die "$!" if ($? != 0);

If I run this from cron (as root, haven't tried it yet as myself), I get a
mail saying:

No child processes at <script filename> line 3.

In terms of system calls, it goes like this:

[parent pid] read from pipe(...
[child pid] do something
[child pid] exit(0)
[parent pid] read from pipe() resumed
wait4(child pid) = -ECHILD

I can reproduce this at will. Yet, it's a "theoretically impossible"


It is better to keep your mouth shut and be thought a fool,
than to open it and remove all doubt.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:45    [W:0.039 / U:4.252 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site