[Top][All Lists]

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

bug#6074: accept-process-output on listening sockets cause non-interrupt

From: Pip Cet
Subject: bug#6074: accept-process-output on listening sockets cause non-interruptible infloop
Date: Mon, 22 Jul 2019 03:52:33 +0000

> With this code Emacs seems to be stuck in an endless loop and is not
> incorruptible with C-g:

> (let ((proc (make-network-process :name "foo" :server t :noquery t
>  :family 'local :service "/tmp/foo.socket")))
>   (accept-process-output proc))

On Linux, the problem appears to be that we don't abort this infloop
in process.c if a read () returns EINVAL:

          while (true)
          int nread = read_process_output (proc, wait_proc->infd);
          if (nread < 0)
              if (errno == EIO || would_block (errno))
              if (got_some_output < nread)
            got_some_output = nread;
              if (nread == 0)
              read_some_bytes = true;

That seems problematic to me, since we might get non-EIO errors for
other reasons. I'm attaching a patch that appears to fix the issue.

Attachment: 0001-Don-t-retry-reading-after-receiving-EINVAL-bug-6074.patch
Description: Text Data

reply via email to

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