From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs,gmane.lisp.guile.devel Subject: bug#16357: insufficient print abbreviation in error messages Date: Tue, 21 Jun 2016 14:17:30 +0200 Message-ID: <87ziqezqg5.fsf@pobox.com> References: <20140105230032.GB30283@fysh.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466511697 27432 80.91.229.3 (21 Jun 2016 12:21:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jun 2016 12:21:37 +0000 (UTC) Cc: Zefram , 16357@debbugs.gnu.org To: guile-devel@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Jun 21 14:21:19 2016 Return-path: Envelope-to: guile-bugs@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 1bFKfz-0003Yy-Ol for guile-bugs@m.gmane.org; Tue, 21 Jun 2016 14:21:08 +0200 Original-Received: from localhost ([::1]:51385 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFKfy-0006Hd-Fe for guile-bugs@m.gmane.org; Tue, 21 Jun 2016 08:21:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFKd5-0002Al-7H for bug-guile@gnu.org; Tue, 21 Jun 2016 08:18:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFKd0-00079O-4y for bug-guile@gnu.org; Tue, 21 Jun 2016 08:18:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFKd0-00079F-1R for bug-guile@gnu.org; Tue, 21 Jun 2016 08:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bFKcz-0001l2-Pj for bug-guile@gnu.org; Tue, 21 Jun 2016 08:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andy Wingo Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 21 Jun 2016 12:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16357 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 16357-submit@debbugs.gnu.org id=B16357.14665114666735 (code B ref 16357); Tue, 21 Jun 2016 12:18:01 +0000 Original-Received: (at 16357) by debbugs.gnu.org; 21 Jun 2016 12:17:46 +0000 Original-Received: from localhost ([127.0.0.1]:48699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFKck-0001kZ-59 for submit@debbugs.gnu.org; Tue, 21 Jun 2016 08:17:46 -0400 Original-Received: from pb-sasl1.pobox.com ([64.147.108.66]:52486 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFKce-0001kL-Nb for 16357@debbugs.gnu.org; Tue, 21 Jun 2016 08:17:45 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 6600422836; Tue, 21 Jun 2016 08:17:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=nysY4AKfsKfKNrmOaowFlIYFNU4=; b=fEBxqB +64U9kjQOyFfTNnxK3ArSKoz/iNox95mX2jcWTiplNJ5W+lkH8i4CIZpXP/5FCuj MqIYBoYnwm7Z3TsrJuWgaU9esq+sL7R0LfYrGxRNBN2e2i7riO4UoDgWIkUoH+L6 mOtzOgB7BEDpcd1P55CNxHM0zNAnniw0543dk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=N45fmfBqDaJP+xDyMkI0uRimbKnF35c8 1jnLFaiKSLZMOJttMwql0s+Y5wJU1aJLEsf2BiE7riSIoSQAPrltNXavBAs/u5A1 sjG9PDs48QUXPe4STILH1ifGmxio76mNrPp5WbGobAhY8mCGg0sOxsFHMDxsQ7y4 v+WkTEJ//SQ= Original-Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 5EE7E22835; Tue, 21 Jun 2016 08:17:38 -0400 (EDT) Original-Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id 66D6222834; Tue, 21 Jun 2016 08:17:37 -0400 (EDT) In-Reply-To: <20140105230032.GB30283@fysh.org> (zefram@fysh.org's message of "Sun, 5 Jan 2014 23:00:32 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-Pobox-Relay-ID: 2475FE84-37AA-11E6-BE6D-C1836462E9F6-02397024!pb-sasl1.pobox.com 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:8082 gmane.lisp.guile.devel:18380 Archived-At: Not really sure what to do here. Ideally we could just use ~@y in the format messages. However we can't rely on having a full format loaded up, only simple-format. We could lazily load the full format when needed, but I don't know if we should train users that the full `format' is always around. We could define well-known parameters for specifying that we should truncate the output of a `write' procedure, and have pair / vector / bytevectors use that parameter when needed. Perhaps that's the thing? Or, we could use print states. But print states are not so great and ideally we would remove them eventually. Thoughts? Andy On Mon 06 Jan 2014 00:00, Zefram writes: > When guile is constructing error messages that display offending objects, > in version 2.0.9 it never abbreviates long or deep structures. This can > easily lead to pathologically-long messages that take stupid amounts of > time and memory to construct and to display. By contrast, guile-1.8 > applies abbreviation at a reasonable level, and objects appearing in > stack traces have reasonable abbreviation on both versions. Two very > mild examples: > > $ guile-1.8 --debug -c "(read (let aaa ((n 100) (v '())) (if (= n 0) v (aaa (- n 1) (cons n v)))))" > Backtrace: > In current input: > 1: 0* [read {(1 2 3 4 5 6 7 8 9 ...)}] > > :1:1: In procedure read in expression (read (# 100 #)): > :1:1: Wrong type argument in position 1 (expecting open input port): (1 2 3 4 5 6 7 8 9 10 ...) > $ guile-2.0 --debug -c "(read (let aaa ((n 100) (v '())) (if (= n 0) v (aaa (- n 1) (cons n v)))))" > Backtrace: > In ice-9/boot-9.scm: > 157: 7 [catch #t # ...] > In unknown file: > ?: 6 [apply-smob/1 #] > In ice-9/boot-9.scm: > 63: 5 [call-with-prompt prompt0 ...] > In ice-9/eval.scm: > 432: 4 [eval # #] > In unknown file: > ?: 3 [call-with-input-string "(read (let aaa ((n 100) (v '())) (if (= n 0) v (aaa (- n 1) (cons n v)))))" ...] > In ice-9/command-line.scm: > 180: 2 [# #] > In unknown file: > ?: 1 [eval (read (let aaa (# #) (if # v #))) #] > ?: 0 [read (1 2 3 4 5 6 7 8 9 ...)] > > ERROR: In procedure read: > ERROR: In procedure read: Wrong type argument in position 1 (expecting open input port): (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100) > $ guile-1.8 --debug -c "(read (let aaa ((n 100) (v '())) (if (= n 0) v (aaa (- n 1) (cons v n)))))" > Backtrace: > In current input: > 1: 0* [read {(((# . 3) . 2) . 1)}] > > :1:1: In procedure read in expression (read (# 100 #)): > :1:1: Wrong type argument in position 1 (expecting open input port): (((((((# . 7) . 6) . 5) . 4) . 3) . 2) . 1) > $ guile-2.0 --debug -c "(read (let aaa ((n 100) (v '())) (if (= n 0) v (aaa (- n 1) (cons v n)))))" > Backtrace: > In ice-9/boot-9.scm: > 157: 7 [catch #t # ...] > In unknown file: > ?: 6 [apply-smob/1 #] > In ice-9/boot-9.scm: > 63: 5 [call-with-prompt prompt0 ...] > In ice-9/eval.scm: > 432: 4 [eval # #] > In unknown file: > ?: 3 [call-with-input-string "(read (let aaa ((n 100) (v '())) (if (= n 0) v (aaa (- n 1) (cons v n)))))" ...] > In ice-9/command-line.scm: > 180: 2 [# #] > In unknown file: > ?: 1 [eval (read (let aaa (# #) (if # v #))) #] > ?: 0 [read (((# . 3) . 2) . 1)] > > ERROR: In procedure read: > ERROR: In procedure read: Wrong type argument in position 1 (expecting open input port): ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((() . 100) . 99) . 98) . 97) . 96) . 95) . 94) . 93) . 92) . 91) . 90) . 89) . 88) . 87) . 86) . 85) . 84) . 83) . 82) . 81) . 80) . 79) . 78) . 77) . 76) . 75) . 74) . 73) . 72) . 71) . 70) . 69) . 68) . 67) . 66) . 65) . 64) . 63) . 62) . 61) . 60) . 59) . 58) . 57) . 56) . 55) . 54) . 53) . 52) . 51) . 50) . 49) . 48) . 47) . 46) . 45) . 44) . 43) . 42) . 41) . 40) . 39) . 38) . 37) . 36) . 35) . 34) . 33) . 32) . 31) . 30) . 29) . 28) . 27) . 26) . 25) . 24) . 23) . 22) . 21) . 20) . 19) . 18) . 17) . 16) . 15) . 14) . 13) . 12) . 11) . 10) . 9) . 8) . 7) . 6) . 5) . 4) . 3) . 2) . 1) > > Debian incarnation of this bug report: > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734128 > > -zefram