help-emacs-windows
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[h-e-w] CRITICAL BUG: process-send-region hangs ntEmacs if region >64K


From: Jeffrey J. Kosowsky
Subject: [h-e-w] CRITICAL BUG: process-send-region hangs ntEmacs if region >64K
Date: Mon, 11 Jan 2010 11:04:15 -0500

When using process-send-region-process to send a region more than
 about 64K in size to the command 'cat', emacs hangs forever and is
 *only* recoverable by going out of emacs to kill the 'cat' process. 

The following simple code snippet reproduces the problem where NNNN is
 bigger than about 64K. Just run it on a region containing sufficient
 text...

 (progn (setq process (start-process "test" "tempbuff" "cat"))
 (process-send-region process (point-min) NNNNN))

Note the problem *does* not occur with synchronous use of 'cat' via
call-process-region nor does it occur if you 'cat' the region onto a
file (e.g. using "> tempfile" as part of the &rest args). Also, this
problem does not occur on Linux.

The exact cutoff for when it fails is always within a few thousand
bytes of 64K but varies by file (and may be related to things like
encoding).

The problem also occurs if NNNN is smaller than 64K but you send
multiple separate regions of size >64K in rapid succession.

This seems to be some type of buffering issue.

Also, the bug is not *theoretical* in that it breaks functionality in
the vm.el (viewmail) program.

I am using: 
  GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600) of 2009-09-23 on YAMALOK
But I also tested the problem on earlier versions of ntemacs (again
  Linux works fine)

This bug may or may not be related to the following code snippet found
in the standard tramp.el package:
      ;; Under Windows XP, accept-process-output doesn't return
      ;; sometimes.  So we add an additional timeout.
      (with-timeout ((or timeout 1))
        (accept-process-output proc timeout timeout-msecs)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]