From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#31995: 26.1; Condition-case failed to catch error Date: Thu, 12 Jul 2018 22:43:38 -0500 Message-ID: References: <0af47dad-c396-7e0d-04e2-ba029a5a37d8@gmail.com> <87d0vtbfzu.fsf@gmail.com> <53dc622c-b09f-2251-0a9f-854f55a5642d@gmail.com> <6be07045-d79a-26a9-cd63-e2c294cd0187@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------033DD5704881EC34D7E1AFDB" X-Trace: blaine.gmane.org 1531453326 8998 195.159.176.226 (13 Jul 2018 03:42:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 13 Jul 2018 03:42:06 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 Cc: 31995@debbugs.gnu.org To: Sheng Yang (=?UTF-8?Q?=E6=9D=A8=E5=9C=A3?=) , Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 13 05:42:01 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1fdoy1-0002E0-Gk for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Jul 2018 05:42:01 +0200 Original-Received: from localhost ([::1]:35074 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdp08-00044O-G1 for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Jul 2018 23:44:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdp02-000447-6A for bug-gnu-emacs@gnu.org; Thu, 12 Jul 2018 23:44:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fdozy-0000Rc-8k for bug-gnu-emacs@gnu.org; Thu, 12 Jul 2018 23:44:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49683) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fdozy-0000RT-43 for bug-gnu-emacs@gnu.org; Thu, 12 Jul 2018 23:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fdozx-0002iZ-Nb for bug-gnu-emacs@gnu.org; Thu, 12 Jul 2018 23:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Jul 2018 03:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31995 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix Original-Received: via spool by 31995-submit@debbugs.gnu.org id=B31995.153145342910421 (code B ref 31995); Fri, 13 Jul 2018 03:44:01 +0000 Original-Received: (at 31995) by debbugs.gnu.org; 13 Jul 2018 03:43:49 +0000 Original-Received: from localhost ([127.0.0.1]:57580 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdozk-0002i1-ST for submit@debbugs.gnu.org; Thu, 12 Jul 2018 23:43:49 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:42130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdozj-0002ho-6e for 31995@debbugs.gnu.org; Thu, 12 Jul 2018 23:43:47 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id CEEAB1607CC; Thu, 12 Jul 2018 20:43:40 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id vUz2wEL6Qxul; Thu, 12 Jul 2018 20:43:40 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 131CA160780; Thu, 12 Jul 2018 20:43:40 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id hATTIvTAjKcM; Thu, 12 Jul 2018 20:43:39 -0700 (PDT) Original-Received: from [192.168.0.8] (ip72-206-6-38.fv.ks.cox.net [72.206.6.38]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id ACB3A1607CC; Thu, 12 Jul 2018 20:43:39 -0700 (PDT) In-Reply-To: <6be07045-d79a-26a9-cd63-e2c294cd0187@gmail.com> Content-Language: en-US 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-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:148481 Archived-At: This is a multi-part message in MIME format. --------------033DD5704881EC34D7E1AFDB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/12/2018 07:29 PM, Sheng Yang (=E6=9D=A8=E5=9C=A3) wrote: > the buffer is totally a waste of space when read1 is dealing with > everything ("[", "]", "(", ")", "#", "=3D", numbers, etc.) other than > the name of a symbol (usually tens of characters) or a string Thanks for reporting this. I attempted to work around the immediate problem by installing the attached into the emacs-26 branch. Although this doesn't address the overall problem of stack overflow, that is less pressing. --------------033DD5704881EC34D7E1AFDB Content-Type: text/x-patch; name="0001-Lessen-stack-consumption-in-recursive-read1.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Lessen-stack-consumption-in-recursive-read1.patch" >From b38b91a83491b6812e8267d0247355f0e8e3e189 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 12 Jul 2018 20:23:07 -0700 Subject: [PATCH] Lessen stack consumption in recursive read1 * src/lread.c (read1): Shrink local buffer size from MAX_ALLOCA to 128 (Bug#31995). --- src/lread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lread.c b/src/lread.c index 72523c057f..d5ba48a170 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2677,7 +2677,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) int c; bool uninterned_symbol = false; bool multibyte; - char stackbuf[MAX_ALLOCA]; + char stackbuf[128]; /* Small, as read1 is recursive (Bug#31995). */ current_thread->stack_top = stackbuf; *pch = 0; -- 2.17.1 --------------033DD5704881EC34D7E1AFDB--