From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 19 14:05:07 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C344E1065693 for ; Thu, 19 Aug 2010 14:05:07 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 7B7368FC24 for ; Thu, 19 Aug 2010 14:05:07 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Om5js-0003l3-2h for freebsd-hackers@freebsd.org; Thu, 19 Aug 2010 16:05:04 +0200 Received: from p5b2030f3.dip.t-dialin.net ([91.32.48.243]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 19 Aug 2010 16:05:04 +0200 Received: from sperber by p5b2030f3.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 19 Aug 2010 16:05:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Michael Sperber Date: Thu, 19 Aug 2010 15:08:59 +0200 Lines: 28 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p5b2030f3.dip.t-dialin.net User-Agent: Gnus/5.110011 (No Gnus v0.11) XEmacs/21.5-b29 (darwin) Cancel-Lock: sha1:eshrD3pvb2wf8yD9yHggHh26eE4= Subject: Data truncation on ptys X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2010 14:05:07 -0000 I'm one of the maintainers of XEmacs, and I've been running into a persistent problem with subprocesses / ptys since at least 5.x. (If this is not the right list, I'd appreciate a pointer to a more appropriate forum.) Here's the basic issue: Whenever XEmacs tries to send a larger chunk of data to a subprocess over a pty, only part of the data arrives at the other end of the pty. XEmacs tries very hard to chop up the data into (245-byte) pieces, terminating the pieces with NL or EOF as appropriate. Still, when around 7.5 kilobyte is sent rapidly, I see this pattern: master truss: write(7," 1692 1693 1694 1695 1696 1697 1"...,245) = 245 (0xf5) write(7,"\^D",1) = 1 (0x1) slave/subprocess truss ("cat" in this case): read(0," 1692 1693 1694 1695 1696 1697 1"...,4096) = 144 (0x90) Subsequent writes from the master do not get seen *at all* on the slave, i.e. the next read blocks. If anybody could shed some light on this issue, help would be much appreciated! -- Regards, Mike