From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vibhav Pant Newsgroups: gmane.emacs.bugs Subject: bug#60974: 30.0.50; byte-compile-preprocess mutates self evaluating forms in expanded macro bodies Date: Sat, 21 Jan 2023 02:54:05 +0530 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-P76KcDcLHQmkm5YmgCwd" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9441"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.46.3 Cc: monnier@iro.umontreal.ca To: 60974@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 20 22:25:43 2023 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 1pIytK-0002Fb-UA for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Jan 2023 22:25:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIysl-0001gH-N2; Fri, 20 Jan 2023 16:25:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIysg-0001fu-Td for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2023 16:25:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIysg-0006tK-Jx for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2023 16:25:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pIysf-0005Od-Vn; Fri, 20 Jan 2023 16:25:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Vibhav Pant Original-Sender: "Debbugs-submit" Resent-CC: monnier@iro.umontreal.ca, bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2023 21:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60974 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: monnier@iro.umontreal.ca Original-Received: via spool by submit@debbugs.gnu.org id=B.167424986120678 (code B ref -1); Fri, 20 Jan 2023 21:25:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Jan 2023 21:24:21 +0000 Original-Received: from localhost ([127.0.0.1]:47305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIys0-0005NR-G7 for submit@debbugs.gnu.org; Fri, 20 Jan 2023 16:24:20 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:49362) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIyry-0005NK-RJ for submit@debbugs.gnu.org; Fri, 20 Jan 2023 16:24:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIyry-0001ac-H4 for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2023 16:24:18 -0500 Original-Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIyrw-0006ne-M5 for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2023 16:24:18 -0500 Original-Received: by mail-wm1-x335.google.com with SMTP id m5-20020a05600c4f4500b003db03b2559eso4593652wmq.5 for ; Fri, 20 Jan 2023 13:24:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:date:to:from:subject:message-id:from:to:cc :subject:date:message-id:reply-to; bh=Yxn1OoT8J8zbG88RgvcMfWMi2Jk/GZRx2Uz+CAblvqI=; b=YEzlMu4pD+X81LTpYUxngdRL5MQRvhOAOTxGf5jGyxzi0JKAe/0iUbgB0bh2mydsgl NuFchqUQcrmAqLSlyiX5kikd4c5FiBonqfRa5iTfSm7mT1mRb5VtS4BmqgNjFbKjPQXJ d/crw/SH9tWKmhQWU4ta8gb3uCv5TiNvj8oLjaeoEWGUO2EkJQ4FD8sK+BqEhcZqvhiW tABrUSv9+YFYuBeutqYLA/xL54GEoazmnzZBFevw4PKlx1JpF1LPKcgF7TuHtvhV5eZt z4utYxoSRjmCl8rV92y/DBuueafEKOxavEn8oukUCkddWcPymTZs+0t9QChvBqZ0NY/U X3fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:date:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Yxn1OoT8J8zbG88RgvcMfWMi2Jk/GZRx2Uz+CAblvqI=; b=Y770yueYFRtltkRFCUfEqousZYGDBwFVnbc0StOnGfN3hXCw3AzfhO+Bg93cq11iKR rtV+woagxFK2icvzpg2Gzwk487md1SJ8Djezl8CVQObC4JA54ZqUTS97Gjm10qXRpT6J ulJDn1hCVX9HaoE/ETh+c7Yl9nD0kEUrMyUQOM00ebG+0knksPJ5T0psn5DtNNzGrgVi VQvNkLNs0WIlV/S/J6+OVRfPovpMV3GZCtT/AnuX/svLD5kvZAq4H4FaotlTCMg0WkvE +RQw5toCrJfGM2sMVgiZWbcD+AAf25ff1xX0tM3VGprd1Nk3lI1GzHLjE4EjZ1CFk46N 2SJQ== X-Gm-Message-State: AFqh2koqXeyf7QzHv6JuUNHr4aAKo+LPfvfsFPxlCwS/trrJFGkOZyPR xRJHtOCd2KOgUn5A3vJYc3PeejnMiNl7sg== X-Google-Smtp-Source: AMrXdXtw935gr8pluI+T1AqqV9x+1ziGx0/7AruSZZIx80CxCR3ehvdVczC/g2LhoxR/WSaqBZk3EQ== X-Received: by 2002:a05:600c:1e1f:b0:3db:2063:425d with SMTP id ay31-20020a05600c1e1f00b003db2063425dmr7517972wmb.2.1674249854556; Fri, 20 Jan 2023 13:24:14 -0800 (PST) Original-Received: from vibhavp-mbp.local ([182.69.182.193]) by smtp.gmail.com with ESMTPSA id v7-20020a05600c444700b003db06493ee7sm3406226wmn.47.2023.01.20.13.24.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 13:24:13 -0800 (PST) Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=vibhavp@gmail.com; helo=mail-wm1-x335.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-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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:253801 Archived-At: --=-P76KcDcLHQmkm5YmgCwd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable `cconv-closure-convert`, called from `byte-compile-preprocess` calls `setcar` on a self evaluating interactive form as part of the function body. This can be reproduced by adding the following snippet to `lisp/loadup.el`, and building Emacs: ``` (load "emacs-lisp/bytecomp") (setq sample-interactive-spec (purecopy '(interactive (list (if current-prefix-arg (prefix-numeric-value=20 current-prefix-arg) 'toggle))))) (defmacro define-purecopied-func () `(defun foo-bar (arg) ,sample-interactive-spec)) (let ((byte-compile-debug t)) (byte-compile '(define-purecopied-func))) ``` (`purecopy` ensures mutating the list triggers a `pure_write_error`) As mutating quoted/constant lists is undefined behaviour as per the Elisp reference manual (https://www.gnu.org/software/emacs/manual/html_node/elisp/Mutability.htm ), the body returned by `macroexpand-all` should likely be copied using `copy-tree`. In GNU Emacs 30.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, cairo version 1.17.6) of 2023-01-05 built on vibhavp-mbp Repository revision: 15fc7b3cde92e420f48dfe188251e6af4d832af5 Repository branch: master System Description: Arch Linux Configured using: 'configure --with-pgtk --with-sqlite3 --with-native-compilation=3Dyes --with-all --without-compress-install --enable-link-time-optimization -C 'CFLAGS=3D-march=3Dnative -mtune=3Dnative -O3 -g3 -ggdb3 -gdwarf-5'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-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 line-number-mode: t indent-tabs-mode: t transient-mark-mode: (only . t) auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl- loaddefs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-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 nadvice seq simple cl-generic indonesian philippine 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 emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 78180 10230) (symbols 48 7127 0) (strings 32 19480 1383) (string-bytes 1 595292) (vectors 16 16343) (vector-slots 8 326128 14214) (floats 8 28 51) (intervals 56 237 0) (buffers 984 11)) --=-P76KcDcLHQmkm5YmgCwd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEftHUjFE8oCS+Onhf4/soy2q1lZgFAmPLBnUACgkQ4/soy2q1 lZj+OAf9G416O/xWZ/g4lRsUSA4VM6JswitF3WYqCV7wo/NF+OuyWqSp7y0P+AKq NnjhJ33i195B7/WwBjqQdHWf1r/wu/en1hit2MZKs6eFdtWT5r4uHu60CNzxKNkU iMf056XS9jsc3Y6o04cWzojicMMI2USfqd0jif9BBJ8iuEG2kkeNyIoD+RoDV5fi GT0XjEJ87C7uZ1eXth5VVAYgzAYOtxfE2+SU3WuxNsInXMqkm7HJRVlR0NieAuLB 6jdpw7ZmDnSMi7MZA2k2vwcDihs7FiDOEz8w+7T+7Y8ANGxzQCcHOgZnlYLEHChX QM/QtTL3i1sa5hm/VPWPXU8vZhGBaA== =ObXE -----END PGP SIGNATURE----- --=-P76KcDcLHQmkm5YmgCwd--