unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Frédéric Giquel via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 55737@debbugs.gnu.org
Subject: bug#55737: [PATCH] 28.1; Values of `read-process-output-max' above 64k not taken into account on GNU/Linux
Date: Wed, 01 Jun 2022 08:09:59 +0200	[thread overview]
Message-ID: <b63d4f10ee46e7f67414d452635eafa58357c934.camel@laposte.net> (raw)
In-Reply-To: <83o7zdj4j0.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 544 bytes --]

Le mardi 31 mai 2022 à 15:00 +0300, Eli Zaretskii a écrit :
> > Date: Tue, 31 May 2022 13:09:38 +0200
> > From:  Frédéric Giquel via "Bug reports for GNU Emacs,
> >  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> > 
> > +#if defined(GNU_LINUX) && defined(F_SETPIPE_SZ)
> > +  fcntl (inchannel, F_SETPIPE_SZ, read_process_output_max);
> > +#endif
> 
> Shouldn't this be done only for pipe connections to the subprocess?

You're right. Setting pipe size is useless for pty connection.
Here is the new patch.

[-- Attachment #2: pipe-size-v2.patch --]
[-- Type: text/x-patch, Size: 1081 bytes --]

diff --git a/src/process.c b/src/process.c
index 8b587aaa4e..eae7b26eb3 100644
--- a/src/process.c
+++ b/src/process.c
@@ -2132,6 +2132,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
       inchannel = p->open_fd[READ_FROM_SUBPROCESS];
       forkout = p->open_fd[SUBPROCESS_STDOUT];
 
+#if defined(GNU_LINUX) && defined(F_SETPIPE_SZ)
+      fcntl (inchannel, F_SETPIPE_SZ, read_process_output_max);
+#endif
+
       if (!NILP (p->stderrproc))
 	{
 	  struct Lisp_Process *pp = XPROCESS (p->stderrproc);
@@ -8571,7 +8575,10 @@ syms_of_process (void)
   DEFVAR_INT ("read-process-output-max", read_process_output_max,
 	      doc: /* Maximum number of bytes to read from subprocess in a single chunk.
 Enlarge the value only if the subprocess generates very large (megabytes)
-amounts of data in one go.  */);
+amounts of data in one go.
+
+On GNU/Linux system, the value should not exceed
+`/proc/sys/fs/pipe-max-size'. See pipe(7) manpage for details. */);
   read_process_output_max = 4096;
 
   DEFSYM (Qinternal_default_interrupt_process,

  reply	other threads:[~2022-06-01  6:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31 11:09 bug#55737: [PATCH] 28.1; Values of `read-process-output-max' above 64k not taken into account on GNU/Linux Frédéric Giquel via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-31 12:00 ` Eli Zaretskii
2022-06-01  6:09   ` Frédéric Giquel via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-06-02  9:39     ` Lars Ingebrigtsen

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=b63d4f10ee46e7f67414d452635eafa58357c934.camel@laposte.net \
    --to=bug-gnu-emacs@gnu.org \
    --cc=55737@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=frederic.giquel@laposte.net \
    /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).