GNU bug report logs - #15075
24.3.50; Infinite loop when closing some connections

Previous Next

Package: emacs;

Reported by: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Date: Mon, 12 Aug 2013 12:38:01 UTC

Severity: important

Found in version 24.3.50

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 15075 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: 15075 <at> debbugs.gnu.org
Subject: Re: bug#15075: 24.3.50; Infinite loop when closing some connections
Date: Mon, 12 Aug 2013 18:04:56 +0200
This is what's hanging.  If we get any other errors than EIO, EAGAIN or
EWOULDBLOCK, then we infloop here.  And we get EBADF, so this infloops.

	  /* Read data from the process, until we exhaust it.  */
	  while (wait_proc->infd >= 0)
	    {
	      int nread = read_process_output (proc, wait_proc->infd);

	      if (nread == 0)
		break;

	      if (nread > 0)
		got_some_input = read_some_bytes = 1;
	      else if (nread == -1 && (errno == EIO || errno == EAGAIN))
		break;
#ifdef EWOULDBLOCK
	      else if (nread == -1 && EWOULDBLOCK == errno)
		break;
#endif
	    }

I'm guessing that something is supposed to set wait_proc->infd something
smaller than zero somewhere if a serious error happens.

Yup:

(gdb) print wait_proc->open_fd
$12 = {-1, -1, -1, -1, -1, -1}
(gdb) print wait_proc->infd   
$13 = 21

And this looks like the likely culprit:

-      p->infd  = -1;
-      p->outfd = -1;
+  for (i = 0; i < PROCESS_OPEN_FDS; i++)
+    close_process_fd (&p->open_fd[i]);

So there's some disagreement about what's saying whether sockets are
open or not, and if the closing happens at the wrong time, we infloop.

-- 
(domestic pets only, the antidote for overdose, milk.)
  No Gnus T-Shirt for sale: http://ingebrigtsen.no/no.php
  and http://lars.ingebrigtsen.no/2013/08/twenty-years-of-september.html




This bug report was last modified 11 years and 288 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.