unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: Helmut Eller <eller.helmut@gmail.com>
Cc: 5723@debbugs.gnu.org
Subject: bug#5723: 23.1.94; make-network-process and emacs hangs
Date: Fri, 19 Mar 2010 10:47:05 +0900	[thread overview]
Message-ID: <wlvdct5bhi.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <wlvdcu6ltf.wl%mituharu@math.s.chiba-u.ac.jp>

>>>>> On Thu, 18 Mar 2010 18:06:20 +0900, YAMAMOTO Mitsuharu <mituharu@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@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.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp






  reply	other threads:[~2010-03-19  1:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-15 16:01 bug#5723: 23.1.94; make-network-process and emacs hangs Leo
2010-03-15 18:24 ` Dan Nicolaescu
2010-03-15 19:22 ` Stefan Monnier
2010-03-15 22:49   ` Helmut Eller
2010-03-16  0:45     ` YAMAMOTO Mitsuharu
2010-03-17 12:01       ` Leo
2010-03-18  1:57         ` YAMAMOTO Mitsuharu
2010-03-18  7:43           ` Helmut Eller
2010-03-18  9:06             ` YAMAMOTO Mitsuharu
2010-03-19  1:47               ` YAMAMOTO Mitsuharu [this message]
2010-03-19  6:41                 ` Helmut Eller
2010-03-19 10:21                   ` YAMAMOTO Mitsuharu
2010-03-19 13:29                     ` Stefan Monnier
2010-03-20  0:30                       ` YAMAMOTO Mitsuharu
2010-03-20 12:34                     ` Leo
2010-03-24 22:00                     ` Chong Yidong
2010-03-24 23:31                       ` YAMAMOTO Mitsuharu
2010-03-25  1:25                         ` Chong Yidong
2010-03-18  9:58           ` Leo
2010-03-18  2:20         ` YAMAMOTO Mitsuharu
2010-03-18 10:00           ` Leo
2010-03-18 10:37             ` YAMAMOTO Mitsuharu
2010-03-18 10:47               ` Leo
2010-03-18 11:01                 ` YAMAMOTO Mitsuharu
2010-03-17 11:53   ` Leo
2010-03-25  9:00 ` bug#5723: (no subject) YAMAMOTO Mitsuharu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wlvdct5bhi.wl%mituharu@math.s.chiba-u.ac.jp \
    --to=mituharu@math.s.chiba-u.ac.jp \
    --cc=5723@debbugs.gnu.org \
    --cc=eller.helmut@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).