Ar an deichiú lá de mí na Nollaig, scríobh Johann 'Myrkraverk' Oskarsson:
On Sat, Dec 9, 2017 at 7:49 PM, Johann 'Myrkraverk'
> Ok, so I "worked around this problem" by setting the read end of the
> pipe to nonblocking mode before calling connect_to_file_descriptor().
This seems to work fine for me. The pre-patched version is just one line,
so I paste it here in its entirety.
I’ve gone ahead and applied that to 21.5. I have occasionally got hangs
especially when VM is using an external program for qp-decoding, and I suspect
your issue is at the root of them. I don’t see any downside to your change,
XEmacs code further up the call stack needs to be able to handle smaller reads
anyway. Thank you!
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1513067231 0
# Tue Dec 12 08:27:11 2017 +0000
# Node ID affc195870d60c7f3f61d304cc01f205f63432d8
# Parent 0f7f0274157b50c71683368d0614b8912e2b70d7
Set input FDs to non-blocking unconditionally, thank you Myrkraverk
2017-12-12 Aidan Kehoe <kehoea(a)parhasard.net>
* process-unix.c (unix_init_process_io_handles):
Set input FDs to non-blocking unconditionally, see recent patch
posted to xemacs-beta from Johann "Myrkraverk" Oskarsson.
diff -r 0f7f0274157b -r affc195870d6 src/ChangeLog
--- a/src/ChangeLog Wed Dec 06 20:52:28 2017 +0000
+++ b/src/ChangeLog Tue Dec 12 08:27:11 2017 +0000
＠＠ -1,3 +1,9 ＠＠
+2017-12-12 Aidan Kehoe <kehoea(a)parhasard.net>
+ * process-unix.c (unix_init_process_io_handles):
+ Set input FDs to non-blocking unconditionally, see recent patch
+ posted to xemacs-beta from Johann "Myrkraverk" Oskarsson.
2017-12-02 Aidan Kehoe <kehoea(a)parhasard.net>
* bytecode.c (set_compiled_function_arglist):
diff -r 0f7f0274157b -r affc195870d6 src/process-unix.c
--- a/src/process-unix.c Wed Dec 06 20:52:28 2017 +0000
+++ b/src/process-unix.c Tue Dec 12 08:27:11 2017 +0000
＠＠ -831,6 +831,25 ＠＠
/* if sizeof(EMACS_INT) > sizeof(int) this truncates the value */
UNIX_DATA(p)->infd = (EMACS_INT) in;
UNIX_DATA(p)->errfd = (EMACS_INT) err;
+ /* In the event where the input file descriptor is a pipe, XEmacs as of
+ * 21.4.24 will hang on the read() system call when the pipe doesn't
+ * have enough to fill the incoming buffer.
+ * This will likely affect other kinds of blocking file descriptors also, so
+ * we unconditionally set the input fd to non-blocking mode. See:
+ * and the related thread.
+ int f = fcntl (UNIX_DATA(p)->infd, F_SETFL, O_NONBLOCK);
+ if (f == -1)
+ warn_when_safe (Qio_error, lisp_strerror (errno),
+ "failed setting pipe (fd %ld) to nonblocking mode",
+ (EMACS_INT) in);
/* Move the file descriptor FD so that its number is not less than MIN. *
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’