octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #37591] system with async option results in zo


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #37591] system with async option results in zombie processes
Date: Fri, 22 Sep 2017 02:53:27 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #8, bug #37591 (project octave):

Yes, there is nothing you can do in the child to influence this behavior, it
has to be done by Octave.

If you are calling system directly, you can reap these defunct processes with


>> pid = system ("ls", [] "async")
pid =  16256
>> system ps;
  PID TTY          TIME CMD
16235 pts/0    00:00:00 octave-cli-4.3.
16256 pts/0    00:00:00 sh <defunct>
16259 pts/0    00:00:00 sh
16260 pts/0    00:00:00 ps
29689 pts/0    00:00:00 bash
>> waitpid (pid);
>> system ps;
  PID TTY          TIME CMD
16235 pts/0    00:00:01 octave-cli-4.3.
16307 pts/0    00:00:00 sh
16308 pts/0    00:00:00 ps
29689 pts/0    00:00:00 bash


I think this leads to the decision point of this problem, should system(...,
"async") automatically reap all child processes automatically behind the
scenes? Or should it be the responsibility of the caller, at the interpreter
level, to call waitpid(pid) for every invocation of system(..., "async")?

It can't be done both ways. If Octave is in charge of reaping these defunct
processes, then the caller will never have access to the exit status, etc,
they will be truly async with no information available about whether they ever
ran or are still running.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?37591>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]