From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Magnus Henoch Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: 23.0.50; ^D inserted into network streams Date: Sun, 02 Dec 2007 14:51:58 +0100 Message-ID: <871wa56w75.fsf@freemail.hu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196603547 21174 80.91.229.12 (2 Dec 2007 13:52:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Dec 2007 13:52:27 +0000 (UTC) To: emacs-pretest-bug@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 02 14:52:35 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IypFI-00013f-QH for ged-emacs-devel@m.gmane.org; Sun, 02 Dec 2007 14:52:33 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IypF2-0005wp-Ex for ged-emacs-devel@m.gmane.org; Sun, 02 Dec 2007 08:52:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IypEy-0005wa-MN for emacs-devel@gnu.org; Sun, 02 Dec 2007 08:52:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IypEu-0005t3-Pf for emacs-devel@gnu.org; Sun, 02 Dec 2007 08:52:12 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IypEu-0005t0-JX for emacs-devel@gnu.org; Sun, 02 Dec 2007 08:52:08 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IypEu-00024H-CR for emacs-devel@gnu.org; Sun, 02 Dec 2007 08:52:08 -0500 Original-Received: from mx10.gnu.org ([199.232.76.166]) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IypEu-0000pk-1A for emacs-pretest-bug@gnu.org; Sun, 02 Dec 2007 08:52:08 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1IypEq-00022v-Bo for emacs-pretest-bug@gnu.org; Sun, 02 Dec 2007 08:52:07 -0500 Original-Received: from anubis.medic.chalmers.se ([129.16.30.218]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IypEp-00020h-EK for emacs-pretest-bug@gnu.org; Sun, 02 Dec 2007 08:52:03 -0500 Original-Received: from zemdatav.stor.no-ip.org (persephone.tekno.chalmers.se [129.16.30.195]) by mail.chalmers.se (Postfix) with ESMTP id 81125455D for ; Sun, 2 Dec 2007 14:51:59 +0100 (CET) Original-Received: by zemdatav.stor.no-ip.org (Postfix, from userid 1000) id 4178843D03; Sun, 2 Dec 2007 14:51:59 +0100 (CET) X-Hashcash: 1:23:071202:emacs-pretest-bug@gnu.org::acmOl252m8JFkqQ6:000000000000000000000000000000000000IUgw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (berkeley-unix) X-detected-kernel: by monty-python.gnu.org: Solaris 9 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:84479 gmane.emacs.pretest.bugs:20407 Archived-At: When sending binary data (in particular, data where newlines are more than 250 bytes apart) on a network connection, Emacs sometimes inserts ^D bytes. This seems to be a heisenbug; it doesn't always happen. A test case: ;; Make a netcat receiver: nc -l -p 10000 >/tmp/output (defun test-stream-pollution (file host port) (interactive (list (read-file-name "Send file: " nil nil t) (read-string "Connect to host (default `127.0.0.1'): " nil nil "127.0.0.1") (read-number "Connect to port: " 10000))) (let* ((conn (open-network-stream "pollution" nil host port))) (set-process-coding-system conn 'binary 'binary) (with-temp-buffer (insert-file-contents-literally file) (message "Sending file...") (process-send-region conn (point-min) (point-max)) (message "Sending file...done")) (delete-process conn))) If the file sent is binary by the above definition, the two copies of the file will sometimes differ in that a ^D is inserted every 250th byte. The following patch seems to fix the problem. Is it the proper fix? Should it be applied to both trunk and branch(es)? Do more fields need initialization? 2007-12-02 Magnus Henoch * process.c (make_process): Initialize pty_flag to 0. --- a/src/process.c +++ b/src/process.c @@ -634,6 +634,7 @@ make_process (name) p->raw_status_new = 0; p->status = Qrun; p->mark = Fmake_marker (); + p->pty_flag = 0; #ifdef ADAPTIVE_READ_BUFFERING p->adaptive_read_buffering = 0; In GNU Emacs 23.0.50.2 (powerpc-unknown-netbsd4.99.36, GTK+ Version 2.12.0) of 2007-12-02 on zemdatav Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil locale-coding-system: nil default-enable-multibyte-characters: t Major mode: C/l Minor modes in effect: display-time-mode: t jabber-activity-mode: t jabber-mode-line-mode: t iswitchb-mode: t icomplete-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t