GNU bug report logs - #5723
23.1.94; make-network-process and emacs hangs

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Mon, 15 Mar 2010 16:02:01 UTC

Severity: normal

Done: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>

Bug is archived. No further changes may be made.

Full log


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

From: Helmut Eller <eller.helmut <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#5723: 23.1.94; make-network-process and emacs hangs
Date: Fri, 19 Mar 2010 07:41:54 +0100
* YAMAMOTO Mitsuharu [2010-03-19 02:47+0100] writes:

>>>>>> On Thu, 18 Mar 2010 18:06:20 +0900, YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp> said:
>
>>>> If your case blocks at `connect', then it can't be quit with C-g
>>>> regardless of SYNC_INPUT on those ports/systems, because atimer is
>>>> turned off during the `connect' call.
>
>>> Why is the timer turned off around connect?  Handling SIGALARM
>>> during connect doesn't seem much different from handling SIGIO.
>
>> I think your argument makes sense.
>
> The current code closes the socket and call `connect' again if
> (blocking) `connect' is interrupted by a signal.
>
> 2004-11-09  Kim F. Storm  <storm <at> cua.dk>
>
> 	* process.c (Fmake_network_process): Remove kludge for interrupted
> 	connects on BSD.  If connect is interrupted, just close socket and
> 	start over rather than sleeping and retry with same socket.
>
> (http://cvs.savannah.gnu.org/viewvc/emacs/src/process.c?root=emacs&r1=1.443&r2=1.444)
>
> UNIX Network Programming (Richard Stevens et al.) says "What we must
> do in this scenario is call /select/" (Section 16,5, Volume 1 third
> edition).
>
> Also, POSIX says:
>
>   If connect() is interrupted by a signal that is caught while blocked
>   waiting to establish a connection, connect() shall fail and set
>   errno to [EINTR], but the connection request shall not be aborted,
>   and the connection shall be established asynchronously.
>
>   ...
>
>   When the connection has been established asynchronously, select()
>   and poll() shall indicate that the file descriptor for the socket is
>   ready for writing.
>
> (http://www.opengroup.org/onlinepubs/000095399/functions/connect.html)
>
> Perhaps we should try this, not just removing `turn_on_atimers' calls.

I had reported that already in 
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5173
but was silently ignored.

Helmut






This bug report was last modified 15 years and 67 days ago.

Previous Next


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