From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#49426: 28.0.50; Byte-compilation can fail with large fill-column Date: Tue, 06 Jul 2021 01:16:56 +0100 Message-ID: <87r1gc2t53.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29610"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Kangas To: 49426@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 06 02:18:09 2021 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 1m0Ymv-0007Xe-2Z for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Jul 2021 02:18:09 +0200 Original-Received: from localhost ([::1]:57990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0Ymu-0003Te-3l for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Jul 2021 20:18:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0Ymo-0003TO-GE for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2021 20:18:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35332) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0Ymo-0006cQ-8n for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2021 20:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m0Ymn-0005An-Te; Mon, 05 Jul 2021 20:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: stefan@marxist.se, bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Jul 2021 00:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49426 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Stefan Kangas Original-Received: via spool by submit@debbugs.gnu.org id=B.162553062919817 (code B ref -1); Tue, 06 Jul 2021 00:18:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Jul 2021 00:17:09 +0000 Original-Received: from localhost ([127.0.0.1]:46878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Ylw-00059Y-Fd for submit@debbugs.gnu.org; Mon, 05 Jul 2021 20:17:08 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:45424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Ylu-00059R-Ro for submit@debbugs.gnu.org; Mon, 05 Jul 2021 20:17:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0Ylu-0003N5-JZ for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2021 20:17:06 -0400 Original-Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:46806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0Ylr-0005z4-NS for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2021 20:17:05 -0400 Original-Received: by mail-wr1-x433.google.com with SMTP id n9so6560397wrs.13 for ; Mon, 05 Jul 2021 17:17:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=from:to:subject:date:message-id:mime-version; bh=Jpv8BZpFyKMM6XElq3y/Id2X1mkokVIjahHYHFDjaP0=; b=Ze1UaJhBnmIkf1doLp520jfJvJ4H0AU2ELcA2uFIJURVWbpPCGbArdLD8Wc6/wfoHn UrqAMiJ2HGrczjUC5uuNXn4bVo9qvzggeClUSAMfnJvNBQVz7gh/RAjrtFdTkAa2zcDM IkYExfMoUhscXLayq4Z+NVOnMcmW/mJk0G7IPBIwNrslbevFN3DjhOLt/3mx9VuwuA6A 90g3ZnLa2myhBj3U+9bQzAQDFRCHMUel5mErh3mRCQxYMdpN62pT+UnrCs/n77gDP2k0 zSVdIdLd/4Y3vWtll+Tk9lfhca+upfkY0jYRCvygMMkTpPYqm3ebQIcb1IFhuEU3/9lB oH6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=Jpv8BZpFyKMM6XElq3y/Id2X1mkokVIjahHYHFDjaP0=; b=DyMYCNq06FGUuledDhifZtmBjWvb/jTI0ZvSdquSOKblFpRm03NPdV46rme6ijiKJf mQgmQmgrHR9G68ZmwwEBf7WPJxqq03x0xS2SyUrkCwqWmF28eOOkiaN4O+eU6zXDjvY9 duhDE74hucHnQKvOcEp5Y8sLdxuO8fExGdrCVDT6r+1z7miuEOKJ1WPslMx9UytMwO4H 93ixyE3t3HB5bleLotbI7uPZ1vp19GvqcDqBnCQD935z8iAoELTZxdPOoW2c991+w+VS Z8BosrnaUf5YAngKLOlxwk1RSAH3x3fSrJq+pSNYvHSuJ0t2F7QeHJZteIDDbt1H72bW 0rlQ== X-Gm-Message-State: AOAM530d6fhQoY5+JruxvbZ6bJCWQrC1U7Lv0i7V0IV1Qm6wZt9aEF9q RBggXPcyxdbj8pE+U0vcRyARMpyohEwFfA== X-Google-Smtp-Source: ABdhPJxSAzzLfkgnSfgvfznUQ+r0QDKDZGrL8Ymnem/C0XzqDTED+WwKcO8OJMuVW5NzUj53jxSJYQ== X-Received: by 2002:adf:e8cc:: with SMTP id k12mr18216963wrn.163.1625530619926; Mon, 05 Jul 2021 17:16:59 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:f410:82e8:3a21:eedf]) by smtp.gmail.com with ESMTPSA id j17sm908213wmi.41.2021.07.05.17.16.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 17:16:59 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=contovob@tcd.ie; helo=mail-wr1-x433.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, 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-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:209495 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Tags: patch As seen on the Dash issue tracker: https://github.com/magnars/dash.el/issues/383 0. cd "$(mktemp -d)" 1. HOME=3D"$PWD" XDG_CONFIG_HOME=3D"$PWD/.config" emacs -Q 2. (setq-default package-archives '(("melpa" . "https://melpa.org/packages/")) fill-column #xffff) 3. C-x C-e 4. M-x package-install RET dash RET Installation fails with the following in *Compile-Log*: Compiling file /tmp/tmp.IEFN9nE4Fs/.emacs.d/elpa/dash-20210704.1302/dash.el at Tue Jul 6 00:44:46 2021 Entering directory =E2=80=98/tmp/tmp.IEFN9nE4Fs/.emacs.d/elpa/dash-20210704.1302/=E2=80=99 dash.el:551:1: Error: Invalid regexp: "Invalid content of \\{\\}" The same error occurs post-installation with 'M-x byte-compile-file' on dash.el. Either way, the error confusingly only shows up when Dash is installed from MELPA: package-archives =3D '(("melpa" . "https://melpa.org/packages/")) and not from GNU-devel ELPA: package-archives =3D '(("gnu" . "https://elpa.gnu.org/devel/")) even though both contain identical versions of the file dash.el. So I guess it's some other part of the package .tar that gives rise to the discrepancy. Turning on debug-on-error doesn't give a backtrace, presumably because displaying-byte-compile-warnings or similar demotes errors. But a breakpoint in signal_or_quit reveals that byte-compile--wide-docstring-p constructs an invalid regexp whose repetition exceeds the new (since Emacs 27) RE_DUP_MAX limit of #xffff. Maybe byte-compile--wide-docstring-p should defend itself against this as follows? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Avoid-invalid-regexp-in-wide-docstring-check.patch >From 42de0117547a462ce1f161a3a9cae92fd322e9ec Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 6 Jul 2021 01:05:41 +0100 Subject: [PATCH] Avoid invalid regexp in wide docstring check * lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p): Avoid constructing an invalid regexp during byte-compilation by limiting the number of columns to the current RE_DUP_MAX of 65535. This protects against pathological values of fill-column, for example. --- lisp/emacs-lisp/bytecomp.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 70999648d4..6970c8a505 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1627,7 +1627,7 @@ byte-compile--wide-docstring-p `byte-compile--wide-docstring-substitution-len'. Also ignore URLs." (string-match - (format "^.\\{%s,\\}$" (int-to-string (1+ col))) + (format "^.\\{%d,\\}$" (min (1+ col) #xffff)) ; Heed RE_DUP_MAX. (replace-regexp-in-string (rx (or ;; Ignore some URLs. -- 2.30.2 --=-=-= Content-Type: text/plain Thanks, -- Basil In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars) of 2021-07-05 built on tia Repository revision: 68276f6d30bbdc09cc26fb49d7f0c3aa4bce35f2 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Debian GNU/Linux 11 (bullseye) Configured using: 'configure 'CC=ccache gcc' 'CFLAGS=-Og -ggdb' --config-cache --prefix=/home/blc/.local --enable-checking=structs --with-x-toolkit=lucid --with-file-notification=yes --with-x' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XAW3D XDBE XIM XPM LUCID ZLIB Important settings: value of $LANG: en_IE.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug sendmail warnings compile comint ansi-color ring info find-func easy-mmode autoload radix-tree lisp-mnt tar-mode arc-mode archive-mode cus-edit pp cus-start cus-load wid-edit mm-archive message dired dired-loaddefs rfc822 mml mml-sec epa derived gnus-util rmail rmail-loaddefs text-property-search time-date mailabbrev gmm-utils mailheader mm-decode mm-bodies mm-encode mail-utils gnutls network-stream url-http mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr url-gw nsm rmc puny url-cache url-auth epg epg-config finder-inf package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 243317 18548) (symbols 48 15849 1) (strings 32 83582 1296) (string-bytes 1 2065467) (vectors 16 24463) (vector-slots 8 318902 13721) (floats 8 39 454) (intervals 56 285 0) (buffers 992 15)) --=-=-=--