OSProcess -OS-X and a unix issue...

John M McIntosh johnmci at smalltalkconsulting.com
Thu Mar 7 08:14:54 UTC 2002


>John M McIntosh <johnmci at smalltalkconsulting.com> wrote:
>	So how do you tell if the process id is valid...
>
>I've never seen kill() used before a waitpid() like that.
>
>...



>
>I don't see the point in checking the validity of cid when waitpid()
>is going to check it anyway.

Well we are working on why the kill() is there.

Actually it's there because the Smalltalk code is checking to see if 
the pid is valid. It also does this because if you save an image and 
restart then we need to confirm if the pids we think we have in the 
squeak code actually exist or not.

Right now the SIGCHLD signals a semaphore which kicks off a process 
to invoke the waitpid, however as part of this a check is done to see 
if the pid is valid, that thunders into this issue.

  David Lewis was kind enough to build a small C program that mimics 
the problem and produces the following:  It would seem that no-one 
has ever run this stuff on an BSD system before.

David states on Linux, the output looks like this:

      parent process sending signal to running child
      kill to running child gives 0
      hello world from the child process
      goodbye cruel world from the child process
      parent process sending signal to zombie child
      kill to zombie child gives 0
      parent process reaping zombie child
      child exit status was 700
      parent process sending signal to completed child
      kill to completed child gives -1 with errno 3

    On BSDI, the output looks like this:

      parent process sending signal to running child
      hello world from the child process
      kill to running child gives 0
      goodbye cruel world from the child process
      parent process sending signal to zombie child
      kill to zombie child gives -1 with errno 3
      parent process reaping zombie child
      child exit status was 700
      parent process sending signal to completed child
      kill to completed child gives -1 with errno 3

To that I can add

ON OS-X 10.1.3
[otter:/] johnmci% uname -a
Darwin otter 5.3 Darwin Kernel Version 5.3: Thu Jan 24 22:06:02 PST 
2002; root:xnu/xnu-201.19.obj~1/RELEASE_PPC  Power Macintosh powerpc

parent process sending signal to running child
kill to running child gives 0
hello world from the child process
goodbye cruel world from the child process
parent process sending signal to zombie child
kill to zombie child gives -1 with errno 3
parent process reaping zombie child
child exit status was 700
parent process sending signal to completed child
kill to completed child gives -1 with errno 3

%uname -a
FreeBSD seamonster.smalltalkconsulting 4.3-RELEASE FreeBSD 
4.3-RELEASE #1: Mon May  7 18:26:49 PDT 2001 
root at seamonster.smalltalkconsulting:/usr/src/sys/compile/SEAMONSTER 
i386

parent process sending signal to running child
hello world from the child process
kill to running child gives 0
goodbye cruel world from the child process
parent process sending signal to zombie child
kill to zombie child gives -1 with errno 3
parent process reaping zombie child
child exit status was 700
parent process sending signal to completed child
kill to completed child gives -1 with errno 3

loon:johnmci {118} uname -a
OpenBSD loon 2.9 LOON#2 mac68k
parent process sending signal to running child
hello world from the child process
kill to running child gives 0
goodbye cruel world from the child process
parent process sending signal to zombie child
kill to zombie child gives -1 with errno 3
parent process reaping zombie child
child exit status was 700
parent process sending signal to completed child
kill to completed child gives -1 with errno 3
-- 
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================



More information about the Squeak-dev mailing list