From: Wolfgang Jenkner <wjenkner@inode.at>
To: 6771@debbugs.gnu.org
Subject: bug#6771: 24.0.50; Child process input isn't closed by process-send-eof; hangs indefinitely
Date: Wed, 08 Dec 2010 20:18:35 +0100 [thread overview]
Message-ID: <85bp4whx4o.fsf@iznogoud.viz> (raw)
In-Reply-To: <BB27E9B4-396A-49E8-ACB2-6164A64DC428@sanityinc.com>
Jan Djärv <jan.h.d@swipnet.se> writes:
> I enabled ICANON. If there is a long line problem (i.e. a too long
> line to send_process may only send a partial line), please write a bug
> report for it with a way to reproduce it. That way we can fix it. I
> have not seen any problem or been able to reproduce the long line
> problem.
FWIW, such a problem does exist in the wild.
The UIM emacs bridge (see [1]) sometimes sends long lines of about 20k
of ASCII characters to the uim-el-helper-agent subprocess.
Now, on FreeBSD 8-STABLE the maximum total size of a tty (or pty) input
queue is 1920 bytes, cf. tty_watermarks() in [2] and the discussion in
[3]. For Linux, judging from a superficial glance at tty_buffer_alloc()
in [4], the bound seems to be a more comfortable 65536 bytes.
For a self-contained example of what happens on breaking this bound,
evaluate the following form (adjust 1923 to taste) and observe that the
process output buffer contains only ASCII BEL (\C-g) characters, which
is (modulo bogus references to MAX_INPUT and MAX_CANON) what termios(4)
documents (search for IMAXBEL), i.e., the pseudo-terminal rings :-)
(let* ((buf (generate-new-buffer "cat-out"))
(proc (start-process "cat" buf "cat")))
(process-send-string proc (make-string 1923 ?x))
(process-send-string proc "\n")
(pop-to-buffer buf))
Of course, if line discipline features are not needed, a pipe can be
used as a work-around (and I intend to submit a patch in this sense to
the UIM developers or else to the FreeBSD port maintainer, which is one
reason why I wanted to have this issue documented here).
[1] http://code.google.com/p/uim/wiki/UIM_EL
[2] http://svn.freebsd.org/viewvc/base/stable/8/sys/kern/tty.c?view=markup
[3] http://lists.freebsd.org/pipermail/freebsd-stable/2009-October/052318.html
[3] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/tty/tty_buffer.c;hb=HEAD
next prev parent reply other threads:[~2010-12-08 19:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-01 16:19 bug#6771: 24.0.50; Child process input isn't closed by process-send-eof; hangs indefinitely Steve Purcell
2010-08-01 18:59 ` Óscar Fuentes
2010-08-02 7:06 ` Jan Djärv
2010-08-02 14:37 ` Óscar Fuentes
2010-08-02 18:27 ` Jan Djärv
2010-12-08 19:18 ` Wolfgang Jenkner [this message]
2010-12-10 0:18 ` Štěpán Němec
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=85bp4whx4o.fsf@iznogoud.viz \
--to=wjenkner@inode.at \
--cc=6771@debbugs.gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.