From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs,gmane.lisp.scheme.geiser Subject: bug#33403: [Geiser-users] Data length limit in Guile/Geiser/Scheme evaluation Date: Fri, 16 Nov 2018 02:13:40 -0500 Message-ID: <87y39t1olc.fsf@netris.org> References: <87sh021kw2.fsf@ossau.homelinux.net> <878t1ugyf9.fsf@nicolasgoaziou.fr> <87h8gi1g5g.fsf@ossau.homelinux.net> <871s7mz357.fsf@imladris> <87bm6q1c33.fsf@ossau.homelinux.net> <87o9aq55tl.fsf@ossau.homelinux.net> <87d0r5349t.fsf@netris.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1542352389 16208 195.159.176.226 (16 Nov 2018 07:13:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Nov 2018 07:13:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: geiser-users@nongnu.org, 33403@debbugs.gnu.org To: Neil Jerram Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Nov 16 08:13:04 2018 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNYJL-00046n-UC for guile-bugs@m.gmane.org; Fri, 16 Nov 2018 08:13:04 +0100 Original-Received: from localhost ([::1]:42460 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNYLS-0001lp-4Z for guile-bugs@m.gmane.org; Fri, 16 Nov 2018 02:15:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNYLM-0001kL-T3 for bug-guile@gnu.org; Fri, 16 Nov 2018 02:15:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNYLH-0000Ue-CY for bug-guile@gnu.org; Fri, 16 Nov 2018 02:15:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50414) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gNYLH-0000UE-9b for bug-guile@gnu.org; Fri, 16 Nov 2018 02:15:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gNYLG-0003sQ-S4 for bug-guile@gnu.org; Fri, 16 Nov 2018 02:15:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 16 Nov 2018 07:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33403 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 33403-submit@debbugs.gnu.org id=B33403.154235246814834 (code B ref 33403); Fri, 16 Nov 2018 07:15:02 +0000 Original-Received: (at 33403) by debbugs.gnu.org; 16 Nov 2018 07:14:28 +0000 Original-Received: from localhost ([127.0.0.1]:54672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNYKi-0003rC-B6 for submit@debbugs.gnu.org; Fri, 16 Nov 2018 02:14:28 -0500 Original-Received: from world.peace.net ([64.112.178.59]:60020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNYKg-0003qz-V7 for 33403@debbugs.gnu.org; Fri, 16 Nov 2018 02:14:27 -0500 Original-Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gNYKb-0002zX-D4; Fri, 16 Nov 2018 02:14:21 -0500 In-Reply-To: <87d0r5349t.fsf@netris.org> (Mark H. Weaver's message of "Fri, 16 Nov 2018 01:49:39 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9270 gmane.lisp.scheme.geiser:644 Archived-At: Mark H Weaver writes: > If, after pasting this, you type another close quote, 5 close parens, > and then repaste the last two lines, it will print the garbled input and > return to a prompt. Actually, instead of pasting the last two lines as-is, I replaced "(length classification)" with "classification", so that instead of printing the length, it prints the actual s-exp. Then you can see what happened to that final string literal. > Anyway, to make a long story short, after some debugging, I found that > precisely the same truncation of the first line happens when using 'cat' > from GNU coreutils. Simply type 'cat' and paste the same text, and > you'll see that in the output, only the first 4095 bytes of the first > line were retained. > > So, I'm not sure where the problem is, but it's not a problem in Guile. This is a documented limitation in Linux's terminal handling when in canonical mode. See the termios(3) man page, which includes this text: Canonical and noncanonical mode The setting of the ICANON canon flag in c_lflag determines whether the terminal is operating in canonical mode (ICANON set) or noncanonical mode (ICANON unset). By default, ICANON is set. In canonical mode: * Input is made available line by line. An input line is available when one of the line delimiters is typed (NL, EOL, EOL2; or EOF at the start of line). Except in the case of EOF, the line delimiter is included in the buffer returned by read(2). * Line editing is enabled (ERASE, KILL; and if the IEXTEN flag is set: WERASE, REPRINT, LNEXT). A read(2) returns at most one line of input; if the read(2) requested fewer bytes than are available in the current line of input, then only as many bytes as requested are read, and the remaining characters will be available for a future read(2). * The maximum line length is 4096 chars (including the terminating newline character); lines longer than 4096 chars are truncated. After 4095 characters, input processing (e.g., ISIG and ECHO* processing) continues, but any input data after 4095 characters up to (but not including) any terminating newline is discarded. This ensures that the terminal can always receive more input until at least one line can be read. Note that last item above. Mark