Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pexpect read() leaves zombies on EOF #20178

Closed
jdemeyer opened this issue Mar 8, 2016 · 3 comments
Closed

pexpect read() leaves zombies on EOF #20178

jdemeyer opened this issue Mar 8, 2016 · 3 comments

Comments

@jdemeyer
Copy link

jdemeyer commented Mar 8, 2016

If read_nonblocking() detects an EOF condition, it should call isalive() to reap the child process.

Upstream: Not yet reported upstream; Will do shortly.

CC: @dimpase @yuan-zhou @mkoeppe @jpflori

Component: packages: standard

Issue created by migration from https://trac.sagemath.org/ticket/20178

@jdemeyer jdemeyer added this to the sage-7.1 milestone Mar 8, 2016
@dimpase
Copy link
Member

dimpase commented Mar 25, 2016

comment:3

any progress on this?

@dimpase dimpase modified the milestones: sage-7.1, sage-7.2 Mar 25, 2016
@jpflori
Copy link

jpflori commented Dec 15, 2016

comment:4

Don't we also have an issue with sage-cleaner?

@embray embray removed this from the sage-7.2 milestone Aug 14, 2019
@embray
Copy link
Contributor

embray commented Aug 14, 2019

comment:6

From my experience on #18267 apparently now it does, as I'm getting tracebacks ending with:

      File "/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/pexpect/spawnbase.py", line 369, in expect_list
        return exp.expect_loop(timeout)
      File "/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/pexpect/expect.py", line 111, in expect_loop
        incoming = spawn.read_nonblocking(spawn.maxread, timeout)
      File "/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/pexpect/pty_spawn.py", line 469, in read_nonblocking
        self.isalive()
      File "/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/pexpect/pty_spawn.py", line 704, in isalive
        alive = ptyproc.isalive()
      File "/home/embray/src/sagemath/sage/local/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/pexpect/pty_spawn.py", line 25, in _wrap_ptyprocess_err
        raise ExceptionPexpect(*e.args)
    ExceptionPexpect: isalive() encountered condition where "terminated" is 0, but there was no child process. Did someone else call waitpid() on our process?

Unfortunately, sometimes sage-cleaner reaps the zombie process during isalive() resulting in this exception, which we don't handle in some cases, but that's a separate issue IIUC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants