From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nala Ginrut Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Fix get-bytevector-all read redundant eof Date: Sat, 16 Mar 2013 12:25:57 +0800 Organization: HFG Message-ID: <1363407957.3025.39.camel@Renee-desktop.suse> References: <1363253404.3025.12.camel@Renee-desktop.suse> <1363336772.3025.26.camel@Renee-desktop.suse> <87k3p8z7f4.fsf@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1363407970 9064 80.91.229.3 (16 Mar 2013 04:26:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 Mar 2013 04:26:10 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Mar 16 05:26:35 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UGihW-0000mc-9g for guile-devel@m.gmane.org; Sat, 16 Mar 2013 05:26:34 +0100 Original-Received: from localhost ([::1]:41735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGih9-0002Vu-Jo for guile-devel@m.gmane.org; Sat, 16 Mar 2013 00:26:11 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGih4-0002Vl-B3 for guile-devel@gnu.org; Sat, 16 Mar 2013 00:26:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UGih1-0004bM-JP for guile-devel@gnu.org; Sat, 16 Mar 2013 00:26:06 -0400 Original-Received: from mail-pb0-f44.google.com ([209.85.160.44]:40661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGih1-0004bH-D4 for guile-devel@gnu.org; Sat, 16 Mar 2013 00:26:03 -0400 Original-Received: by mail-pb0-f44.google.com with SMTP id wz12so4638431pbc.17 for ; Fri, 15 Mar 2013 21:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:subject:from:to:cc:date:in-reply-to :references:organization:content-type:x-mailer:mime-version :content-transfer-encoding; bh=6nJSNRKQ97yhfWhgKvUjSsCqozhCdfQID+Wl8RQNc0o=; b=azL8a6uVcXRO/ybB+QdblJqV9c1vpeoeiTs0e3NhtW+UxahqCUujLxViws1sKbfQDW tQqhEGNmZBpB2XDG3CzdpbDZGYYhGar+Jq+kd9d0Uo0uhIDwQuhAV13boq9iVPc7IfSN ohu5DvRvM+efaOMD+HT7hVM91xyWX9caGW6S4+Ur7KYsnPQuPspkcWNQROHy9DZgxQZ0 S2kmR93UORXGmCr7QjM1iE8BtKAyOtfg+BMCtbr1stSFAiE+MkHSPF3GpqjNYcTmFpJr 0T9jGAUtd1XczwTlv5i1RMp2JWQBQcvATrJw8B1b4dsiSgAkuyGfdGvks70RAVSzgUxD Ic7Q== X-Received: by 10.68.103.98 with SMTP id fv2mr14257308pbb.121.1363407962466; Fri, 15 Mar 2013 21:26:02 -0700 (PDT) Original-Received: from [192.168.100.104] ([59.40.166.177]) by mx.google.com with ESMTPS id 1sm11977214pbg.18.2013.03.15.21.25.59 (version=SSLv3 cipher=RC4-SHA bits=128/128); Fri, 15 Mar 2013 21:26:01 -0700 (PDT) In-Reply-To: <87k3p8z7f4.fsf@tines.lan> X-Mailer: Evolution 3.4.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.160.44 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15919 Archived-At: On Fri, 2013-03-15 at 17:20 -0400, Mark H Weaver wrote: > Nala Ginrut writes: > > > On Thu, 2013-03-14 at 17:30 +0800, Nala Ginrut wrote: > >> Attached the patch to fix get-bytevector-all. > >> You may check it like this: > >> (get-bytevector-all (current-input-port)) > >> > >> And try to input then type ctrl+d, the current implementation needs you > >> type ctrl+d twice. > >> > >> Regards. > > > > > > Sorry, but I realized that this patch only fixed when you type ctrl+d in > > the beginning. But if you input something, the problem is still there. > > I'll look deeper. > > FWIW, I suspect you'll have to dig fairly deep to fix this properly. > AFAIK, the ports code was not designed to ensure that exactly one EOF is > reported to the user for each EOF returned by the kernel. I hope to > look into this soon (possibly before 2.0.8), as part of my investigation > of . > Yes, I tried the bug-demo code of dwheeler, and found that EOF seems was eaten in somewhere. I read the code on the calling-tree of scm_peek_char, but hardly find the problem related. Maybe it's something about the 'port' implementation? > Thanks, > Mark