From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#57911: Abolish max-specpdl-size Date: Sun, 18 Sep 2022 13:57:22 +0200 Message-ID: <02FBC80B-A05B-4384-B442-B1FB9F70CA05@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11721"; mail-complaints-to="usenet@ciao.gmane.io" To: 57911@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 18 16:57:12 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oZvjL-0002rN-NB for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Sep 2022 16:57:11 +0200 Original-Received: from localhost ([::1]:42480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZvjK-0005T8-RW for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Sep 2022 10:57:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZvjC-0005T0-C3 for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2022 10:57:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51899) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZvjC-0005EY-3M for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2022 10:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oZvjB-0000Sn-UN for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2022 10:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Sep 2022 14:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57911 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Emacs Bug Report Original-Received: via spool by submit@debbugs.gnu.org id=B.16635129921742 (code B ref -1); Sun, 18 Sep 2022 14:57:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Sep 2022 14:56:32 +0000 Original-Received: from localhost ([127.0.0.1]:50977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZvih-0000S2-Gv for submit@debbugs.gnu.org; Sun, 18 Sep 2022 10:56:31 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:41984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZsvP-0007Dq-Vd for submit@debbugs.gnu.org; Sun, 18 Sep 2022 07:57:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZsvP-0005O2-Qf for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2022 07:57:27 -0400 Original-Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]:34813) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZsvO-0002Fd-0v for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2022 07:57:27 -0400 Original-Received: by mail-lj1-x229.google.com with SMTP id h3so22400231lja.1 for ; Sun, 18 Sep 2022 04:57:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:sender:from:to:cc:subject:date; bh=Auhpe4TWOSm9Y0xLWmwThH9j3CAObWJE/xce0rJhA3M=; b=gaNcTsAqWjAukNy6yHSPI1dVKtYw/tMC1lxrrTSlFLxTsjHiTCb7j+7W8U3ZsQypQJ zalhNhp0p3UiFQPEERzaqky5zUZ2151bw9QepWUd46EvMWwP1ROLc4bANIe6WtT59Awf Cnrj5VQKGuNUmQmUbjLv+tH+2H28NXUjIJwaQi/Mki5oJbK8gR/GtHAjv9Uu/h5d3+1Z hsBGJlOqSZcVhis38KAWNcG+CSZ1XfKWKL4fjdFlyBeMTcZ2bJcDe6VEAfmFEwgqypyZ 1Rt5mEzfWTRk/Fgr4QBHQACMkp0gD+Qu9QXcGdhwyozw8l3WCrE6Pnb7UBHmPMPzDGeV dH7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:sender:x-gm-message-state:from:to:cc:subject:date; bh=Auhpe4TWOSm9Y0xLWmwThH9j3CAObWJE/xce0rJhA3M=; b=6UE9Ala0R+7WW2ccvgGGADX3hm9AUehjs2qaA+v7A1A2m+vYYTxTFIxB2EdiJgHCB2 iL+YA91RtSbZjDjCkgUe6vdbQX8cy1w55izybFIVMZ/c5yfjBfPiDjKuVocnRBJrWSjY bnEk8mWOzYf2XDArxkvy9rYZzZ+imX0RQD0HPtbEYlpFhzI5K6EsQFq88d0KP81/0luX TlZnRtqfBdFAS5SF3sr1Y4bNZPyhSb95BRIZ5DeqszroyupiudNlq5fb60d6d3po/qvX Z9kX1ijbaISYJRDecWoTXYxjsT2OXSA+fZwq5mpV5USTGSTPlx+hrVfVKwin8mIbH77L UJtg== X-Gm-Message-State: ACrzQf3+gxh+xeGnikKDwnQxre+Tap+lhVuy0DLIezGy3abyk+KwqIpb wC4atsrwPd8np03YVQDubXuDVDP47Ild026F X-Google-Smtp-Source: AMsMyM6awbn0B8m3i4D4e4Y34btOEViVAfVUtHua8l7IoNNW9dg/0pd2dPqlc0okgRWLziujPCu5xQ== X-Received: by 2002:a2e:84d6:0:b0:26b:dce5:2fe5 with SMTP id q22-20020a2e84d6000000b0026bdce52fe5mr3617123ljh.12.1663502243826; Sun, 18 Sep 2022 04:57:23 -0700 (PDT) Original-Received: from smtpclient.apple ([188.150.188.179]) by smtp.gmail.com with ESMTPSA id bf40-20020a2eaa28000000b0025dfd8c9287sm1845220ljb.69.2022.09.18.04.57.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Sep 2022 04:57:23 -0700 (PDT) X-Mailer: Apple Mail (2.3654.120.0.1.13) Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=mattias.engdegard@gmail.com; helo=mail-lj1-x229.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 18 Sep 2022 10:56:30 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:242998 Archived-At: This is a proposal to abolish max-specpdl-size, the user-controllable = limit on the internal specpdl stack. It is safe to do so because unbounded specpdl growth is not possible = without proportionally growing the lisp-eval-depth. Therefore, = max-lisp-eval-depth suffices as a guard against runaway recursion and = unreasonable memory usage as it effectively bounds the specpdl stack as = well. The change would give us some performance benefits but the biggest gain = is in user convenience: currently, any code that needs deeper recursion = than permitted by default has to set two variables. What values to use = is often a matter of puzzlement and guessing since it is far from clear = to anyone how they relate. Why abolish max-specpdl-size rather than max-lisp-eval-depth, if they = are connected? First and foremost, because the lisp-eval-depth is easier = to explain and understand; the specpdl is an internal implementation = detail that most Lisp users don't really have a firm grip on. Moreover, although each Lisp call currently consumes at least one = specpdl entry, this won't necessarily remain true in the future: it = should be possible to eliminate that specpdl usage for gains in both = speed and memory. In that case, max-specpdl-size would no longer serve = as an effective recursion limit. Concretely, the change would amount to retaining max-specpdl-size as a = plain dynamic Lisp variable with no special meaning. We could obsolete = it or keep it around indefinitely. A patch will come -- it's all very = straightforward.