From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 06 14:27:03 2023 Received: (at submit) by debbugs.gnu.org; 6 Mar 2023 19:27:03 +0000 Received: from localhost ([127.0.0.1]:43670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZGUB-0001LP-AK for submit@debbugs.gnu.org; Mon, 06 Mar 2023 14:27:03 -0500 Received: from lists.gnu.org ([209.51.188.17]:57792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZGU9-0001Kz-3u for submit@debbugs.gnu.org; Mon, 06 Mar 2023 14:27:01 -0500 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 1pZGU6-0003VI-Oc for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2023 14:26:59 -0500 Received: from server.qxqx.de ([2a01:4f8:121:346::180] helo=mail.qxqx.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZGU4-0005zJ-5F for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2023 14:26:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From :Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ApFsH2+SjZZO7stR2Bs4xTFPy4fywFG86CO9KuUMmIY=; b=oWwG+rfF+FjWqCAsmvXFmwptiO M/gnElyVLWsAJwf68WiECN7nvmXk0DYmiAP1p1Hqr7oEV1/ykIOkrlBUG54JesoLBj+NLUflN20HA DmiLD3w4Gj8MUhhC72YU/4LpwgkMp6s51x1gUYMxDGS1MLQWRwFEVBzuU1daKwz2oKsY=; From: Daniel Mendler To: bug-gnu-emacs@gnu.org Subject: 29.0.60; Emacs crashes on setf symbol-name Date: Mon, 06 Mar 2023 20:26:32 +0100 Message-ID: <87o7p5of4n.fsf@daniel-mendler.de> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a01:4f8:121:346::180; envelope-from=mail@daniel-mendler.de; helo=mail.qxqx.de X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Execute the following in the scratch buffer: (setf (aref (symbol-name 'car) 1) ?o) Emacs crashes with a segmentation fault. Is this a well-known issue? I could reproduce the problem on Emacs 27 and 29. Should there be some mechanism to protect the strings of symbols? I found the snippet on reddit: https://old.reddit.com/r/emacs/comments/11ix6yu/ive_found_what_ive_been_looking_for/jb4ah5v/ From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 09:19:47 2023 Received: (at 62009) by debbugs.gnu.org; 7 Mar 2023 14:19:47 +0000 Received: from localhost ([127.0.0.1]:44927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZYAM-0004rF-Qm for submit@debbugs.gnu.org; Tue, 07 Mar 2023 09:19:47 -0500 Received: from netyu.xyz ([152.44.41.246]:53698 helo=mail.netyu.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZYAK-0004r5-KA for 62009@debbugs.gnu.org; Tue, 07 Mar 2023 09:19:45 -0500 Received: from fw.net.yu.netyu.xyz ( [222.248.4.98]) by netyu.xyz (OpenSMTPD) with ESMTPSA id 8ae80f05 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 7 Mar 2023 14:19:42 +0000 (UTC) References: <87o7p5of4n.fsf@daniel-mendler.de> User-agent: mu4e 1.8.14; emacs 30.0.50 From: Ruijie Yu To: Daniel Mendler Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name Date: Tue, 07 Mar 2023 12:40:06 +0800 In-reply-to: <87o7p5of4n.fsf@daniel-mendler.de> Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Daniel Mendler writes: > Execute the following in the scratch buffer: > > (setf (aref (symbol-name 'car) 1) ?o) > > Emacs crashes with a segmentation fault. Is this a well-known issue? I > could reproduce the problem on Ema [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 1.1 DATE_IN_PAST_06_12 Date: is 6 to 12 hours before Received: date 0.0 FROM_SUSPICIOUS_NTLD From abused NTLD X-Debbugs-Envelope-To: 62009 Cc: 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Daniel Mendler writes: > Execute the following in the scratch buffer: > > (setf (aref (symbol-name 'car) 1) ?o) > > Emacs crashes with a segmentation fault. Is this a well-known issue? I > could reproduce the problem on Ema [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 1.1 DATE_IN_PAST_06_12 Date: is 6 to 12 hours before Received: date 0.0 FROM_SUSPICIOUS_NTLD From abused NTLD 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --=-=-= Content-Type: text/plain Daniel Mendler writes: > Execute the following in the scratch buffer: > > (setf (aref (symbol-name 'car) 1) ?o) > > Emacs crashes with a segmentation fault. Is this a well-known issue? I > could reproduce the problem on Emacs 27 and 29. Should there be some > mechanism to protect the strings of symbols? > > I found the snippet on reddit: > https://old.reddit.com/r/emacs/comments/11ix6yu/ive_found_what_ive_been_looking_for/jb4ah5v/ Can't access reddit, but can reproduce in recent master (6fb8a4dff7ef). To test, first put this file under emacs.git/src/: --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=test.el (defun foo (symbol) (message "[1] %S" (symbol-name symbol)) (setf (aref (symbol-name symbol) 1) ?x) (message "[2] %S" (symbol-name symbol))) --=-=-= Content-Type: text/plain $ make; cd src Then do the following for each symbol: - setf - find-file - with-current-buffer - buffer-file-name $ ./emacs -Q -batch -l test.el -eval '(foo (quote setf))' [1] "setf" [2] "sxtf" $ ./emacs -Q -batch -l test.el -eval '(foo (quote find-file))' [1] "find-file" [2] "fxnd-file" And these below below: aref, null, car, cdr, save-current-buffer $ ./emacs -Q -batch -l test.el -eval '(foo (quote aref))' [1] "aref" Fatal error 11: Segmentation fault Backtrace: ... My observation is that symbols "introduced" via C defuns and defmacros exhibit this problem, whereas those introduced via Elisp defuns and defmacros do not. No symbols introduced via defvars exhibit this problem, as shown above with buffer-file-name. Seeing that it is a segfault, maybe the setf is trying to modify readonly memory produced by the C defuns and defmacros? If that is the case, *if* we allow such modifications, we should make the memory readwrite; *otherwise* maybe we should no-op, warn, or err in setf and friends when we see readonly memory blocks? With this collection of GDB commands: --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=debug.gdb set debuginfod enabled off run bt exit --=-=-= Content-Type: text/plain And this GDB command line option: $ gdb -x debug.gdb --batch --args ./emacs -Q -batch -l ../test.el -eval '(foo (quote car))' > car.backtrace I get the backtrace (attached below) for setf + symbol-name + 'car as reported by OP. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=car.backtrace SIGINT is used by the debugger. Are you sure you want to change it? (y or n) [answered Y; input not from terminal] DISPLAY = :0 TERM = xterm-256color Breakpoint 1 at 0x4e2ab: file emacs.c, line 426. Breakpoint 2 at 0x142970: file xterm.c, line 26474. [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. Faset (array=XIL(0x7ffff1d10adc), idx=make_fixnum(1), newelt=make_fixnum(120)) at /opt/src/emacs/base/62009-setf-symbol-name/src/lisp.h:1671 1671 return XSTRING (string)->u.s.data; #0 Faset (array=XIL(0x7ffff1d10adc), idx=make_fixnum(1), newelt=make_fixnum(120)) at /opt/src/emacs/base/62009-setf-symbol-name/src/lisp.h:1671 #1 0x000055555576f431 in eval_sub (form=) at eval.c:2506 #2 0x000055555577132d in Fprogn (body=XIL(0)) at eval.c:436 #3 FletX (args=) at eval.c:958 #4 0x000055555576f198 in eval_sub (form=) at eval.c:2451 #5 0x00005555557701ed in Fprogn (body=XIL(0x7ffff24d25d3)) at eval.c:436 #6 funcall_lambda (fun=, fun@entry=XIL(0x7ffff24d5b13), nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x7fffffffd9e0) at eval.c:3235 #7 0x000055555577095c in apply_lambda (fun=fun@entry=XIL(0x7ffff24d5b13), args=, count=count@entry=...) at eval.c:3105 #8 0x000055555576eea6 in eval_sub (form=form@entry=XIL(0x7ffff24d5cf3)) at eval.c:2590 #9 0x0000555555771a8f in Feval (form=XIL(0x7ffff24d5cf3), lexical=) at eval.c:2363 #10 0x00005555557b5882 in exec_byte_code (fun=, args_template=, nargs=, args=) at bytecode.c:809 #11 0x000055555577095c in apply_lambda (fun=fun@entry=XIL(0x7ffff19dc085), args=, count=count@entry=...) at eval.c:3105 #12 0x000055555576eea6 in eval_sub (form=form@entry=XIL(0x7ffff1e13773)) at eval.c:2590 #13 0x0000555555771a8f in Feval (form=XIL(0x7ffff1e13773), lexical=) at eval.c:2363 #14 0x0000555555769cf7 in internal_condition_case (bfun=bfun@entry=0x5555556da3b0 , handlers=handlers@entry=XIL(0x90), hfun=hfun@entry=0x5555556e1990 ) at eval.c:1474 #15 0x00005555556dad36 in top_level_1 (ignore=ignore@entry=XIL(0)) at keyboard.c:1141 #16 0x0000555555769c51 in internal_catch (tag=tag@entry=XIL(0x103e0), func=func@entry=0x5555556dad10 , arg=arg@entry=XIL(0)) at eval.c:1197 #17 0x00005555556da32f in command_loop () at keyboard.c:1101 #18 0x00005555556e1512 in recursive_edit_1 () at keyboard.c:711 #19 0x00005555556e18a0 in Frecursive_edit () at keyboard.c:794 #20 0x00005555555ab49f in main (argc=7, argv=0x7fffffffe0a8) at emacs.c:2530 Lisp Backtrace: "aset" (0xffffd790) "let*" (0xffffd8c0) "foo" (0xffffd9e0) "eval" (0xf05ff1c0) "command-line-1" (0xf05ff0b8) "command-line" (0xf05ff040) "normal-top-level" (0xffffdbd0) A debugging session is active. Inferior 1 [process 1106482] will be killed. Quit anyway? (y or n) [answered Y; input not from terminal] --=-=-= Content-Type: text/plain HTH. -- Best, RY --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 10:45:47 2023 Received: (at 62009) by debbugs.gnu.org; 7 Mar 2023 15:45:47 +0000 Received: from localhost ([127.0.0.1]:47004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZZVb-0001F6-2L for submit@debbugs.gnu.org; Tue, 07 Mar 2023 10:45:47 -0500 Received: from mout.web.de ([217.72.192.78]:42789) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZZVY-0000xM-Ur for 62009@debbugs.gnu.org; Tue, 07 Mar 2023 10:45:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1678203921; i=michael_heerdegen@web.de; bh=IQar7FuXhP7eGL+vSQIBDPHD3pZP0at3tc9PmPeiI9c=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=LjehA0BJ+2nqG4AcdhgUdu4BdpLijhs09c1Kka+yiEEoPzkTjX5HyE23Is/IwdLGM t3DHBmYuKnEEKr7jEIqomWT7LdMhthKMmE+Wmq2mYqu7EAjsxtFER1SWf2hB4dJaOl bCH+2oQUpQPGa4lRKqCigkFxaPdV+Po4s6JCF0Na2Sm3V6lKVLSvVSODfBoAjK9egl Tjd4dSTYMCNwq48K9vk5yn0preu6k0uPm0PUzXEBmt+75evDeWFA+UqYOevyEEpnjw A+z+g54LmwXMT5cNRClDeusC32jGqCV/gp+KX+r7PbS1+YTLhOZgv2mngkCuA4fEZr 3KF7aE0MMWvGA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([178.14.74.115]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M6YJ1-1pfs5p3vcP-006n0D; Tue, 07 Mar 2023 16:45:20 +0100 From: Michael Heerdegen To: Daniel Mendler Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <87o7p5of4n.fsf@daniel-mendler.de> (Daniel Mendler's message of "Mon, 06 Mar 2023 20:26:32 +0100") References: <87o7p5of4n.fsf@daniel-mendler.de> Date: Tue, 07 Mar 2023 16:45:20 +0100 Message-ID: <871qm01s6n.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:82862vlL2GPIoWuMD9DLoUk0iOzkqFcHFwVXrlZgsAB6WXCQXo/ +hHFV+SY7N0tSmahFZoO6DKdlIRGEkBjWILEl+jAEsz+jNIkEHnoOhVKU9b1UxV9BW7JI90 v+8cle4/ZsASD23kY9UFcp3QmJrAKwtFjW+2uQQ+YtY0oeo2tnRLGSp8oUBKvitXz5+3sNl VkzI+MdC8ap7C42j3Gw5A== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:CzevP43tX+Q=;9vVxntVNl0Uz4bqpwISj5WG9uPt JlGiP1BDuKXChuYoIMMludVcxi1Nt+kPrgKmmeepDumPc4Nf7DOpedMzupiMHiCAhzY9c9vRE ST5x63EhAzCgGgjTvYCpSY1aVCGx0L+lTS2beRbM7A8kJ3UNzaVEwYeGI9Wvdbdsxi1zpiGAt vdXg6do263d+KYnqo08IVekrFFKaiPX1ntpmHcgnFEQ/Yse3gYn1bMNIYYzQduL9nUtulFfbO 338yM/JJqngHMrebM3Vda0u+BslJawy6PWXW4nvthoDSlr1NL4jhL8msikV+3Nz2wEcCjVetf 4ZEdd9G0wzTHLk4vUda/EVBEoItn0ZZLbXV6xHmkq1jD4F4p0GDRCqhahvqrOWXuYagwMnlI4 GZaUWDeVlrN1y+0ggVR71NOBOWoGqbzSUIpjkVH92IEbwLkBCF/IKOlL7wvk6lJ/WdON6jkRO vsm8GnrymyDQetbHDTdL01LjveGtotsBmucJjvmm3o41bF0If1xtd4nMNNqiGKyQfWScnvV/y mYmy+dd5YgHz7AOojlyONjfP5H/u+Jy/6XaZkGTIJiGDz5A3nDLRdMO8k5xNRBxpIC/x9ws9q F/2K//4Pi5avfD3XHi8q0WF/GQ9Kc7q3n132wWugKmYJsL4i9sfiGxlchQ+g/NH9KQpkWB24w Kv78g6jQOz/6Wgei6Kzm5xHPJFHCPtUAJ2odMZWiokddBbxizhduTxus5Rzy9W9cVDX2J8R99 /J7gr2TWFn0u7H8+C/t4pRfHFv6cFJ+jrOg7pVgXb5wrtt5wsbFvEJKafWCPNvfKGQXnI4ehl NwaJv1fRRPWs3/cOL8+WkJwT9tx1LK+XofFaqhftEdLnK8NM4cUCdkf36smohpdx1TL5JjeFp VqxEIryuJo+arP5vtQzUl0uIhO7icMMSejx7AKjk0tpoWr391j7bgm+k2UAV+4KH+Rz7nK/Gz Y2tTbCj+//AW6K3GRETo8GizfYo= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 62009 Cc: 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Daniel Mendler writes: > Execute the following in the scratch buffer: > > (setf (aref (symbol-name 'car) 1) ?o) > > Emacs crashes with a segmentation fault. Is this a well-known issue? I > could reproduce the problem on Emacs 27 and 29. Should there be some > mechanism to protect the strings of symbols? I vaguely remember this has been discussed some time ago, but I don't find a bug report about it. Maybe it had been on emacs-dev. Maybe the outcome was something like that we can't protect everybody in every case from shooting in the own foot, I don't recall. Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 12:08:55 2023 Received: (at 62009) by debbugs.gnu.org; 7 Mar 2023 17:08:56 +0000 Received: from localhost ([127.0.0.1]:47103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZao3-0003oZ-K1 for submit@debbugs.gnu.org; Tue, 07 Mar 2023 12:08:55 -0500 Received: from server.qxqx.de ([178.63.65.180]:39263 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZao1-0003oJ-46 for 62009@debbugs.gnu.org; Tue, 07 Mar 2023 12:08:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=qCoOtqwmp4RuJYbRhDgajB3nwcD4vQq3RMKaoiSWQNw=; b=e7yF3kPhfJB1nYcsg8jYncG4bY G1n02y6Uqu1lS2tgQss19rzedJEYHsGX3dBsh2yFMEHtXD0FtxWd/UsPNBIdR7XT8XXlCxNc8g5Zz igZeCdk+KLHiPcVRT/bOYu74SX/zop6rC9e4oD6JohhYL6qaG8L/dgboQHwvLpPLZlr8=; Message-ID: <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> Date: Tue, 7 Mar 2023 18:08:43 +0100 MIME-Version: 1.0 Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name To: Michael Heerdegen References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> Content-Language: en-US From: Daniel Mendler In-Reply-To: <871qm01s6n.fsf@web.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: Stefan Monnier , 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 3/7/23 16:45, Michael Heerdegen wrote: > Daniel Mendler writes: > >> Execute the following in the scratch buffer: >> >> (setf (aref (symbol-name 'car) 1) ?o) >> >> Emacs crashes with a segmentation fault. Is this a well-known issue? I >> could reproduce the problem on Emacs 27 and 29. Should there be some >> mechanism to protect the strings of symbols? > > Maybe the outcome was something like that we can't protect everybody in > every case from shooting in the own foot, I don't recall. Maybe it would be possible to introduce a flag which marks strings as "frozen"? Then we could ensure that no mutations of such frozen string happen. Freezing strings (vectors or pairs) may be generally useful beyond preventing such issues. Daniel From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 07 12:40:05 2023 Received: (at 62009) by debbugs.gnu.org; 7 Mar 2023 17:40:05 +0000 Received: from localhost ([127.0.0.1]:47134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZbID-0004Zr-Dv for submit@debbugs.gnu.org; Tue, 07 Mar 2023 12:40:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZbIB-0004ZF-Sm for 62009@debbugs.gnu.org; Tue, 07 Mar 2023 12:40:04 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZbI4-0004FP-NW; Tue, 07 Mar 2023 12:39:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=b+P/SDT7Oa+qFe0kRCQggr+uvA4l/Dzh2CG3WUqXEPs=; b=bIB8/Z8AADpW LPmBQGPqGEi3jK6PKVOWG/2p6ZSs6DiEi2jwFQyvldWG9fsnuVNQknkWNPI+zMoskjyFiNBXhXIHF acHRiWZgxX7d3S39H3Z5uwBW/bzLtJozuQLXbHmxOYnF579XUQOUNLwlVmdQcKwWCa9zjbL89BH3i OZmSKe3NkH5P2rq6Vix0Sr8Iw3o9V7+7Z7ux94wuyjk98a0bpn7vBYapn7FbpK2VE7NeUgzC3uaCJ P+Z/aAHIefJ5nIh97NEcwpIwh3MyQ67e9yUztpSWP+0+a1uW5BWjeeHsUoByRI6otxEzjkpOXSBXe PXULhRcvsv/oHdOMJFVnAw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZbI4-0006Ep-2d; Tue, 07 Mar 2023 12:39:56 -0500 Date: Tue, 07 Mar 2023 19:39:51 +0200 Message-Id: <83bkl45ul4.fsf@gnu.org> From: Eli Zaretskii To: Daniel Mendler In-Reply-To: <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> (message from Daniel Mendler on Tue, 7 Mar 2023 18:08:43 +0100) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: michael_heerdegen@web.de, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Stefan Monnier , 62009@debbugs.gnu.org > Date: Tue, 7 Mar 2023 18:08:43 +0100 > From: Daniel Mendler > > On 3/7/23 16:45, Michael Heerdegen wrote: > > Daniel Mendler writes: > > > >> Execute the following in the scratch buffer: > >> > >> (setf (aref (symbol-name 'car) 1) ?o) > >> > >> Emacs crashes with a segmentation fault. Is this a well-known issue? I > >> could reproduce the problem on Emacs 27 and 29. Should there be some > >> mechanism to protect the strings of symbols? > > > > Maybe the outcome was something like that we can't protect everybody in > > every case from shooting in the own foot, I don't recall. > > Maybe it would be possible to introduce a flag which marks strings as > "frozen"? Then we could ensure that no mutations of such frozen string > happen. AFAICT, they _are_ frozen. These names are in read-only memory, where you cannot write. That's why Emacs crashes, AFAIU: the code is trying to write to protected memory. Just don't do that, cause it's gonna hurt... From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 09 16:11:24 2023 Received: (at 62009) by debbugs.gnu.org; 9 Mar 2023 21:11:24 +0000 Received: from localhost ([127.0.0.1]:53207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paNXn-0005dY-Ox for submit@debbugs.gnu.org; Thu, 09 Mar 2023 16:11:24 -0500 Received: from mout01.posteo.de ([185.67.36.65]:54767) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paNXl-0005dK-1t for 62009@debbugs.gnu.org; Thu, 09 Mar 2023 16:11:21 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 898C42401F5 for <62009@debbugs.gnu.org>; Thu, 9 Mar 2023 22:11:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1678396275; bh=OTRXVVUkSa3AyZEiVnO3ik8nOJh+ywgiJbLz8SgyTqY=; h=From:To:Cc:Subject:Date:From; b=pjCnhRFJ/bL4VxXZ5V22MCpNwo/GLpNvG8CKJm5OaQsr/SoBWLaKdagOfTW+7MEEk ZadNFSlHTCbs3xyA3pLxYnemxbH8/hrC/Zm+6bIvqM3GTJp6Y52mhruQrbgHFMxhMw YGcgUa4mENDspBNAjSfzHiLJjk6FLFzlqxcSTPMg6/CKs8CM8toTfo1UIn3lkyj24S tdLQXrznV114aETgkBFtvRo7hkXLDB3TZUxidcoQYkm7WiJa2i0TqJBAdeZ06t1FX+ 7WI1swm2MXKDaFw+TB7z5NNrSvf7lIIeiPVMppt3e4Cp1FgbluxFD5P5T2Jv0xDhY2 s9NwZApDJsJAA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PXhgP67xKz9rxQ; Thu, 9 Mar 2023 22:11:13 +0100 (CET) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <83bkl45ul4.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 07 Mar 2023 19:39:51 +0200") References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> Date: Thu, 09 Mar 2023 21:11:13 +0000 Message-ID: <87v8j9zl3i.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: michael_heerdegen@web.de, Daniel Mendler , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> Cc: Stefan Monnier , 62009@debbugs.gnu.org >> Date: Tue, 7 Mar 2023 18:08:43 +0100 >> From: Daniel Mendler >> >> On 3/7/23 16:45, Michael Heerdegen wrote: >> > Daniel Mendler writes: >> > >> >> Execute the following in the scratch buffer: >> >> >> >> (setf (aref (symbol-name 'car) 1) ?o) >> >> >> >> Emacs crashes with a segmentation fault. Is this a well-known issue? I >> >> could reproduce the problem on Emacs 27 and 29. Should there be some >> >> mechanism to protect the strings of symbols? >> > >> > Maybe the outcome was something like that we can't protect everybody in >> > every case from shooting in the own foot, I don't recall. >> >> Maybe it would be possible to introduce a flag which marks strings as >> "frozen"? Then we could ensure that no mutations of such frozen string >> happen. > > AFAICT, they _are_ frozen. These names are in read-only memory, where > you cannot write. That's why Emacs crashes, AFAIU: the code is trying > to write to protected memory. > > Just don't do that, cause it's gonna hurt... Is it not possible to detect this before the illegal memory access, and raise a signal in Emacs Lisp? -- Philip Kaludercic From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 02:11:32 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 07:11:32 +0000 Received: from localhost ([127.0.0.1]:53532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paWuZ-0005Uw-Nw for submit@debbugs.gnu.org; Fri, 10 Mar 2023 02:11:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paWuX-0005Ui-UK for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 02:11:30 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1paWuR-00019l-Rz; Fri, 10 Mar 2023 02:11:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=7HWhfYNmGeEBxXDOcUmUmtdTUempUT7fQh5EkF5zKiE=; b=aixqg3dwvGd6 akFUX3zMFFTJpdcXFEUiAxzZx7tT/QkdwzQr0Xs5ksMFAzQfBlR++U7YLgr6yUdYdPXhEULYr9jIf V457EXMxZoijNWCACROpAVwDFnS736Ynq1gJyL6u3uXGy4w7D5E9+XPfrN7b7WY0bKANwIN/LdPQF JBjI7UygLovNSg/l9nD0GEXSHB5f2Pj40WS/AIsrKMaGbhzG0uo8IGt+18FIVMC82iaYatXZ+YvGm rFFPF3iVGkshDpp9QncHqHnDNnTiZXXXROPgVJwQDX2xDSc46GcowPgHZwRqNZ/5ClIyPEPk+8uhr 0S/BYyqdQLjQ4LGPwea0xQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1paWuR-0000g2-6D; Fri, 10 Mar 2023 02:11:23 -0500 Date: Fri, 10 Mar 2023 09:11:05 +0200 Message-Id: <83a60l13p2.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <87v8j9zl3i.fsf@posteo.net> (message from Philip Kaludercic on Thu, 09 Mar 2023 21:11:13 +0000) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: michael_heerdegen@web.de, mail@daniel-mendler.de, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philip Kaludercic > Cc: Daniel Mendler , michael_heerdegen@web.de, > monnier@iro.umontreal.ca, 62009@debbugs.gnu.org > Date: Thu, 09 Mar 2023 21:11:13 +0000 > > > AFAICT, they _are_ frozen. These names are in read-only memory, where > > you cannot write. That's why Emacs crashes, AFAIU: the code is trying > > to write to protected memory. > > > > Just don't do that, cause it's gonna hurt... > > Is it not possible to detect this before the illegal memory access, and > raise a signal in Emacs Lisp? It won't be easy, if at all possible. And I'm not sure we even want to do that. What would be the purpose of supporting such a use of Emacs? From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 03:45:21 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 08:45:21 +0000 Received: from localhost ([127.0.0.1]:53659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paYNN-0007py-4V for submit@debbugs.gnu.org; Fri, 10 Mar 2023 03:45:21 -0500 Received: from mail-ed1-f52.google.com ([209.85.208.52]:45902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paYNL-0007pi-Qj for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 03:45:20 -0500 Received: by mail-ed1-f52.google.com with SMTP id cy23so17352949edb.12 for <62009@debbugs.gnu.org>; Fri, 10 Mar 2023 00:45:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678437913; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=eKIyC/tg6LBbTNkzgSmTRdu+SPX8XY8u246q2AM5XGo=; b=TXXiQyVcBSulfHv9Qe0cLbYdNkArQEoGEAHYX+U0Yr9l06Pkg5ffqLyvGlSFhpoWOT z3StAOtrS2SAQYVZ8hQGXSqKBYB+0JiUctahHGz9ZOuXIz/667jeYz7+tSKomwxVkesp rUwCFqD8Ubqu2spSW8Ss5PMQUGxrlwedlW3hTXLmuR5NkmaKuYPKlbgo07dd8fRX4yxc HqeqIr6S1rsqOCUz3PnYOukz2PPs5omCWt6n0iPHlRyzO7K3vbO915IZS2q59mbqKyck iUjqiEHQNUN+louvKTIsz3iPcHYMnTxPiveGUMbv8J6h98uvq6waJtIsq3K+4l74pJ2t zVHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678437913; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=eKIyC/tg6LBbTNkzgSmTRdu+SPX8XY8u246q2AM5XGo=; b=XqDHhzkIU7tcWlBTC3SEDVNppQ8G+allpWwgvrcPLVmQAAjkpPxlBuCwh93d+wyCxg /jCgIXMlNblX2ra+WJHgYgvnJvSY8evyixBZ1Z9mIEmwMLaSthKeLpb6Mduf/EmxMRzk V/cuz04mI6VbJQtA0tFhxInaKGwkI2ZD615qcp+HFyeXvEQ3ZUgelZsY6vTy6wCX6gQB 72YCyHTRKSYIMjO4YFfQcGshgoYfZZGYUPktgqYdwHhsxRaLRHeYHa5MaNDIJPGzkYII Y7BmKXqGAfX7mBMFAtbvyTlZPbxHTmATcR+5nLBMz0ml/e7+bK4aqyUtQmhYHusjwG7b E+9A== X-Gm-Message-State: AO0yUKXxwCFLvlTRB5wsNf65u80uagncoMl+vnjJR0vflOdvrJSpxyyN TbHCAfojpgffghXMkDB99R9OWoPiyAh1zA== X-Google-Smtp-Source: AK7set+k4VyPxOJBfPy/p/H+jazbFnDTmvNsZMAmcEg/5jIp507IajaE5CFh8IHoD0sZuD/w6/+VBg== X-Received: by 2002:a17:907:3f90:b0:878:711d:9310 with SMTP id hr16-20020a1709073f9000b00878711d9310mr27469903ejc.1.1678437913586; Fri, 10 Mar 2023 00:45:13 -0800 (PST) Received: from ars3 ([2a02:8109:8ac0:56d0::8b3a]) by smtp.gmail.com with ESMTPSA id q26-20020a17090676da00b008b69aa62efcsm685413ejn.62.2023.03.10.00.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 00:45:13 -0800 (PST) From: Augusto Stoffel To: Eli Zaretskii Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <83a60l13p2.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 10 Mar 2023 09:11:05 +0200") References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> Date: Fri, 10 Mar 2023 09:45:11 +0100 Message-ID: <87ilf9571k.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62009 Cc: michael_heerdegen@web.de, mail@daniel-mendler.de, Philip Kaludercic , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, 10 Mar 2023 at 09:11, Eli Zaretskii wrote: >> Is it not possible to detect this before the illegal memory access, and >> raise a signal in Emacs Lisp? > > It won't be easy, if at all possible. And I'm not sure we even want > to do that. What would be the purpose of supporting such a use of > Emacs? What is the purpose of supporting mutation of symbol names in general? (aset (symbol-name 'find-file) 1 ?o) (fboundp 'find-file) => nil This one doesn't crash Emacs, but wreaks havoc, maybe in even worse ways. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 03:47:44 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 08:47:44 +0000 Received: from localhost ([127.0.0.1]:53663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paYPg-0007tv-Iu for submit@debbugs.gnu.org; Fri, 10 Mar 2023 03:47:44 -0500 Received: from mail-ed1-f49.google.com ([209.85.208.49]:33448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paYPe-0007tK-1h for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 03:47:43 -0500 Received: by mail-ed1-f49.google.com with SMTP id a25so17665216edb.0 for <62009@debbugs.gnu.org>; Fri, 10 Mar 2023 00:47:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678438056; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=V2CK2T8vr9fmbaecarxwVXiXP+tdt+JZNEKzEMoTLBE=; b=TV73SV9hDzHCqPHmGBjevJqEBc1SdwoRLA4cjNbg5LcKSyA51qdRnhNsAPtbm08w6r +xU7Tr8rejs+vSxzxCMhKlAnk4vWXtU5S5hf9LlEqGJ53UkUpCTKdeBWeVaNTHCKiXX/ U9c9fgSOZK1EMcM5vlX8WgPaU7Wj3hPFpgNld9qlLPEzQoAjL5Aa0CkT/mM8E9JrrPrK vfMK0HRjZWTyWBZnRj/w2hJE2ZXvCTQT9PdHPmAy8AkpTvqo7JA9q+SnVwwbsfsWMzHb g2xEkfsRIR/h1XkPTSfOw6uwUWsJG/b6azjxemXvDbNqa/rWToAeKzGPVXed4jTXM4sP P11w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678438056; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=V2CK2T8vr9fmbaecarxwVXiXP+tdt+JZNEKzEMoTLBE=; b=jsm3MEX3n55DjuGH+ZERox9u8fXRqq5jBHv+JEvNLG7hjnwPdN1bWi7Di+eTp6gl5y YwJsz4T9jgilkSG9aeiUgODr9Q/QbD52chsT8PDGsqIYzemqu1M8rTDu8i9+fHSX9PN8 2g6t6iVY70c0cedGc7zHEyF9pbTDUq9CKILQPK7uCa9Rn6iubLUjWkGDJO56650TXvb8 af7LfCd6a726KAWC3F98uOjDQJ2+pLXPTD5HAIv6Xtd2lOuT5Ro2qEtjuvO0YyHJUUn5 tSGVVp/CpSgra1s2q+Mfak9Q3xqG0YQFV1LBv9GhDVoVjpjBLYviJ/1xcjxBS6slmNuZ 5RsA== X-Gm-Message-State: AO0yUKVRY6sBz6wZrrWtoahk1+8UgKRqSbNg9ipjd6Y39/PWQHVIlnjI po0iLIQZldt/ly8LvE9zvG2hzZ/Mexw14A== X-Google-Smtp-Source: AK7set/zTiOq1N8sGBtPTYuz0yJqs1IH0aW1lQWl7Kon/cPJXU0tWsFvAGY35yiQZEj8CT5kUORg5Q== X-Received: by 2002:a17:906:6b1a:b0:8b1:7ab0:a462 with SMTP id q26-20020a1709066b1a00b008b17ab0a462mr23371597ejr.7.1678438055844; Fri, 10 Mar 2023 00:47:35 -0800 (PST) Received: from ars3 ([2a02:8109:8ac0:56d0::8b3a]) by smtp.gmail.com with ESMTPSA id m21-20020a170906161500b008b17662e1f7sm697049ejd.53.2023.03.10.00.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 00:47:35 -0800 (PST) From: Augusto Stoffel To: Eli Zaretskii Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <87ilf9571k.fsf@gmail.com> (Augusto Stoffel's message of "Fri, 10 Mar 2023 09:45:11 +0100") References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <87ilf9571k.fsf@gmail.com> Date: Fri, 10 Mar 2023 09:47:33 +0100 Message-ID: <87edpx56xm.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62009 Cc: michael_heerdegen@web.de, mail@daniel-mendler.de, Philip Kaludercic , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, 10 Mar 2023 at 09:45, Augusto Stoffel wrote: > On Fri, 10 Mar 2023 at 09:11, Eli Zaretskii wrote: > >>> Is it not possible to detect this before the illegal memory access, and >>> raise a signal in Emacs Lisp? >> >> It won't be easy, if at all possible. And I'm not sure we even want >> to do that. What would be the purpose of supporting such a use of >> Emacs? > > What is the purpose of supporting mutation of symbol names in general? > > (aset (symbol-name 'find-file) 1 ?o) > (fboundp 'find-file) > => nil > > This one doesn't crash Emacs, but wreaks havoc, maybe in even worse > ways. (To clarify, I think this of course should raise a signal.) From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 04:40:35 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 09:40:35 +0000 Received: from localhost ([127.0.0.1]:53709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paZEp-0000rw-99 for submit@debbugs.gnu.org; Fri, 10 Mar 2023 04:40:35 -0500 Received: from heytings.org ([95.142.160.155]:33838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paZEn-0000rm-9F for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 04:40:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1678441231; bh=gXAdIRMCzMmLr53hkpsWcwsOoK76/lHi/c+WkOfYjCM=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=1iLarJM1Y2S4G74D+yolHVijqSjBe0gUFX2vJEvLWH1fZqLvmOsO5d8YF/tLa9ACN H08NtuyzX0DbedV86hD/G27s42Va4FYWcuJ1IepGcD9b4ZGnf+iJ4vw6Tc4+MHeFko hCnlrlFFY0LvJdkLVxSOpcCMpSzpHkymjtVn4DtcFgIAnnHoNssSXIMWZiCoz1UIAL 3MZRCx0OqGr/xZNZ/WiZcvXnfBYEjz4WjSx66JXlqF6Ji1912+AVUyKE06Rz5qWs5V 6+sn+LNX31bK1xUvmbDbvqVvF+NPzEUNtzMGOG8+1w0D+6tfqpmeUx4RlwellSyAWI Mn4gBJ7A0b/Cw== Date: Fri, 10 Mar 2023 09:40:31 +0000 From: Gregory Heytings To: Eli Zaretskii Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <83a60l13p2.fsf@gnu.org> Message-ID: <16ecbe9ea8ba9d39d058@heytings.org> References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 62009 Cc: michael_heerdegen@web.de, mail@daniel-mendler.de, Philip Kaludercic , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>> AFAICT, they _are_ frozen. These names are in read-only memory, where >>> you cannot write. That's why Emacs crashes, AFAIU: the code is trying >>> to write to protected memory. >>> >>> Just don't do that, cause it's gonna hurt... >> >> Is it not possible to detect this before the illegal memory access, and >> raise a signal in Emacs Lisp? > > It won't be easy, if at all possible. And I'm not sure we even want to > do that. What would be the purpose of supporting such a use of Emacs? > Instead of raising a signal, I suggest: diff --git a/src/data.c b/src/data.c index 0f1d881e00b..76867d6787e 100644 --- a/src/data.c +++ b/src/data.c @@ -780,7 +780,7 @@ DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, 1, 0, CHECK_SYMBOL (symbol); name = SYMBOL_NAME (symbol); - return name; + return build_string (SSDATA (name)); } DEFUN ("bare-symbol", Fbare_symbol, Sbare_symbol, 1, 1, 0, From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 05:31:34 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 10:31:34 +0000 Received: from localhost ([127.0.0.1]:53750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paa2A-0002Km-CV for submit@debbugs.gnu.org; Fri, 10 Mar 2023 05:31:34 -0500 Received: from server.qxqx.de ([178.63.65.180]:45569 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paa28-0002KI-AT for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 05:31:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Kh0e4KS/SjdEc0f9tCR+yXKoRd8VG/Pf9eLXIY4YNGE=; b=SamtiodEelkGpsOcPrFR3swiCB rWdMG4vkSKqA5h+/LOwq+AAS/NtxU/PFmfBeaF27lMfYGRg84L2YqoKztCG6ThLE+DRtGdSxt/1dw Qlu1HWa5ibpMMm2UXgInAq6PgXN90PBevzsjGuTa2z0hz7/qgUOacIrs7sCVarMdDq/A=; Message-ID: Date: Fri, 10 Mar 2023 11:31:22 +0100 MIME-Version: 1.0 Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name To: Gregory Heytings , Eli Zaretskii References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> Content-Language: en-US From: Daniel Mendler In-Reply-To: <16ecbe9ea8ba9d39d058@heytings.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: michael_heerdegen@web.de, Philip Kaludercic , Augusto Stoffel , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 3/10/23 10:40, Gregory Heytings wrote: > Instead of raising a signal, I suggest: > > diff --git a/src/data.c b/src/data.c > index 0f1d881e00b..76867d6787e 100644 > --- a/src/data.c > +++ b/src/data.c > @@ -780,7 +780,7 @@ DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, > 1, 0, > > CHECK_SYMBOL (symbol); > name = SYMBOL_NAME (symbol); > - return name; > + return build_string (SSDATA (name)); > } > > DEFUN ("bare-symbol", Fbare_symbol, Sbare_symbol, 1, 1, 0, Creating a string is not a good idea since it will lead to an unacceptably large performance overhead. Raising an exception upon modification would be the best approach. Daniel From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 05:59:08 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 10:59:08 +0000 Received: from localhost ([127.0.0.1]:53795 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paaSp-00036A-Pf for submit@debbugs.gnu.org; Fri, 10 Mar 2023 05:59:08 -0500 Received: from heytings.org ([95.142.160.155]:33946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paaSm-000360-PU for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 05:59:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1678445943; bh=eKzxqHXdVyOcXkCF8K+BvWA9bjF5g82NavgfphwU7ZM=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=b1HzvHq76K+xZDQJc9x3PLGe4i99zL56w5wuUpa1HKLIc5le25cg1d5221QNPo/JB sRvXv7PChZE6pcy0vBZaSkj/q6Sm2Yoz+eUqSoZO6wkVGWLKC/4hRGkGT4CTDK3nGI s/sWowgS9VqFS8+ZnIW3kWHEFj0OpIbO1MbkOt9Yb5zBUjvisIxSs7ma6tH1p2nfzE BQXF80aCHrdjWE6ng7y5E4iTi7UNpdDsFP02/3t4Voao4ETHH5y0AEuwaY6ZFsNjV1 y6YxQaiEBLnvcErwDu0oU58isy5VT4DH1JG2825fBNAkz6JLVkbP6um2RV2M6VrIsq e5f/+RnwxWMgA== Date: Fri, 10 Mar 2023 10:59:03 +0000 From: Gregory Heytings To: Daniel Mendler Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: Message-ID: <16ecbe9ea85b22d008fd@heytings.org> References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 62009 Cc: Philip Kaludercic , michael_heerdegen@web.de, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, Eli Zaretskii , Augusto Stoffel X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > Creating a string is not a good idea since it will lead to an > unacceptably large performance overhead. > Is "symbol-name" a function that is used in performance-critical code? And did you actually measure that performance overhead before concluding that it it "unacceptably large"? According to my measurements, creating a string from a symbol name costs about 100 CPU cycles. > > Raising an exception upon modification would be the best approach. > That would also come with a performance overhead, as there is currently no way to distinguist strings that are used for symbol names from other strings. Not to mention the added complexity in the code. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 06:10:10 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 11:10:10 +0000 Received: from localhost ([127.0.0.1]:53799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paadW-0003NL-KN for submit@debbugs.gnu.org; Fri, 10 Mar 2023 06:10:10 -0500 Received: from server.qxqx.de ([178.63.65.180]:55721 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paadU-0003N4-SJ for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 06:10:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=RW9wvMKL6iZ555hLtij0V/3l014uS/3myP1ojNmJoG0=; b=w5ZQ0W0NwCvKokqpYNaoSU4Qe/ VXcdATlUZUTPzGLz7idjBKHgBRPkL3TsNe/O7pUav2HHfCDNWx1hPOZvKf1/RD7XVmrg7UugPQw4C vhxDZwFXL8vJdKDtIj/N0xdSdGwYvN2T63mKZpMyteBMlaVnXBAqwsQD+ABuPLrkP18M=; Message-ID: <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> Date: Fri, 10 Mar 2023 12:09:59 +0100 MIME-Version: 1.0 Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name To: Gregory Heytings References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> Content-Language: en-US From: Daniel Mendler In-Reply-To: <16ecbe9ea85b22d008fd@heytings.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: Philip Kaludercic , michael_heerdegen@web.de, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, Eli Zaretskii , Augusto Stoffel X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 3/10/23 11:59, Gregory Heytings wrote: > Is "symbol-name" a function that is used in performance-critical code? > And did you actually measure that performance overhead before concluding > that it it "unacceptably large"? According to my measurements, creating a > string from a symbol name costs about 100 CPU cycles. Yes, of course, for example completion. It would add cost all over the place in many packages. Also note the added GC pressure. It is not a good idea to change symbol-name now to allocate strings. >> Raising an exception upon modification would be the best approach. >> > > That would also come with a performance overhead, as there is currently no > way to distinguist strings that are used for symbol names from other > strings. Not to mention the added complexity in the code. One could check if the string is located in read-only memory. Or one could add a flag bit to the string data structure (and possibly to other data structures too). Freezing data structures such that they become read-only is a generally useful feature. There won't be any performance overhead of the check since a branch not taken is fast thanks to the branch predictor. Daniel From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 06:24:05 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 11:24:05 +0000 Received: from localhost ([127.0.0.1]:53832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paaqz-0003mt-0U for submit@debbugs.gnu.org; Fri, 10 Mar 2023 06:24:05 -0500 Received: from mail-ed1-f46.google.com ([209.85.208.46]:43551) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paaqx-0003mJ-9D for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 06:24:03 -0500 Received: by mail-ed1-f46.google.com with SMTP id x3so19021095edb.10 for <62009@debbugs.gnu.org>; Fri, 10 Mar 2023 03:24:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678447437; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S/hKncmTanA2DZZqQd6TizZDScLjczxPvXz/BQhYNR8=; b=pEjrbGepD+UIfAJ5kY+0PIzjPnzPkSu5AhSq400rhyWx/2UbioJruFMgciVfgtp087 QeWtkc738CSilzLF3NuBb/ivF1U+bCVd9gdtI7SjMPE9z6OTJew5FQGjpeSySUl3REN8 Dnx+/myYFgVsy8Pyi3Z5nHIU2s6ip3soIlaqBmddwt5uqDf/WFybMHe9k3B6AU5T8khG T23U3wal3dkg8ckXfrHJU+3xOaKdIhDLdZo62ZDbMGzPnay6YQabtOpG0RE6GLcEjmpo eziVa9cUwInjCFmnX/Vcv9dfSoGTciXlAAPBB/rELsvoXWZop2Ai0H4YMuVQLt+E4Ek8 EvGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678447437; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=S/hKncmTanA2DZZqQd6TizZDScLjczxPvXz/BQhYNR8=; b=5QBQldw/b3m79ciRLE2XHwwrV0yu+5mxL6c5uMsjM/zuqm1NLoPfyetVL4Rh1DFVUh udgFt1x+HXa6gpXF2DMBsuMc0pwByMaurenCS+zke6j0hVpVZ5tUeewB8PLJgWPG1OTT R0n2RQw3fwnbztDoGC8/xQcV6P61F5mbCZGrxIfaKUfmT8kJddB7+Q2nab1IIuNDTYEP zTTXUtirRsflzgett5mNa5UX74Y7TBsHx2DppEn2pQs//2XewcckNF+hOxt7JpQBGw7f o7ct0ExBjMQxCfLO6vnoTo5mWoyZF0XAKCsx5tF+u7ytG5USiIG6x9yzHSRDT5CMrNWl HAOw== X-Gm-Message-State: AO0yUKV8y4sPvFPRge9XiWaRf7Ee4mgHzwgppIMz7nmsB330rGhjul7o cgwMVtvbexiIWaViPaCrEDSF3BwpEaf8xA== X-Google-Smtp-Source: AK7set8FuOZ1vxgvFdKwvcRu9hCcd/ydDVY2RuMTpzZBVTpXi+YGrTIEQEGD5ZQc3XHXaWtCbi89Nw== X-Received: by 2002:a17:906:398a:b0:88d:d700:fe15 with SMTP id h10-20020a170906398a00b0088dd700fe15mr25273399eje.0.1678447436810; Fri, 10 Mar 2023 03:23:56 -0800 (PST) Received: from ars3 ([2a02:8109:8ac0:56d0::8b3a]) by smtp.gmail.com with ESMTPSA id qc18-20020a170906d8b200b008d9c518a318sm852805ejb.142.2023.03.10.03.23.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 03:23:56 -0800 (PST) From: Augusto Stoffel To: Daniel Mendler Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> (Daniel Mendler's message of "Fri, 10 Mar 2023 12:09:59 +0100") References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> Date: Fri, 10 Mar 2023 12:23:54 +0100 Message-ID: <87v8j84zp1.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62009 Cc: Philip Kaludercic , michael_heerdegen@web.de, Gregory Heytings , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, 10 Mar 2023 at 12:09, Daniel Mendler wrote: > On 3/10/23 11:59, Gregory Heytings wrote: >> That would also come with a performance overhead, as there is currently = no=20 >> way to distinguist strings that are used for symbol names from other=20 >> strings. Not to mention the added complexity in the code. > > One could check if the string is located in read-only memory. Or one > could add a flag bit to the string data structure (and possibly to other > data structures too). Freezing data structures such that they become > read-only is a generally useful feature. There won't be any performance > overhead of the check since a branch not taken is fast thanks to the > branch predictor. Note also that in-place modification of strings is arbitrarily costly, cf. (aset "ascii" 0 ?=F0=9F=98=BC). Not to mention that it's rarely a good= or necessary move to make, as far as programming style is concerned. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 06:30:59 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 11:30:59 +0000 Received: from localhost ([127.0.0.1]:53846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paaxf-0004CB-3s for submit@debbugs.gnu.org; Fri, 10 Mar 2023 06:30:59 -0500 Received: from mail-wr1-f41.google.com ([209.85.221.41]:47082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paaxb-0004Bw-RF for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 06:30:58 -0500 Received: by mail-wr1-f41.google.com with SMTP id bw19so4702419wrb.13 for <62009@debbugs.gnu.org>; Fri, 10 Mar 2023 03:30:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678447850; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=LKRB7/twUIIQLZCOIZWS0GZt6C1dC5i/lt9hkVdcGj0=; b=gK2kx2mqo/1KSeVa5iygzuLkJ9IAzDTVVT7qemg51/aPbce09uuOOk0EcTJW8vVk41 PMiCOhM5Ysk3r5TvUAUVRYMYM8Wmd/R6haEi10ha/m5CAyVjgZoXw5LYPke13Jwi2cHh hRTs6X6a4b2wohjWkFUiozhWyFkBJnWQa83HzvG20vUKzU7CukZzQdmG7Vrr+R5flARf LcZvrkN/tbenRdXBUz9mcSAyGqk5CNLiHCtuaDjgBL6Rial/oMKNIS/HHdj63KBLrx0I Qry3FXXLoH5JD4OHlMmX6zQKID9OVLjqnj0SI7XGiT3+UrSgKAyVO+kGioMQXGqafafj WwEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678447850; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LKRB7/twUIIQLZCOIZWS0GZt6C1dC5i/lt9hkVdcGj0=; b=dIfX7LS6+Lb17WO3f0/ZFUqgMzRfD/h5vSBhJmgsAuYenwnl69akXCsdMaxof/4TKI L2I7uvQxlYmhtioktUhum+eagxZ97yUTxWoCBeaJOpLm0Al7+dqKCoNeAfVmEFHzlrtk y8quta36Sgll4aHFNqZPgze8paYtzdP5rcMOG/nmgS2yDWDjrlJfLQZUFeOU64dN4Rtm RkRGzwrjXoLYDDJcbY3mxVUiBZh+4rObU1VohVNyC17Czc8smcUYe2MURn99Da2XHy48 wWkou0TDds/J6bxMjkKGR2cl5tPYK/UMUVtZk09EZfV6Egynz+2QyLY/LJWufAojwsl+ Se+A== X-Gm-Message-State: AO0yUKVurs6sjMQIn7EssNYU/CyQI5mgm2WX8Uk3CN0lSmWQ1Pd5epxO rOxKDe9qopL0p3t8owvakHg= X-Google-Smtp-Source: AK7set/VQkm3DJR4ODbo2cYAgMpoth0lLVKXSbQjXAShElG9BNBZS9h6Z+i0HL8lDKJAhWO1agWoRQ== X-Received: by 2002:a5d:66ce:0:b0:2c7:8f73:7700 with SMTP id k14-20020a5d66ce000000b002c78f737700mr16785711wrw.39.1678447849607; Fri, 10 Mar 2023 03:30:49 -0800 (PST) Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id y12-20020adffa4c000000b002c5706f7c6dsm1937152wrr.94.2023.03.10.03.30.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 03:30:49 -0800 (PST) From: Robert Pluim To: Daniel Mendler Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> (Daniel Mendler's message of "Fri, 10 Mar 2023 12:09:59 +0100") References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> Date: Fri, 10 Mar 2023 12:30:48 +0100 Message-ID: <87fsacx2qf.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62009 Cc: Philip Kaludercic , michael_heerdegen@web.de, Gregory Heytings , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, Eli Zaretskii , Augusto Stoffel X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Fri, 10 Mar 2023 12:09:59 +0100, Daniel Mendler said: Daniel> One could check if the string is located in read-only memory. Or one Daniel> could add a flag bit to the string data structure (and possibly to other Daniel> data structures too). Freezing data structures such that they become Daniel> read-only is a generally useful feature. There won't be any performance Daniel> overhead of the check since a branch not taken is fast thanks to the Daniel> branch predictor. We already have such a flag: /* Number of characters in string; MSB is used as the mark bit. */ ptrdiff_t size; /* If nonnegative, number of bytes in the string (which is multibyte). If negative, the string is unibyte: -1 for data normally allocated -2 for data in rodata (C string constants) -3 for data that must be immovable (used for bytecode) */ ptrdiff_t size_byte; Try this: diff --git a/src/lisp.h b/src/lisp.h index 1276285e2f2..80bbb047824 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1685,6 +1685,8 @@ SREF (Lisp_Object string, ptrdiff_t index) INLINE void SSET (Lisp_Object string, ptrdiff_t index, unsigned char new) { + if (XSTRING (string)->u.s.size_byte == -2) + Fsignal (Qsetting_constant, string); SDATA (string)[index] = new; } INLINE ptrdiff_t Robert -- From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 06:36:29 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 11:36:29 +0000 Received: from localhost ([127.0.0.1]:53864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pab2z-0004OT-28 for submit@debbugs.gnu.org; Fri, 10 Mar 2023 06:36:29 -0500 Received: from server.qxqx.de ([178.63.65.180]:53847 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pab2x-0004O8-70 for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 06:36:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=GnYHqRI1SDwqJyNelNdWFM55hN+/qbDqWXuNGeo1ZOc=; b=JQhizzC/Bg4432u8VUZDLtz5Vv vgZHp5vvhRgOCDm6ek1WUZidsjnaUFe5vUDI6CtL1JQpYXkh3xaquNNCemOFU4NowfAjATl9Fj+92 yVoNoTz78SYy7Y8ipBr4TpJ45qKcL91qATgSGdNbP+65uv4GYwAo8IEldVsTK46n4S3o=; Message-ID: <3a9f613f-baa9-2c48-f779-aaf43363a865@daniel-mendler.de> Date: Fri, 10 Mar 2023 12:36:17 +0100 MIME-Version: 1.0 Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name Content-Language: en-US To: Robert Pluim References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> <87fsacx2qf.fsf@gmail.com> From: Daniel Mendler In-Reply-To: <87fsacx2qf.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: Philip Kaludercic , michael_heerdegen@web.de, Gregory Heytings , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, Eli Zaretskii , Augusto Stoffel X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 3/10/23 12:30, Robert Pluim wrote: >>>>>> On Fri, 10 Mar 2023 12:09:59 +0100, Daniel Mendler said: > > Daniel> One could check if the string is located in read-only memory. Or one > Daniel> could add a flag bit to the string data structure (and possibly to other > Daniel> data structures too). Freezing data structures such that they become > Daniel> read-only is a generally useful feature. There won't be any performance > Daniel> overhead of the check since a branch not taken is fast thanks to the > Daniel> branch predictor. > > We already have such a flag: > > /* Number of characters in string; MSB is used as the mark bit. */ > ptrdiff_t size; > /* If nonnegative, number of bytes in the string (which is multibyte). > If negative, the string is unibyte: > -1 for data normally allocated > -2 for data in rodata (C string constants) > -3 for data that must be immovable (used for bytecode) */ > ptrdiff_t size_byte; Thanks! That's good. Given that a read only flag already exists, it is easy to fix the issue. We just have to make sure that the size is negative for the symbol names and add a check in `aset`. Daniel From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 06:49:32 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 11:49:32 +0000 Received: from localhost ([127.0.0.1]:53882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabFc-0004sW-3e for submit@debbugs.gnu.org; Fri, 10 Mar 2023 06:49:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:32990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabFa-0004sF-Dr for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 06:49:30 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pabFT-0006ma-Og; Fri, 10 Mar 2023 06:49:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=2t1X6GvDj2QV49uwcTjHTFv48CO4HBs9UjwU/h1KEtI=; b=l56Re7/u9kVZ qFs6fxaqRHHrq26JJNa4YzQpXcAsBwKza0ljatXFptou0s8Z9AHcwNUdDQfmmTftClkAL7QwOU7GQ ja/tDZJHayT2urKA0CSivYX2eA+kOnbUSaGOOL0blzkVBeDOj6CP453hXLAkcxIkivHc1zyR4z75q jnH9ytRKcDWTTIlSgX0o4M5B3a/clc37M/0gfGmbx8N/Zbqk1be8wcb7MbexXYbsQVTY+6cJaxG1+ L1hUtJa5jpYHdfywRQxT+Kqs7p7lYdF5lyClJcQL3ktFVBjRupoiY11s7HorFwbG8Mpx8aQ2uv/JZ 0/PHewDuC79nF7urKGP2fA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pabFT-00020N-7E; Fri, 10 Mar 2023 06:49:23 -0500 Date: Fri, 10 Mar 2023 13:49:04 +0200 Message-Id: <83y1o4zv0v.fsf@gnu.org> From: Eli Zaretskii To: Augusto Stoffel In-Reply-To: <87ilf9571k.fsf@gmail.com> (message from Augusto Stoffel on Fri, 10 Mar 2023 09:45:11 +0100) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <87ilf9571k.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: michael_heerdegen@web.de, mail@daniel-mendler.de, philipk@posteo.net, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Augusto Stoffel > Cc: Philip Kaludercic , michael_heerdegen@web.de, > mail@daniel-mendler.de, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org > Date: Fri, 10 Mar 2023 09:45:11 +0100 > > On Fri, 10 Mar 2023 at 09:11, Eli Zaretskii wrote: > > >> Is it not possible to detect this before the illegal memory access, and > >> raise a signal in Emacs Lisp? > > > > It won't be easy, if at all possible. And I'm not sure we even want > > to do that. What would be the purpose of supporting such a use of > > Emacs? > > What is the purpose of supporting mutation of symbol names in general? We don't. Whoever does this is on their own. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 06:50:53 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 11:50:54 +0000 Received: from localhost ([127.0.0.1]:53888 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabGv-0004vM-HZ for submit@debbugs.gnu.org; Fri, 10 Mar 2023 06:50:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabGt-0004v9-Uo for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 06:50:52 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pabGo-0007IA-DP; Fri, 10 Mar 2023 06:50:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=B1HDLo80qcOktVGj1UKF/mhiP/HGWZ/a0MZyqG0oiis=; b=qEL7Y0OdCPQW /3unPzXW632tcH9x6qN+l/HDqOMKuLAy5qDEh6wgRPSVZKOHEzuQuTonQY+c50ZW4ydEuUnfh7hdg 5RcxF0HmiOszTP4XgAiBki/K8CjfklogIlXhGFjMMvef8nBqLxkMz4k/0uhCP9mxubQyVwE3/DG6p zp5NN5ZpYRb0cZ8u4A3hd6XDI2LhqNdcw4+y0E8ZxLZFsPoUY2r9A9COg8+29kriqcFU19Jf8i5JF 4ZLiO4QcVz4kNWWkM1JjbSQ4xMVhWMkOkwkoREm/aVkkFZyQ2K7DqMwc3jVDD84PY+5nJcQfIvODc VKanJNxBwQE6dHY0OGAuWQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pabGj-0002FN-J7; Fri, 10 Mar 2023 06:50:45 -0500 Date: Fri, 10 Mar 2023 13:50:24 +0200 Message-Id: <83wn3ozuyn.fsf@gnu.org> From: Eli Zaretskii To: Augusto Stoffel In-Reply-To: <87edpx56xm.fsf@gmail.com> (message from Augusto Stoffel on Fri, 10 Mar 2023 09:47:33 +0100) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <87ilf9571k.fsf@gmail.com> <87edpx56xm.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: michael_heerdegen@web.de, mail@daniel-mendler.de, philipk@posteo.net, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Augusto Stoffel > Cc: Philip Kaludercic , michael_heerdegen@web.de, > mail@daniel-mendler.de, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org > Date: Fri, 10 Mar 2023 09:47:33 +0100 > > On Fri, 10 Mar 2023 at 09:45, Augusto Stoffel wrote: > > > On Fri, 10 Mar 2023 at 09:11, Eli Zaretskii wrote: > > > >>> Is it not possible to detect this before the illegal memory access, and > >>> raise a signal in Emacs Lisp? > >> > >> It won't be easy, if at all possible. And I'm not sure we even want > >> to do that. What would be the purpose of supporting such a use of > >> Emacs? > > > > What is the purpose of supporting mutation of symbol names in general? > > > > (aset (symbol-name 'find-file) 1 ?o) > > (fboundp 'find-file) > > => nil > > > > This one doesn't crash Emacs, but wreaks havoc, maybe in even worse > > ways. > > (To clarify, I think this of course should raise a signal.) Why bother? Emacs is not in the business of preventing Lisp programmers from shooting themselves in the foot, certainly not when that incurs runtime overhead, even a small one. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 06:53:56 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 11:53:56 +0000 Received: from localhost ([127.0.0.1]:53894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabJs-00051L-5u for submit@debbugs.gnu.org; Fri, 10 Mar 2023 06:53:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49262) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabJq-000513-PQ for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 06:53:55 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pabJl-0007nd-E5; Fri, 10 Mar 2023 06:53:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=TJQNXvdVYwB/4dP35p3VJjea35FxnuNyraErWyWSKiQ=; b=I9G7AFwKEvgW yD4l/P7yvToUDdwIFGEw7yGSuASHVJzp7baXTValXv6eYvjegAs1fy11SjmpnHLlMojc4EfiVG3Gw CvR6hFv314b9ZvXItNxnE63tG2erGSYNu8mtKUreUKf9aug95jp0iBTkBNFwkTIqnOYF27j/DKnVN YlwPSRbHSdNcdwRcrFXzJq1YCYfrAUOQhb/p2G8YktPayRucsrfwOf8SR5I0X02NaMVC8YASzzVHt 4zlXFgnTXOc1GMZZkf4M9YNjnF5U5DGaq1bXsOjfA3O8/BADpL97Fnew37YUI7InPLsDFA63/hhbb IJqCDBqMCIGohj2sYsctzA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pabJk-0002gN-Pd; Fri, 10 Mar 2023 06:53:49 -0500 Date: Fri, 10 Mar 2023 13:53:28 +0200 Message-Id: <83v8j8zutj.fsf@gnu.org> From: Eli Zaretskii To: Gregory Heytings In-Reply-To: <16ecbe9ea8ba9d39d058@heytings.org> (message from Gregory Heytings on Fri, 10 Mar 2023 09:40:31 +0000) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: michael_heerdegen@web.de, mail@daniel-mendler.de, philipk@posteo.net, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 10 Mar 2023 09:40:31 +0000 > From: Gregory Heytings > cc: Philip Kaludercic , michael_heerdegen@web.de, > mail@daniel-mendler.de, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org > > > Instead of raising a signal, I suggest: > > diff --git a/src/data.c b/src/data.c > index 0f1d881e00b..76867d6787e 100644 > --- a/src/data.c > +++ b/src/data.c > @@ -780,7 +780,7 @@ DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, > 1, 0, > > CHECK_SYMBOL (symbol); > name = SYMBOL_NAME (symbol); > - return name; > + return build_string (SSDATA (name)); > } > > DEFUN ("bare-symbol", Fbare_symbol, Sbare_symbol, 1, 1, 0, No, we will NOT increase GC pressure in Emacs just because someone could do a silly and nonsensical thing. No way. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 06:57:46 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 11:57:46 +0000 Received: from localhost ([127.0.0.1]:53903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabNa-00058g-67 for submit@debbugs.gnu.org; Fri, 10 Mar 2023 06:57:46 -0500 Received: from heytings.org ([95.142.160.155]:34062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabNY-00058Y-L9 for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 06:57:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1678449463; bh=cIIan/0C4PVWB+EtfiDUaK8BwjHHnavUgYXoii8dSpM=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=gbxON/Ql2gcATBPKZgGclvL+y5dVMCibTeopec5SpjpxiZM24RPwuSQiWWdXsyZPm HU6f2QoswDNVO0s7TOAadmU99wCA6xlz+IJtA8wIzcGOrKiZRZgdSZXebIN2jw8/qa +R+Z/f3+nqNvRBvk5wSGaSRJTeuFUcLRT3F3CAKkPlyfXhHm9NbzA448WII5NwYuio uxMWaqXHTyaq5euA+eQBgLE3atk2VlwB+e+pnjfws8AzplS+6/R8QS3+8IBR4E3lDa 4+GvytWh04ZTPb6G6uNEXKRhRV3KFpnli6/rgviPIbKfGcBdla7DVXxgQDtVgGIQs7 WyiKL3EfCMFNw== Date: Fri, 10 Mar 2023 11:57:43 +0000 From: Gregory Heytings To: Robert Pluim Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <87fsacx2qf.fsf@gmail.com> Message-ID: <16ecbe9ea8d500fa1a07@heytings.org> References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> <87fsacx2qf.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 62009 Cc: Philip Kaludercic , michael_heerdegen@web.de, Daniel Mendler , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, Eli Zaretskii , Augusto Stoffel X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > diff --git a/src/lisp.h b/src/lisp.h > index 1276285e2f2..80bbb047824 100644 > --- a/src/lisp.h > +++ b/src/lisp.h > @@ -1685,6 +1685,8 @@ SREF (Lisp_Object string, ptrdiff_t index) > INLINE void > SSET (Lisp_Object string, ptrdiff_t index, unsigned char new) > { > + if (XSTRING (string)->u.s.size_byte == -2) > + Fsignal (Qsetting_constant, string); > SDATA (string)[index] = new; > } > INLINE ptrdiff_t > That flag is useful only for the first part of the bug: setting the symbol name of a function defined in C. It does not prevent changing symbol names in general, e.g. (aset (symbol-name 'find-file) 1 ?o). From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 06:59:57 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 11:59:58 +0000 Received: from localhost ([127.0.0.1]:53909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabPh-0005D0-Ma for submit@debbugs.gnu.org; Fri, 10 Mar 2023 06:59:57 -0500 Received: from heytings.org ([95.142.160.155]:34082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabPg-0005Co-1D for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 06:59:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1678449595; bh=ZSzS8OI8cKLhZefvn0uCNvCnkmCij2kh0dlB8Cd2SUY=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=7DL72jzCoN2NPztbMeWKNX3W84qXzTasdehfKRqybxMauyGwM3ngz+GT1Qdu3GU+Q 3TQUNnqsMNsmU6D4VTI/AGYdVIYM1KsYFBSww6M7fE7tftRNumrOii44UVT32Jx/4u VIW00Zu66DXBcTewNbsryS3S8O6xnc/RIQBLTUguJFVQCclRyNi3cuXAksxSdEIeMm 3V5fAG/VsRyiL7PGUO1Np57UQD6ZLnLEG2cRv/AefyC5yzH6D2R3IEyQMRnUn34jZT ps2fZW4bk4F/v1cisEPMKF1eLU5P/gDY4JnKfBQ8VxAJx5H8nDOVvDIXTDLLZOFQWa cXIFdEeScY4aA== Date: Fri, 10 Mar 2023 11:59:54 +0000 From: Gregory Heytings To: Eli Zaretskii Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <83v8j8zutj.fsf@gnu.org> Message-ID: <16ecbe9ea800de5b4089@heytings.org> References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <83v8j8zutj.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 62009 Cc: michael_heerdegen@web.de, mail@daniel-mendler.de, philipk@posteo.net, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > No, we will NOT increase GC pressure in Emacs just because someone could > do a silly and nonsensical thing. No way. > I agree with you that this is not really a bug, so doing nothing is fine for me, too. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 06:59:58 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 11:59:58 +0000 Received: from localhost ([127.0.0.1]:53911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabPh-0005D3-U8 for submit@debbugs.gnu.org; Fri, 10 Mar 2023 06:59:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabPg-0005Cg-K9 for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 06:59:57 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pabPa-0000On-Jn; Fri, 10 Mar 2023 06:59:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3dbOtZE0CcsU/n1JSEqulQf/qLsEWvxe3jt03Lkmw98=; b=X6UoKWf0GLjb YM8N4fbmGMjf0BGlSudXqjz+sn1P1piZDKmxCd8kOsCEim4WgZYIFk/pTvf/w6TRhE8pQANIK11yI idmTL7OYk4NdJtmQlPs1McyJDyIId9FUX289bFXbUae/n8xHKMobGbjexukLwQXFxO2TJqMmyD0VC 9tevgIOXdDTlu39Tgoy+xlZhalGE1NiTRYuQ8LWhLriTQAYLua/4nszCVUCGGK2vO3NNJLW4fbg/H M1/cMxDXyHvttSNp/J6/TQR6NplYKwvxd2HhAC91D/JVTBiUP0XaR28+okJ7X+XA0KUN3lJsVaY9W /jDjYnkt/+ygr3QOUGhF9A==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pabPY-000848-V1; Fri, 10 Mar 2023 06:59:50 -0500 Date: Fri, 10 Mar 2023 13:59:28 +0200 Message-Id: <83sfeczujj.fsf@gnu.org> From: Eli Zaretskii To: Gregory Heytings In-Reply-To: <16ecbe9ea85b22d008fd@heytings.org> (message from Gregory Heytings on Fri, 10 Mar 2023 10:59:03 +0000) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, mail@daniel-mendler.de, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 10 Mar 2023 10:59:03 +0000 > From: Gregory Heytings > cc: Eli Zaretskii , Philip Kaludercic , > michael_heerdegen@web.de, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, > Augusto Stoffel > > > Creating a string is not a good idea since it will lead to an > > unacceptably large performance overhead. > > Is "symbol-name" a function that is used in performance-critical code? Yes, it is. Just grep for it. We even call it from C quite a few times. And processing is just one aspect of that; memory and GC is another, not less important. > And did you actually measure that performance overhead before concluding > that it it "unacceptably large"? Anything greater than zero is unacceptably large from where I stand, when the other side of the balance is the use case against which this protects. > > Raising an exception upon modification would be the best approach. > > That would also come with a performance overhead, as there is currently no > way to distinguist strings that are used for symbol names from other > strings. Not to mention the added complexity in the code. Which is why we should do neither. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 07:00:45 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 12:00:46 +0000 Received: from localhost ([127.0.0.1]:53916 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabQT-0005GV-KO for submit@debbugs.gnu.org; Fri, 10 Mar 2023 07:00:45 -0500 Received: from server.qxqx.de ([178.63.65.180]:49465 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabQQ-0005GD-Sz for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 07:00:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Mk+E0wiRRNAzd3G290ADo1Z4FbXBwp1p3zDiR/nKCZo=; b=FtBlrWS8GM5fnNbpgyScipkJVu H3UUreG4Iwf46OHfpgprWL4X7rdjs3nRYJYPsguGiAFqDmbdMtafyqAMidDDFA6KnCVYJGXOiUr9w Psrx8WspHbanM0VPYuxQUwpP1ccKF3jB8B45g+B2De9T8qOgHjeYicqiLxFLVUYSf76k=; Message-ID: Date: Fri, 10 Mar 2023 13:00:34 +0100 MIME-Version: 1.0 Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name To: Eli Zaretskii References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <87ilf9571k.fsf@gmail.com> <87edpx56xm.fsf@gmail.com> <83wn3ozuyn.fsf@gnu.org> Content-Language: en-US From: Daniel Mendler In-Reply-To: <83wn3ozuyn.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, Robert Pluim , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, Augusto Stoffel X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 3/10/23 12:50, Eli Zaretskii wrote: > Why bother? Emacs is not in the business of preventing Lisp > programmers from shooting themselves in the foot, certainly not when > that incurs runtime overhead, even a small one. Of course Elisp is in the business of preventing programmers from shooting themselves in the foot, otherwise we would extend Emacs in C. It is not only that Elisp is easier to write thanks to macros and other conveniences, but also because it is safer! I fully agree with you that we should not introduce a performance regression, in particular not one which increases GC pressure badly. Furthermore I agree that this is a minor bug which only occurs as an edge case when some specific strings are mutated. However the cost of fixing this bug is minor, since Elisp already supports read-only data stuctures as pointed out by Robert. We may only need an additional check in aset which won't introduce significant costs thanks to the branch predictor of CPUs. As Augusto pointed out, aset on strings can already be very costly because the string must be reallocated. In comparison, the additional check will be free. Daniel From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 07:10:07 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 12:10:07 +0000 Received: from localhost ([127.0.0.1]:53946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabZX-0005Z4-FF for submit@debbugs.gnu.org; Fri, 10 Mar 2023 07:10:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabZV-0005Xu-E6 for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 07:10:06 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pabZP-0003XU-Bp; Fri, 10 Mar 2023 07:09:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=QNPwb3hS4u60incqkxSCtOp+/TwTOjyKvBbRH3hx8Tw=; b=IbX0aVOp5MPOLST13ucl gL1UNiN+7aVfPcFcmkiLjvBI0RQj+I9MxNMwSFEFthLZfLNEGPDbz3xQhCanhumh6BbvqOckY4o4R q2742w0gb9/unUpuHbJFF/2ss9G822CIDqrYWy0ALkY9RtR3qKspp8HPELbew2lSKi4X1yk0BPC7g Ox7gk5UsGgb9w4LtQOs1t1g1kYZxINuqOlxtEx5eoFjzE9/7A3oOZrc9+UcdLVJd+B37gpFur2snl 6f4s2R+aTUORAhdf0oK5kWv7l7vpao4286VLXhhC4sJp30N9+lKl3vqT3/ZhrPIbKlitANy4fbI7Q HYYBfGpiYlYyYQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pabZO-0008De-ST; Fri, 10 Mar 2023 07:09:59 -0500 Date: Fri, 10 Mar 2023 14:09:41 +0200 Message-Id: <83pm9gzu2i.fsf@gnu.org> From: Eli Zaretskii To: Augusto Stoffel In-Reply-To: <87v8j84zp1.fsf@gmail.com> (message from Augusto Stoffel on Fri, 10 Mar 2023 12:23:54 +0100) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> <87v8j84zp1.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, mail@daniel-mendler.de, gregory@heytings.org, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Augusto Stoffel > Cc: Gregory Heytings , Eli Zaretskii , > Philip Kaludercic , michael_heerdegen@web.de, > monnier@iro.umontreal.ca, 62009@debbugs.gnu.org > Date: Fri, 10 Mar 2023 12:23:54 +0100 > > On Fri, 10 Mar 2023 at 12:09, Daniel Mendler wrote: > > > On 3/10/23 11:59, Gregory Heytings wrote: > >> That would also come with a performance overhead, as there is currently no > >> way to distinguist strings that are used for symbol names from other > >> strings. Not to mention the added complexity in the code. > > > > One could check if the string is located in read-only memory. Or one > > could add a flag bit to the string data structure (and possibly to other > > data structures too). Freezing data structures such that they become > > read-only is a generally useful feature. There won't be any performance > > overhead of the check since a branch not taken is fast thanks to the > > branch predictor. > > Note also that in-place modification of strings is arbitrarily costly, > cf. (aset "ascii" 0 ?😼). Not to mention that it's rarely a good or > necessary move to make, as far as programming style is concerned. Be this tru as it may, we will not constrain what Lisp programs can legitimately do just because we think it is "rarely a good move". That's against our long-time policy, which is explain why something might not be a good idea, but otherwise don't block that, letting the unwise cope with the consequences of their unwise actions. IOW, we encourage Lisp programmers to DTRT and not use dangerous practices, but don't block them if they want to. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 07:12:52 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 12:12:52 +0000 Received: from localhost ([127.0.0.1]:53952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabcC-0005d2-2N for submit@debbugs.gnu.org; Fri, 10 Mar 2023 07:12:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabcA-0005cp-9p for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 07:12:50 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pabc4-0004Ua-1h; Fri, 10 Mar 2023 07:12:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=QNBzr8UrA8UnEQ9S0NUSEexUZaZGH1x9eP/tvtzkgJ0=; b=lnsM9ZUkCv6C hVg4UXE6QbWUTtdiGu/wm1bHiKOJ+Ci7NmV6LI7Msion8wCemu0PFp7RQ3o0HwLpuGaGgyGcOv7Ty bf1RHq5SxPJivXAif6G1Is7AUG4oHcTNI0rRUHwQKOFRK6moL7WGq5zXw+0NiOiqW8SLSkOJ4AeNZ cfx86ZmkMv890x92dCEBED7IxOo44IwNZuU7YuRz5fWUYO09xqjNnOvdxZoFTjM2td6MRaG+8POIf Gxf3XrOSFmXS9Fmdpsmw9GRKVuAUP7ivv13t3gNdEvfw+5Q5lES/Qo/hTa/b9Mj/3V3xLeXNx3PZn F6679w1h9hJvqzH+Hit2wQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pabc3-0000O7-8u; Fri, 10 Mar 2023 07:12:43 -0500 Date: Fri, 10 Mar 2023 14:12:25 +0200 Message-Id: <83o7p0ztxy.fsf@gnu.org> From: Eli Zaretskii To: Robert Pluim In-Reply-To: <87fsacx2qf.fsf@gmail.com> (message from Robert Pluim on Fri, 10 Mar 2023 12:30:48 +0100) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> <87fsacx2qf.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, mail@daniel-mendler.de, gregory@heytings.org, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Robert Pluim > Cc: Gregory Heytings , Philip Kaludercic > , michael_heerdegen@web.de, > monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, Eli Zaretskii > , Augusto Stoffel > Date: Fri, 10 Mar 2023 12:30:48 +0100 > > diff --git a/src/lisp.h b/src/lisp.h > index 1276285e2f2..80bbb047824 100644 > --- a/src/lisp.h > +++ b/src/lisp.h > @@ -1685,6 +1685,8 @@ SREF (Lisp_Object string, ptrdiff_t index) > INLINE void > SSET (Lisp_Object string, ptrdiff_t index, unsigned char new) > { > + if (XSTRING (string)->u.s.size_byte == -2) > + Fsignal (Qsetting_constant, string); "Setting constant" is misleading. And again, why do that at all? It's a waste of cycles, incurred on _everyone_, for an extremely rare use case that is explicitly discouraged. We are not the TSA, and should not adopt their policy of punishing the innocent 99.99% on behalf of a handful of villains. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 07:13:47 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 12:13:47 +0000 Received: from localhost ([127.0.0.1]:53962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabd4-0005ey-PP for submit@debbugs.gnu.org; Fri, 10 Mar 2023 07:13:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51716) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabd4-0005ek-1L for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 07:13:46 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pabcy-0004hg-1N; Fri, 10 Mar 2023 07:13:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=SQWut6f92KeOBKfZ1GrTEWhLlWQt0zsMC1qta7Vk5q8=; b=bs1UELqYjoaU REjIYco8BM3Hs1NgGBKziBqAwCsGkGeYwhSFnScawlYNXxemcCBpdEmvazTlrfoKWX3hgEv8RPs/r +vw8m4WSOtffkFWmPhcqaCLEovNs1mBCiaUN/XY1YMbG3yxGwQuWJqWKCXKgETHO9SEazNsIBBVv7 WYd8IWGVwg35S2QeF2HDIZi9YtXwhizh2rYCfnsHLu0Wm5H7REGmJ0J/Sjm6+RWpOAOdWILNXd6Vf NFwosg4laLwJgt5tbDHdy5PAxVSUKXMLVLz39Yk/l1QG4lh+3BNoZeMXmJ6AVY+VSisFuDmqqr1rf JPlVlUy7gbaUhqu2roGBRw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pabcx-0000b4-A8; Fri, 10 Mar 2023 07:13:39 -0500 Date: Fri, 10 Mar 2023 14:13:21 +0200 Message-Id: <83mt4kztwe.fsf@gnu.org> From: Eli Zaretskii To: Daniel Mendler In-Reply-To: <3a9f613f-baa9-2c48-f779-aaf43363a865@daniel-mendler.de> (message from Daniel Mendler on Fri, 10 Mar 2023 12:36:17 +0100) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> <87fsacx2qf.fsf@gmail.com> <3a9f613f-baa9-2c48-f779-aaf43363a865@daniel-mendler.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, rpluim@gmail.com, gregory@heytings.org, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 10 Mar 2023 12:36:17 +0100 > Cc: Gregory Heytings , > Philip Kaludercic , michael_heerdegen@web.de, > monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, Eli Zaretskii > , Augusto Stoffel > From: Daniel Mendler > > > /* Number of characters in string; MSB is used as the mark bit. */ > > ptrdiff_t size; > > /* If nonnegative, number of bytes in the string (which is multibyte). > > If negative, the string is unibyte: > > -1 for data normally allocated > > -2 for data in rodata (C string constants) > > -3 for data that must be immovable (used for bytecode) */ > > ptrdiff_t size_byte; > > Thanks! That's good. Given that a read only flag already exists, it is > easy to fix the issue. We just have to make sure that the size is > negative for the symbol names and add a check in `aset`. Let's not do that! From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 07:24:20 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 12:24:21 +0000 Received: from localhost ([127.0.0.1]:53972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabnI-0005wF-DZ for submit@debbugs.gnu.org; Fri, 10 Mar 2023 07:24:20 -0500 Received: from server.qxqx.de ([178.63.65.180]:38285 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabnG-0005w0-P6 for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 07:24:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jbyTXXhNVn+OLvkSRp+fZC0ay03PeXP5uN47QtAZhN0=; b=fPBrZ6QKr+Fxb1Gm+KNHrE/OiA tUhoQXkxyYofMiVU2ZTgW5hoj94ks1CDAnHEz8M3gumf8Epnf8kqmRc363mNxMO7+bQcdRXC40mIs cyCTZoovWvwveOmtqrmo6OLEuL6PDALUiwNiYm3SCnQKJdbLVBZS21FWtGWrgWmJaosk=; Message-ID: <20b91f20-1ed8-c38f-0165-b0eb3de1ee80@daniel-mendler.de> Date: Fri, 10 Mar 2023 13:24:08 +0100 MIME-Version: 1.0 Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name Content-Language: en-US To: Eli Zaretskii References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> <87fsacx2qf.fsf@gmail.com> <3a9f613f-baa9-2c48-f779-aaf43363a865@daniel-mendler.de> <83mt4kztwe.fsf@gnu.org> From: Daniel Mendler In-Reply-To: <83mt4kztwe.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, rpluim@gmail.com, gregory@heytings.org, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 3/10/23 13:13, Eli Zaretskii wrote: >> Date: Fri, 10 Mar 2023 12:36:17 +0100 >> Cc: Gregory Heytings , >> Philip Kaludercic , michael_heerdegen@web.de, >> monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, Eli Zaretskii >> , Augusto Stoffel >> From: Daniel Mendler >> >>> /* Number of characters in string; MSB is used as the mark bit. */ >>> ptrdiff_t size; >>> /* If nonnegative, number of bytes in the string (which is multibyte). >>> If negative, the string is unibyte: >>> -1 for data normally allocated >>> -2 for data in rodata (C string constants) >>> -3 for data that must be immovable (used for bytecode) */ >>> ptrdiff_t size_byte; >> >> Thanks! That's good. Given that a read only flag already exists, it is >> easy to fix the issue. We just have to make sure that the size is >> negative for the symbol names and add a check in `aset`. > > Let's not do that! Why not? There won't be a performance cost. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 07:35:50 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 12:35:50 +0000 Received: from localhost ([127.0.0.1]:53986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabyP-0000CC-R7 for submit@debbugs.gnu.org; Fri, 10 Mar 2023 07:35:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pabyN-0000Bz-Ji for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 07:35:48 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pabyG-0001nZ-5q; Fri, 10 Mar 2023 07:35:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=1yj5zHSuJs69/0q3SJF0UtaTkdYTmzIosE4XKFTsuYA=; b=mKOvBHVKeK0F Jr1DmsgfsoOfl+SWDDRJW4Dxq6IIxxiCYuh3O2uuAokgL64byL1zp+v2r9vSoxCFh01OXqlkdMCfS EkvIGcFu7fhiPppXuJZznOwscqG1/n16cDGF26Qxzhjo4q3HuiGKdu/kLKGAQ/WRC9TJKzqWyxiTv wzcWa5sExFafJlLoY18NvH8YdVimqtyqtoJnngGH6H0Z1DhxqmhhgSqOemgb61Vpw6nfHP0XvBCxv 5AD3HVA4ld3mnbYjE4o69BqYMPI4z3FHJKSry1+LMq/hO3t/NuJyC5vFc9XQHU0H/JsIzYh0or0ji ltq5zSTknUZrwAjAXe4VVQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pabyF-0005p1-Dp; Fri, 10 Mar 2023 07:35:39 -0500 Date: Fri, 10 Mar 2023 14:35:21 +0200 Message-Id: <83h6uszsvq.fsf@gnu.org> From: Eli Zaretskii To: Daniel Mendler In-Reply-To: (message from Daniel Mendler on Fri, 10 Mar 2023 13:00:34 +0100) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <87ilf9571k.fsf@gmail.com> <87edpx56xm.fsf@gmail.com> <83wn3ozuyn.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, rpluim@gmail.com, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 10 Mar 2023 13:00:34 +0100 > Cc: philipk@posteo.net, michael_heerdegen@web.de, monnier@iro.umontreal.ca, > 62009@debbugs.gnu.org, Robert Pluim , > Augusto Stoffel > From: Daniel Mendler > > On 3/10/23 12:50, Eli Zaretskii wrote: > > Why bother? Emacs is not in the business of preventing Lisp > > programmers from shooting themselves in the foot, certainly not when > > that incurs runtime overhead, even a small one. > > Of course Elisp is in the business of preventing programmers from > shooting themselves in the foot, otherwise we would extend Emacs in C. We disagree here, and this is a very fundamental disagreement, which basically means continuing this argument is pointless, since we have no common basis. > I fully agree with you that we should not introduce a performance > regression, in particular not one which increases GC pressure badly. > Furthermore I agree that this is a minor bug which only occurs as an > edge case when some specific strings are mutated. > > However the cost of fixing this bug is minor No, it isn't, not in my book. Sorry, I object to any change to cater for this use case. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 07:45:24 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 12:45:24 +0000 Received: from localhost ([127.0.0.1]:54015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pac7f-0000SJ-IC for submit@debbugs.gnu.org; Fri, 10 Mar 2023 07:45:23 -0500 Received: from server.qxqx.de ([178.63.65.180]:34125 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pac7e-0000S3-78 for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 07:45:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=6VIkuLtwGuMrM1Oc9oU3SC9DtfVJxmMmSizhPaipj4o=; b=Wn/LjAgNrCucoPSosLQ6tdwOqg CUl/WzNB26ebwYqrfe8pxglyQDjGFA1J7F74TNjpa2FjVVD+mGAANdfOPq/fSD52IgRxC1x2BhGoU FmrojVDxc82cNP9drWdUBthryXMXfBYGGMukzuCdHOmdywIDln+NIRE6JFuT0nyrhhsk=; Message-ID: <1cfd0b10-546e-c2c9-272a-25d3cdd4ba82@daniel-mendler.de> Date: Fri, 10 Mar 2023 13:45:11 +0100 MIME-Version: 1.0 Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name Content-Language: en-US To: Eli Zaretskii References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <87ilf9571k.fsf@gmail.com> <87edpx56xm.fsf@gmail.com> <83wn3ozuyn.fsf@gnu.org> <83h6uszsvq.fsf@gnu.org> From: Daniel Mendler In-Reply-To: <83h6uszsvq.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, rpluim@gmail.com, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 3/10/23 13:35, Eli Zaretskii wrote: >> Date: Fri, 10 Mar 2023 13:00:34 +0100 >> Cc: philipk@posteo.net, michael_heerdegen@web.de, monnier@iro.umontreal.ca, >> 62009@debbugs.gnu.org, Robert Pluim , >> Augusto Stoffel >> From: Daniel Mendler >> >> On 3/10/23 12:50, Eli Zaretskii wrote: >>> Why bother? Emacs is not in the business of preventing Lisp >>> programmers from shooting themselves in the foot, certainly not when >>> that incurs runtime overhead, even a small one. >> >> Of course Elisp is in the business of preventing programmers from >> shooting themselves in the foot, otherwise we would extend Emacs in C. > > We disagree here, and this is a very fundamental disagreement, which > basically means continuing this argument is pointless, since we have > no common basis. I don't see that the disagreement is that strong. For example aset signals an error if you try to access elements out of bounds. (aset "abc" 3 ?x) -> args-out-of-range So there are clearly use cases where signaling an error is justified. In other cases you claim signaling an error is unjustified and a crash is better. I don't like the crashing. That's the whole disagreement. I suspect that you also don't like if Emacs crashes. Maybe it doesn't bother you in this case, but in others. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 07:57:55 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 12:57:55 +0000 Received: from localhost ([127.0.0.1]:54030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pacJm-0000pR-PE for submit@debbugs.gnu.org; Fri, 10 Mar 2023 07:57:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pacJl-0000pE-OX for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 07:57:54 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pacJe-0006xh-Q4; Fri, 10 Mar 2023 07:57:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=DL1CpsUQPaP1aNIVIszb5OAFtnRwV96uREUjaAie6eQ=; b=RLr/+s/nBn1V Ce26Tqe9suWMILiA//67F6y/gzOpYOFxKoJ1f2YzPXrgo250e2i0Ps6xFPlDWmvOAQSnKtYbF5z0w uSs5rbyQ/7xqOvdNDG8P3QgPVCxjzMMetv8EWv8OU+vyCltSGtd4TLZS7yE8xWhEXkJIJb+9yNuIN 3K4GWcxXkrvTDu4Vql0OOTuFwsCYJ19LA5v3Dj4iE0keCd1agKF9VA41tPHUsoa/1zY4P8bMAgu65 WfsyCNYQvS4L+rT/FdfjcHiSnRB8KJWSshLNzOw6GB3JMq+G+Hd44DruBovlvU42PeOkLr/S4zhYJ BPNSgDzY0b9Rcrij82nVyw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pacJd-0002v1-CS; Fri, 10 Mar 2023 07:57:46 -0500 Date: Fri, 10 Mar 2023 14:57:27 +0200 Message-Id: <83cz5gzruw.fsf@gnu.org> From: Eli Zaretskii To: Daniel Mendler In-Reply-To: <1cfd0b10-546e-c2c9-272a-25d3cdd4ba82@daniel-mendler.de> (message from Daniel Mendler on Fri, 10 Mar 2023 13:45:11 +0100) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <87ilf9571k.fsf@gmail.com> <87edpx56xm.fsf@gmail.com> <83wn3ozuyn.fsf@gnu.org> <83h6uszsvq.fsf@gnu.org> <1cfd0b10-546e-c2c9-272a-25d3cdd4ba82@daniel-mendler.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, rpluim@gmail.com, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 10 Mar 2023 13:45:11 +0100 > Cc: philipk@posteo.net, michael_heerdegen@web.de, monnier@iro.umontreal.ca, > 62009@debbugs.gnu.org, rpluim@gmail.com, arstoffel@gmail.com > From: Daniel Mendler > > > We disagree here, and this is a very fundamental disagreement, which > > basically means continuing this argument is pointless, since we have > > no common basis. > > I don't see that the disagreement is that strong. For example aset > signals an error if you try to access elements out of bounds. > > (aset "abc" 3 ?x) -> args-out-of-range yes, because that's a frequent programmatic mistake. > So there are clearly use cases where signaling an error is justified. Of course. It's just that the use case being discussed is not one of them. > In other cases you claim signaling an error is unjustified and a > crash is better. I said nothing of the kind. I said it was unjustified in the particular case which is being discussed here. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 08:09:01 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 13:09:01 +0000 Received: from localhost ([127.0.0.1]:54042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pacUS-00018T-AV for submit@debbugs.gnu.org; Fri, 10 Mar 2023 08:09:01 -0500 Received: from server.qxqx.de ([178.63.65.180]:50893 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pacUP-00018F-VG for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 08:08:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=uJ1bog3BWsDgkpKLtKrhk1j6S3n4b/nQ2Lj6BaomCb4=; b=rFo66bp9fcMuwBsy+hpz0ESENJ RIfdD3L0W2cLC7/kQ1/9u2J97gnpO0cHCUfWPGmDHko7HU4Dm/Q+E0zZfcRwwSGOmDNOQ+nvaiUgw nc3JDD+/2hAgBOQtXAl/PYwRim1X6iSev+9bUvtk7uP0MvF/6M2cXm1AhbnLHxC2uP+E=; Message-ID: <5f5642f8-a8da-c002-4531-d102a119539f@daniel-mendler.de> Date: Fri, 10 Mar 2023 14:08:44 +0100 MIME-Version: 1.0 Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name Content-Language: en-US To: Eli Zaretskii References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <87ilf9571k.fsf@gmail.com> <87edpx56xm.fsf@gmail.com> <83wn3ozuyn.fsf@gnu.org> <83h6uszsvq.fsf@gnu.org> <1cfd0b10-546e-c2c9-272a-25d3cdd4ba82@daniel-mendler.de> <83cz5gzruw.fsf@gnu.org> From: Daniel Mendler In-Reply-To: <83cz5gzruw.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, rpluim@gmail.com, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 3/10/23 13:57, Eli Zaretskii wrote: >> Date: Fri, 10 Mar 2023 13:45:11 +0100 >> Cc: philipk@posteo.net, michael_heerdegen@web.de, monnier@iro.umontreal.ca, >> 62009@debbugs.gnu.org, rpluim@gmail.com, arstoffel@gmail.com >> From: Daniel Mendler >> >>> We disagree here, and this is a very fundamental disagreement, which >>> basically means continuing this argument is pointless, since we have >>> no common basis. >> >> I don't see that the disagreement is that strong. For example aset >> signals an error if you try to access elements out of bounds. >> >> (aset "abc" 3 ?x) -> args-out-of-range > > yes, because that's a frequent programmatic mistake. Agree. >> So there are clearly use cases where signaling an error is justified. > > Of course. It's just that the use case being discussed is not one of > them. I agree with you, that this is not a common mistake. But it is still a mistake and we could easily protect the user from it. This is a general question - do we want to prevent and catch most programmer mistakes or not? You seem to lean on rather not catching some errors which are rare and I am in favor of catching more errors if the costs permit. In this case, the costs are small in my book (I cannot look into your book and understand how you come to your conclusions). Given that Robert already pointed out that objects can be marked as read-only, all the necessary infrastructure is already in place, making this a cheap change. Catching more mistakes improves overall robustness of Emacs and generally there are also security considerations which should be taken into account. It may not matter in this case, but ensuring that the Elisp runtime is memory safe as much as possible is a worthy goal. >> In other cases you claim signaling an error is unjustified and a >> crash is better. > > I said nothing of the kind. I said it was unjustified in the > particular case which is being discussed here. You clearly said that you object to any measures which fix this issue. This means you prefer if Emacs crashes, instead of it signaling an error. Daniel From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 08:19:12 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 13:19:12 +0000 Received: from localhost ([127.0.0.1]:54049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paceO-0001P6-Dy for submit@debbugs.gnu.org; Fri, 10 Mar 2023 08:19:12 -0500 Received: from mail-wr1-f52.google.com ([209.85.221.52]:36352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paceM-0001Oo-4r for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 08:19:10 -0500 Received: by mail-wr1-f52.google.com with SMTP id l25so5015427wrb.3 for <62009@debbugs.gnu.org>; Fri, 10 Mar 2023 05:19:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678454344; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=dwpzvF+1XxK0Nny+o+jlGdxGIVq3ucx5TDpzsqFqttQ=; b=YpfVE4w2sISZ1cAGB++vRbYxyeqw3Cl6ImIopaEBjL49zupm/YCfAli5cMoZny6FBj SvSncxu5H3AFySUNT2KKbykAMl7s/A+ZvMA+F8ALCz4eJYvvEHLk7knyVeleeks6DMap NRalgafbAbJJrCKO+TPT+cNZc4BTIi3tK8qkc3BeWqsKON/RHDfpP0SbfuMp2ax2VqB3 kGOsyUvAfNOJyn2b5oyPYAqRrYN3GNL9P5I0oxDF4yYi1VxayksayBk0X/+1gb4CJqCo btbC67pkgj/fYPANzqySJ+AA5pBnh56o/rbLdiDYzY1pjLgrHESo8FzXmGbUuB0ofySs kvAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678454344; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dwpzvF+1XxK0Nny+o+jlGdxGIVq3ucx5TDpzsqFqttQ=; b=Xd0C/q5zhPf+XT/MPAiuw1KAfPQUN7wr+YsBPxEJ1Wf/jyOoPI/KFheD32symCqiKy qj82EqvKEegnGpAK5NG6lR4W7yG/KVt1G4o7UHyExQOQeSLzjkqpY5PjcTdiPTdWoo5r OYgrwyzyRATCMvDRAjC9lgncKcODKj5j/fethBgCjImf/0ARi890VWNoYoENXKQJXsdR ayz7m9iDQALyLx37l98AVfBIbQ+def/1S3NZVKWVieCcH64TzPrzlRxHpn3wJfO8r9ks V0HlKm1xCXqQwSJ37Uvi8WyByCiv2jZofzeRvVqkjYwV8rB+eBujWUCv7ClB62NOUC5N alLA== X-Gm-Message-State: AO0yUKV9+5jXkVbsXY53hWsHPG95qz/8C1FEmiQOtoe/is0sGnUpRJcY DD4IfthUrY69qwH8667RDSw= X-Google-Smtp-Source: AK7set9UbIRjzorO02hhGZtNQutU4eQ1dgE4lwb7eNLMXY5c132lTm9HD4ggA9T2Pxw0tBZ5XgVTBA== X-Received: by 2002:a5d:45c1:0:b0:2ca:554c:17ab with SMTP id b1-20020a5d45c1000000b002ca554c17abmr1927571wrs.25.1678454344125; Fri, 10 Mar 2023 05:19:04 -0800 (PST) Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id j17-20020a5d4651000000b002c573cff730sm2196813wrs.68.2023.03.10.05.19.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 05:19:03 -0800 (PST) From: Robert Pluim To: Eli Zaretskii Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <83o7p0ztxy.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 10 Mar 2023 14:12:25 +0200") References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> <87fsacx2qf.fsf@gmail.com> <83o7p0ztxy.fsf@gnu.org> Date: Fri, 10 Mar 2023 14:19:03 +0100 Message-ID: <87bkl0wxq0.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, mail@daniel-mendler.de, gregory@heytings.org, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Fri, 10 Mar 2023 14:12:25 +0200, Eli Zaretskii said: >> From: Robert Pluim >> Cc: Gregory Heytings , Philip Kaludercic >> , michael_heerdegen@web.de, >> monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, Eli Zaretskii >> , Augusto Stoffel >> Date: Fri, 10 Mar 2023 12:30:48 +0100 >>=20 >> diff --git a/src/lisp.h b/src/lisp.h >> index 1276285e2f2..80bbb047824 100644 >> --- a/src/lisp.h >> +++ b/src/lisp.h >> @@ -1685,6 +1685,8 @@ SREF (Lisp_Object string, ptrdiff_t index) >> INLINE void >> SSET (Lisp_Object string, ptrdiff_t index, unsigned char new) >> { >> + if (XSTRING (string)->u.s.size_byte =3D=3D -2) >> + Fsignal (Qsetting_constant, string); Eli> "Setting constant" is misleading. True. I was lazy and picked the first one I found. Eli> And again, why do that at all? It's a waste of cycles, incurred on Eli> _everyone_, for an extremely rare use case that is explicitly Eli> discouraged. We are not the TSA, and should not adopt their polic= y of Eli> punishing the innocent 99.99% on behalf of a handful of villains. I wasn=CA=BCt seriously proposing it for inclusion, just pointing out that it was possible. Robert --=20 From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 10:03:08 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 15:03:08 +0000 Received: from localhost ([127.0.0.1]:55523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paeGx-0004o7-UH for submit@debbugs.gnu.org; Fri, 10 Mar 2023 10:03:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paeGw-0004ne-Fl for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 10:03:07 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1paeGq-00079q-9t; Fri, 10 Mar 2023 10:03:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MMOsDKTrSgMTS2h80SHePVBUnR3KTCS2wVF1zhOKsq0=; b=C6ONRRGElzI3 lLGSX3mZ8oJUYsfFDOsljvSjheZOUXAusWgRRXupi6Ko/JfSC5QVaavaoaBGsjvx9XbrMHqFEmY2i V8pMWcLr5bochrPeorbXpFFcV/CoCo55ZuDuOHINmUvzYsNPCPiyP97Th93lPw3f0UpZdoPVu9kzi zL2o/Sp1V6f0WOqXh1b1pGsGV1L0vO5tAoHmv/35y7B7/cOau3K/7fuTdMKmHCG2xAxMUJGoldeCJ BRsmL8+vHYZDeg1soH1I+ETO+WAmYHCaZn9JCAqqevlvog96PuoSnWCHIxRRQGdurlAltHwRa9qmZ hViK7bx3PET8HBSLT85zPQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1paeGp-0007KW-Jo; Fri, 10 Mar 2023 10:02:59 -0500 Date: Fri, 10 Mar 2023 17:02:41 +0200 Message-Id: <837cvozm26.fsf@gnu.org> From: Eli Zaretskii To: Daniel Mendler In-Reply-To: <5f5642f8-a8da-c002-4531-d102a119539f@daniel-mendler.de> (message from Daniel Mendler on Fri, 10 Mar 2023 14:08:44 +0100) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <87ilf9571k.fsf@gmail.com> <87edpx56xm.fsf@gmail.com> <83wn3ozuyn.fsf@gnu.org> <83h6uszsvq.fsf@gnu.org> <1cfd0b10-546e-c2c9-272a-25d3cdd4ba82@daniel-mendler.de> <83cz5gzruw.fsf@gnu.org> <5f5642f8-a8da-c002-4531-d102a119539f@daniel-mendler.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, rpluim@gmail.com, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 10 Mar 2023 14:08:44 +0100 > Cc: philipk@posteo.net, michael_heerdegen@web.de, monnier@iro.umontreal.ca, > 62009@debbugs.gnu.org, rpluim@gmail.com, arstoffel@gmail.com > From: Daniel Mendler > > >> (aset "abc" 3 ?x) -> args-out-of-range > > > > yes, because that's a frequent programmatic mistake. > > Agree. > > >> So there are clearly use cases where signaling an error is justified. > > > > Of course. It's just that the use case being discussed is not one of > > them. > > I agree with you, that this is not a common mistake. But it is still a > mistake and we could easily protect the user from it. I don't agree with "easily". And I think "not common" is an understatement. > This is a general question - do we want to prevent and catch most > programmer mistakes or not? Depends on the mistakes and the price. > You seem to lean on rather not catching some errors which are rare > and I am in favor of catching more errors if the costs permit. We disagree about the importance of the mistake, and we disagree about the costs of handling it. In addition to the runtime costs, in terms of CPU and memory/GC, there's also the aspect of introducing into Emacs a feature that we will have to support for the observable future. What if we want at some point to change how these strings are store, and that change makes these mistakes even harder to support? We are taking upon ourselves an obligation that we could regret, for the benefit of silly code that shouldn't be written in the first place. That kind of trade-off makes no sense. > Catching more mistakes improves overall robustness of Emacs and > generally there are also security considerations which should be taken > into account. It may not matter in this case, but ensuring that the > Elisp runtime is memory safe as much as possible is a worthy goal. The disagreement is not about principles, it's about this particular case. > >> In other cases you claim signaling an error is unjustified and a > >> crash is better. > > > > I said nothing of the kind. I said it was unjustified in the > > particular case which is being discussed here. > > You clearly said that you object to any measures which fix this issue. > This means you prefer if Emacs crashes, instead of it signaling an error. That's your conclusion, not something I said. What I did say is that the nature and the rarity of the issue do not justify the costs. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 13:56:40 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 18:56:40 +0000 Received: from localhost ([127.0.0.1]:55875 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pahuy-00064R-6q for submit@debbugs.gnu.org; Fri, 10 Mar 2023 13:56:40 -0500 Received: from mout01.posteo.de ([185.67.36.65]:51257) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pahuv-00064D-VM for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 13:56:38 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 00008240184 for <62009@debbugs.gnu.org>; Fri, 10 Mar 2023 19:56:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1678474592; bh=gcanqtwcMMK+x/WgMKe4euJ2j4im3VnZq4kxMQouCBc=; h=From:To:Cc:Subject:Date:From; b=Rlux7hAnOTfou5enwpRyLPChPDGHxsNX3Yafp+NN4JENLxIDddNh1mzxprKjvkyFP mysjpXK+5ZXVmX60sEKjyxe8D//t2zjhO9UUUIiqIzWNE5rdkwnCGxNL8iog13nIV3 rOydylqElDrnYrFQYs7NogYkMlAnHGnOs4iNUVcN0y4Tzabln8MiqXflBxRC5zrZKw FylNeExNnqnQ6wG9fw5uTNfmYw/fFfXccnimo5ewhZlRx5Xfpcz9/oqz448eTR0JjW LgtpulgeOpyHxy7YaHYsIv9A1OVES4LVLV0Ah6HJvnsSIgtnpOO94DFsUq6YQ47Wzv WFVafApCpNrhA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PYFdV3SdGz9rxF; Fri, 10 Mar 2023 19:56:29 +0100 (CET) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <83a60l13p2.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 10 Mar 2023 09:11:05 +0200") References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> Date: Fri, 10 Mar 2023 18:56:28 +0000 Message-ID: <87fsac77vn.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: michael_heerdegen@web.de, mail@daniel-mendler.de, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: Daniel Mendler , michael_heerdegen@web.de, >> monnier@iro.umontreal.ca, 62009@debbugs.gnu.org >> Date: Thu, 09 Mar 2023 21:11:13 +0000 >> >> > AFAICT, they _are_ frozen. These names are in read-only memory, where >> > you cannot write. That's why Emacs crashes, AFAIU: the code is trying >> > to write to protected memory. >> > >> > Just don't do that, cause it's gonna hurt... >> >> Is it not possible to detect this before the illegal memory access, and >> raise a signal in Emacs Lisp? > > It won't be easy, if at all possible. And I'm not sure we even want > to do that. What would be the purpose of supporting such a use of > Emacs? The point is not that much that a signal is raised, but that anything else but segfaulting is done. Emacs is generally not "safe", but the idea of someone stuffing an expression like the one mentioned in this bug report into the autoload of a package just to cause chaos is uncompfortable. Of course, you can already do ;;;###autoload (delete-directory "~" t) or ;;;###autoload (fset 'eval 'ignore) so maybe my point is moot. -- Philip Kaludercic From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 17:01:21 2023 Received: (at 62009) by debbugs.gnu.org; 10 Mar 2023 22:01:21 +0000 Received: from localhost ([127.0.0.1]:56048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pakng-00030a-Rc for submit@debbugs.gnu.org; Fri, 10 Mar 2023 17:01:21 -0500 Received: from mail-wr1-f43.google.com ([209.85.221.43]:36842) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paknf-00030N-6k for 62009@debbugs.gnu.org; Fri, 10 Mar 2023 17:01:19 -0500 Received: by mail-wr1-f43.google.com with SMTP id l25so6342296wrb.3 for <62009@debbugs.gnu.org>; Fri, 10 Mar 2023 14:01:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678485673; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=5chzSR0H+hOgPm2g0TckewTLEdBpd17uthy8aowjTwo=; b=en+9ZGraJl/bV2Scse4CWPKd0C/wZdUMXoe6MnP7/PLhVY+Pd8LJfc5mKLDMbarlL9 ifsrqk0usoYQdxU24jeERy+GX8wC3q1STcmc+Wyv9wMgg00wX26zw/3X+7HsSq9XC4pw VdFSi4tgu6rgdzF91sP81WDrla/7dG9EiZlpKN8C1o2xr13cx/PjiyjX4sbLyDyH9STO aGw0duCnLfjIfA3MR7wyuKLlZDrtawQCOnId24vUGl6DduAh2vBrhxIfOjrDyUKEMu9Y m1qAW6tuCU7dDlr3c418l1in+Ylr0JzoLeAWrpB5r5dO8KURWZ/EVkG+IlhchKGSj6EG zneg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678485673; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5chzSR0H+hOgPm2g0TckewTLEdBpd17uthy8aowjTwo=; b=Bd0C4OArE9Tq2iXuSz8a1T6fEKLsI3sUWK45He+s5i5CZfpGTQOJzDJmfqsjfrhzaY FYSp7PThEO28AhGKM3RXprlATLTzI+9UkCkeyX4bKGfxtci39R1NJd3u/CbJTXnYRSWP tVIRVgQ6rg5F6iGGiLKVzXYduIDz07EQCpxbwB3wePhcAYgTI2RBRi3IpUXmSyaoZbDd 7dyf7SsfFAG+NfihNFgsZwiHeCXJy2Kyt+sUDXi1WSAgRZuIh+vmEVaqjgi7CeyZq4t4 Sl6RU2R+YxJ3vG4c1y6SkMl6IetENr6rFWtI5fQLs9ESTph8vh23unezd79Q0SK0IUs7 TRqA== X-Gm-Message-State: AO0yUKUt/zP+gKeEyGwydMdFwtWChqoltd626RF0yt2ksD0sd253pDxD Aazppy+UE4PasSX7iw8kwVE= X-Google-Smtp-Source: AK7set+mtXXJjAa65rlZ8mr1UFA8Kh+z8m4WWB90lkmiFmOZFqwFYU/9cWSYg5uReIiihhk6FvGM7g== X-Received: by 2002:adf:f546:0:b0:2c5:51a5:9ef8 with SMTP id j6-20020adff546000000b002c551a59ef8mr2516249wrp.8.1678485673016; Fri, 10 Mar 2023 14:01:13 -0800 (PST) Received: from [192.168.0.2] ([85.132.229.92]) by smtp.googlemail.com with ESMTPSA id t7-20020a7bc3c7000000b003e2066a6339sm1105744wmj.5.2023.03.10.14.01.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Mar 2023 14:01:12 -0800 (PST) Message-ID: Date: Sat, 11 Mar 2023 00:01:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name Content-Language: en-US To: Daniel Mendler , Eli Zaretskii References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> <87fsacx2qf.fsf@gmail.com> <3a9f613f-baa9-2c48-f779-aaf43363a865@daniel-mendler.de> <83mt4kztwe.fsf@gnu.org> <20b91f20-1ed8-c38f-0165-b0eb3de1ee80@daniel-mendler.de> From: Dmitry Gutov In-Reply-To: <20b91f20-1ed8-c38f-0165-b0eb3de1ee80@daniel-mendler.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, rpluim@gmail.com, gregory@heytings.org, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) On 10/03/2023 14:24, Daniel Mendler wrote: > On 3/10/23 13:13, Eli Zaretskii wrote: >>> Date: Fri, 10 Mar 2023 12:36:17 +0100 >>> Cc: Gregory Heytings, >>> Philip Kaludercic,michael_heerdegen@web.de, >>> monnier@iro.umontreal.ca,62009@debbugs.gnu.org, Eli Zaretskii >>> , Augusto Stoffel >>> From: Daniel Mendler >>> >>>> /* Number of characters in string; MSB is used as the mark bit. */ >>>> ptrdiff_t size; >>>> /* If nonnegative, number of bytes in the string (which is multibyte). >>>> If negative, the string is unibyte: >>>> -1 for data normally allocated >>>> -2 for data in rodata (C string constants) >>>> -3 for data that must be immovable (used for bytecode) */ >>>> ptrdiff_t size_byte; >>> Thanks! That's good. Given that a read only flag already exists, it is >>> easy to fix the issue. We just have to make sure that the size is >>> negative for the symbol names and add a check in `aset`. >> Let's not do that! > Why not? There won't be a performance cost. Perhaps we could use some exact benchmark results. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 11 02:07:25 2023 Received: (at 62009) by debbugs.gnu.org; 11 Mar 2023 07:07:25 +0000 Received: from localhost ([127.0.0.1]:56438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1patK8-0003r6-Ow for submit@debbugs.gnu.org; Sat, 11 Mar 2023 02:07:25 -0500 Received: from sonic308-56.consmr.mail.ne1.yahoo.com ([66.163.187.31]:33699) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1patK6-0003qr-Bg for 62009@debbugs.gnu.org; Sat, 11 Mar 2023 02:07:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678518436; bh=dIGb19aGv+DEC+YDO8XOwPKdomSaewts5Q2bBMI26Cw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=OM8+Pnh97CP5PVgzqjGoYSvDhz/lniY9Py75IYFlGRvU5NCVv0q7kO1eDYCzKAWhDPp25WMNwVzbp3YIZa1YW5qPH/hMpabspmNtJB3yQ3Ujz5chX66rMo4lIOeRnEqGZLl/YVeO1nUj9wOxVdEyiUrQ5he4bLuSqpVT7r1Xgfyxue+dkoH09eFSO1bHHddVvF9vmtwFUK7eTk9gQbdN3ctQsx9VR1EJao1y8CeNts5A2oISqJqaQAfPhkKsI0PcMRAIuwwMesYJkRk2ODwuzLmmhOdATelvoFy2SAA+wNORwxaT/psNALwhrIMuwlwZj0ge75GWqCPXeJjC3RQ92g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678518436; bh=WrwdN2yRxXp/v0wjh9jnS8ulkl7dCiDw5GnK6d4vfa6=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=se+c0ptTIcuu4yLxol9xspj7hORdaSRttVofPpDGpD2zIdloZUX51tmt5wwlP/P+p3w044eiMWQ9G1I7Sn2VcHF1wHpfx2EGzE+59Pxxzf/bmQ+SR3PeyCER9DH+MptbOChOO1COrf6kcyJKTlnHzpcqo5N90KxvM2IOGTx2AdAKXErNhwu3MwdZ6qZ+yTnScdnjY6sDD4WxMIFeU74yaUgRp3zXmnoBdHaSndtghguagZigHGSCesTrU14ziMJF+FIZF73T+GyAhUMbYmluWeq1kzFXSKre1e0RIOuHB/lYxB130tQi8Tu7TvennI6itRXQhWqfE538JTTAzeW51w== X-YMail-OSG: dUO7IiAVM1k9Ge8qFqE19VZCIr0Yv9vnK9xhm_6lrNLOULuE5Mz6SqG4Aj6jua1 W1jxqvfD8x5neo3q9v42ysrgOcV5HdZ9os6IacYKo7TaC.4gtlaHl8hzUj4BWGLf4u10SNgGTj0R Ox_jQ_7VnHnW4yoy3UCL9PY6czdgiXemNfr.nsLfULWg1gyQXpOydYAQqo1AyfLVhbZquH428Akg tG.iuS9HWAPKfJuG9oXPBMaa3I_pG7c2HW0hRxGqC3dJ3nwXUptCq7whBDJUan50BZUzh4uvfYpt StGh1KUggqq8nModDh_CeBkB5kV3n1vge7HU3z3CiWUbZm8wHv5SVTPEDskv.7DTwP79kY9D3RVq HRDvCcIuAZK0Efjkgv.1v8D2YUqZKEom_WXvmsxtgvF1__u6lF_DM8t.M4EAqy8Ry9Msh7P49O6Z fEaHjbg7j9ZOBbJsqeTNi.qexNpol6j6rO9W9RZAw0S_s93bAFIxVHf8z5J0_wHSqT..rGx3_r.r ZhHlSQlqPpXFtpF2hGBW_7CqAfVekKwzgbvy35cS8D1obU.CpHLVbKkfBHZbOPXxWliDNCP9Hpzd Ijhyp93EANsa3CICQ.3_KZxf745LuoVV4zdk5NUIysH4XtDimNkXkviw8cqiijqMaEob2XJRAoRu VpjC_y267tRbWedpmbEoZjZbIHPax50WuAKVQ.wqLh9isu2C.K1IJe7hLuU8lEz.AJOsJBc2subD dx.8dICBpZwKY9.gH_MqNaxV7SK9NbXOmAL.1LHT.VdZIoY9aHF41E_TaJAQnk43FmMZUvhCZyAO xZPtPvbl2RVhue1_QUa2LBjkl4NZv6fV_uNLMPkB0H9rSXWsSWHp2hI1_2DwTAqFVPe0QCGJauDk lOL0F2Dvz.IWaAM6flfQcaz.ubST.iqxbH.M8Wmp6oII9CN.hCJQNB_vxjSJtsb.EhnoZ27kmiSd wSQki.jelX6kay3Le.TabQ06jQ8mkES5MhO.UKTpVKcV08Uq33YZNL6R7ObB9DRCijXKVP116x2J ljoxtgwRfNlZ4y.sg8bnlZ619kLSM6LSMOAFdLDYO5Sc4IlbTiOLtXuz6xonklTeQODHak2gOiga AIzz7X5.Tcuf01cEm6XacT.4o5xChz6Bz0yOL2WBsJNlEkrO41sq05ZI9yWoLoqRGzhNHPn3tUwz QAyQknGivysM_NKrYnwdy5UNCgXasPTNIiXak8TZllGATEB2Mzzej7WKbq9z75yNsg3JYu0jfSYa SHGWaGao2zFRr6e8b5PEpPNVcrb_PhZzG4kK3TwGx9_JggSkeMNLTNA4WDkObL5UFfqBmXY7Lj6t qLP7EcpABSSFTiOK1z0K4bTOxxZ3fTMySfTGttwS_pE.YYwcAR6Trys_uHC4zIxYIgcit8Uo0ATT 1BbXtn3sSXKKr_h_TfJqtCd_oce1kgyGJ2gxmg1BHMC3eb6VIYX.SJB27a6oYLr0PFe7vW_mGtOJ bVcg5DjoAi5yLgSgZsHMVwr.10nQzq054mgR43.cvBv2rCVHhR__mSmbPoqIK6QxK7GPFEvzCH8y 4VMNOisqSq43cEtVjeO0f5Yn9z05bKoidAQ6aklyyGfe8hYDaY12QjlKXkmcU_9RW5iwb6PNWBVT N7dGGT8u7G9xWh4l0.oxEqetLBBWjdl1JZM3XpSj4yPa92elob_O5uD6UGNYS48u8jkpxAJnRiYa QAbS4HL4slzKGPtKFGRYEUBoMxWjF.OTSkdfsbcYpPSODP3aXTEU2yZkeD9PUt2R5u9kh6h6caRW BnbBVTYaPYd_Rxfh_.qH2nrb5iZ1FsfUpWgNK.21MXU.1tRQNhF7BeBHJhiuzdCI9_WigFqwQpOS rNhMluOWBkD4Q9JlCXto9uSjenDm5f6dkfL3dl19TybV8HtYuJyGsA3TO4d5LDXE5k1cUb56e8Y9 6cYp_1UEk3EsJbTnKuPW3CYLWPsX_veX.q690as7ZYwT6Mpv9G.TPTesmnFNh0Nf3D._4.hroNuk BwnSnFGDkexbMeinmAkwxkXDKZQ4QF6RQ5sfSo3w6FBpQHIFTuTRm34XDAx7o.bG2KPlKb.Unbyd F6pJrDfAndRrQ6rgHaq5AlEBs0pyvxcr3C6l67HAkvlG4mSsC7q41DPeIBMQLMOEsE_uYRrnFyY1 Q.4nrKNm3HOMLjo3hv3O8kdESijZXUCRwfiyYhIdj1mYy9MfH5VXTq3VSR8r4b8xhmRrgqYexhXB LHUmeVcKEv4EJAfTHwIL5cdlU131zMWg0OkLGW.j0KNbPqSJ.nvRcdNYGGVMYKe0juudDf12W X-Sonic-MF: X-Sonic-ID: 2782a14f-9f3f-4fa7-8b71-66c88d5d4f84 Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ne1.yahoo.com with HTTP; Sat, 11 Mar 2023 07:07:16 +0000 Received: by hermes--production-sg3-67c57bccff-b6t8r (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 44070af5701c5a83c8490e43210e72e2; Sat, 11 Mar 2023 07:07:11 +0000 (UTC) From: Po Lu To: Eli Zaretskii Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <83v8j8zutj.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 10 Mar 2023 13:53:28 +0200") References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <83v8j8zutj.fsf@gnu.org> Date: Sat, 11 Mar 2023 15:07:05 +0800 Message-ID: <87sfebepgm.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.21284 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 1169 X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, mail@daniel-mendler.de, Gregory Heytings , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> Date: Fri, 10 Mar 2023 09:40:31 +0000 >> From: Gregory Heytings >> cc: Philip Kaludercic , michael_heerdegen@web.de, >> mail@daniel-mendler.de, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org >> >> >> Instead of raising a signal, I suggest: >> >> diff --git a/src/data.c b/src/data.c >> index 0f1d881e00b..76867d6787e 100644 >> --- a/src/data.c >> +++ b/src/data.c >> @@ -780,7 +780,7 @@ DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, >> 1, 0, >> >> CHECK_SYMBOL (symbol); >> name = SYMBOL_NAME (symbol); >> - return name; >> + return build_string (SSDATA (name)); >> } >> >> DEFUN ("bare-symbol", Fbare_symbol, Sbare_symbol, 1, 1, 0, > > No, we will NOT increase GC pressure in Emacs just because someone > could do a silly and nonsensical thing. No way. Can't we make puresize.h check (in addition to whether or not the string is in pure space) whether or not the string lies in read-only segments of the executable? Or maybe put all of string data of DEFSYM'd symbols in pure space, since Faset already checks that the string is not in pure space. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 11 02:08:21 2023 Received: (at 62009) by debbugs.gnu.org; 11 Mar 2023 07:08:21 +0000 Received: from localhost ([127.0.0.1]:56443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1patL3-0003se-E8 for submit@debbugs.gnu.org; Sat, 11 Mar 2023 02:08:21 -0500 Received: from sonic305-20.consmr.mail.ne1.yahoo.com ([66.163.185.146]:42708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1patKy-0003sO-He for 62009@debbugs.gnu.org; Sat, 11 Mar 2023 02:08:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678518490; bh=yUR+jZYHnF0/GS1vVEbPqCcDKbd8cEeO5F7WrEYGO7k=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=YrmdYZCipjNEiXqIAzMtjmvCxCEKHt8wRDyG01yj5bTc81Z5Wy856Fgvw/SPgIyux2L+nWrRwgc3Sn96GL1yLLzAonEcfMBAO6fkJnE/vMc3X4KmQTNXX6raa/NDNBJuv8uHfRo2putlMcg5f3A1szVkJ6dKfaKnIVdvRYq4ayU80KNKMiNGsUq/sE6AaPpDDecbySl9flWFddKi8ip+laNdFi/Fry8vd4RdL125v65UQnNmRdDSRgxW7h8fLBvp0udobX6WT40XWgSgJqM0BWxMJmYXef6qFyMOsGxnXAiy1BB4B5jEqM9etjBrD8u8zEDPcmCjx1jZLuCNH6f61w== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678518490; bh=sGHaWTOk7zmlzDOky8v/b+snyRXmd5pgX1Iw80XRk/h=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Su041tWyjml0chm1nHONi7Rc6MQPgquYvkbGglB2hbWUknPd41lcs2mpKBjaEkWpH7Voa280GiZeIl9dOiaV07MR2EuJM+Lqr8VDyhcQRuSEBaflYOp3FQoR8B86AMhViQ+YRTsIxNGLMxCVORfW0X03RnFWwmp/6dKnpNt8bDJ6+fRfMkfn2qva4z4GjqRYnOsuWTYDY01CBYgFWX2rHNLE2yuoBh5HB3Q0aR8lG+pjq5x003sAXAi4Y4MqIK6rUH3lcRSp3b6S3Bi6fg478sjbDPLiGshFT0q6JXcNjXIJz+iwJgBPkcp6vQe00qXnO5QXdxqKqajQIdUaoDUSmw== X-YMail-OSG: 4I.DDOcVM1lSSlablra210BtkaFf6oB1laxab2Ba1b7maqz3AbiXDXU83gXijOA HeES6yv9WDfi5z7x7J.i_ka85GTV5gFIXPK81ZjXa2IsKqM_ZbbG07b6Ax2IreNM40TSay9g0r9G MIP8_wH_pj8AX91izbj5JlhuWNhTEYAGH6Q7nO.uLl_8h.wuTac4te6zmDfH4m3xQK4GmMBFClMF caNBl5i_BGTRYrYZIZL7YLKDfh2WJfa74q.Ofqgu2cFPAqjnbf0JTPovAJTCkyKlDMAPzq2c5Sn5 4rh.4i6v2tmPHhHa9jdIv9K0Fegpuk.IlkyJ4Jal9gFrHHOvYE3FZtJ7j_rvfGs5GxYbqZwznoTO aRBEFdNSGIyWrbnf2_2HALJIObyn6O7lZcU8KJ6l6CkWaevXUMN3.dg4IBMLfhewrcD89s6ly1Od DM8mSyG.4mZ.X7qLqK1xXZbJw6mYrYsr2LZVWV8guqBVn.bunFfvWgs0HT0N7DD0xEhEm3k8_GEP NVYZsoJlA7_2Zx3_zzTC6JUejdame6WzBv7ZVl2Zc9v1iOfsOp0xDAaiaYuRGScQd0B6Vk_FmLPN G4zfwkg1ltpph7tDzw7_IHvy7cVi9fI_5x3r3pTQ3s1FdeMlnK6KyvY.BVZDiuNYmK9ssASQ.b.K ta.wdMxuFt25C4_5GJRn9c_jZZZNMTI_EKzsxKfhNyI4eRUAMkf7TPpNzZmczIijTo1bWr5.9Krs mfVKv6p4r4HbPveKLXGmlLLDZtOvhvupzBAcXi4Jz_CKExHuSXN0ReS9AxulqT3i0hD2vRTSMYXh hyYq8poA3pq05jm2Nh0TbHB_zhl4dMuCuOAVkBczrZGhA5GaVA02GTd_.K8mUYnUBO.IJbUoPVtE AvHTSlHyar2EntoybtW6eSzD2sDA9Tn7_D.yeVZG0Ydo_eDFVrxHipoCmhPR5RV3Y5iOr1ty.y0j nV5jbKUO4Eo7aXOh7nja2sdI9r06AKHqQymyCIm8FPplmQW2FJuP1JH0riEKgfOWX_aAsihYVlhI 1s9A9e_q51Ld5ICgbzKA9ArvbEL1Xrs4BlFmt_r.njrLT0aSn4iLIBt.89yRLXtxjlcDAw_Uzqwd qb4kNwl.Yh0qdBUS6._cG_F7_nlCyggTMAu.YS7.vAn66mMdfs2yK2V.S0AlSpg04hGUSBuNJle. 0q_YBziBAajrknX9S.NZka3ExMPwEI23NgQ1Q6mwYG1RZ2DEcRW4QZNpldfWo0Ccq7bqHXWsvics rZxgI2CNzzufDqCx_dv9tHYurhs6Y6LuNRjc4qFjyZ71C7fJYh66x_luWI6cWNuScVhcpyQ6IWeV b.6SJ9vUJzPZckC271YNutxUdfhYSUQpXZA8aZWabN5NKfgDXe9njLHzR5rssOvZyGGoMHqAivbF HmJxTWfmw_N_bfbCGqikdNap4d5jSJy.esAHifnZqJMUGPkFopi3A5216bGpanZX0wK0U7vq.cel t2ac3gqGsk.7ERyd9EOLWSOfODqAe95sJkkOrU1NgV_vRDFX8pGpLWKn1MFAj29fkxe6xxvHOLQ3 UzAeJC3fVl47jwsgHshr6EgoKfVzw2nujeRa4W37kjSX_.9BTDDGrKVCYv0GIYTSlw8X_4gu2jo4 di4AQ1XFobUy2j8CY12xUOHlycQ1aBFdzBWCQX_J0CAYQ55s1y1BuCISZX9nl8ynha8eC0ZUJVdo _SBw1FknBW9NMGjHQi8yPcXqAELw23MYjq_OttUzVu8RMJ5mn4Nlhhj51dnt9rHTERI2GkPzNnVe cOuYVgOrUt2c5DjC4Q2TG_NTm0CFC5mkhesVJ2p.1X1D8YAh_1BCqrEzMYumMikd.OxkNdnNs7i3 mBWxgwqrYMFjvH2NuUQzPpYTpi7g0tLJN2SFn3_ieZVIIwPQjLLU7jwXvRTXv4cyaHX1nVdLeAQQ cD.Wmxc8jx8aKqjWRgA_3jw5xfE5MlCe8N3E_hwUa1cZk4.JQ4Uct4E2f3xk7HzHY4WjPCP6ethD HqEfO6x7qGJbiSNBrnQ9nU62PUVH2mKO.SzOogDaqC6zn9l2PI33W8nH1TWHs3C5DI76PZ3b6RVp CJtSOOBaOaT2kf35v_POOozTuaLHeQX8z_YtdGca5P6k_hJo6pPTWhP2tqOLQer7.r0ZobSyrW02 9UycUWkrmk_LwAVa1B5Qw6UcqT5kbY0OtdDupqgx74AETOxYikljzsoxEAU4vTkXdnDRl0Ou1P0Y hgJvMn67Syh68uFBxg8lZr2GhBmleOmqNH30Fc3NKjq9XPJ9g718c84_UDuUhgec- X-Sonic-MF: X-Sonic-ID: db89733b-308e-40f7-87e1-d61b019e9518 Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Sat, 11 Mar 2023 07:08:10 +0000 Received: by hermes--production-sg3-67c57bccff-l44jm (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 9103978f23340fb9c7045fb387aabe03; Sat, 11 Mar 2023 07:08:03 +0000 (UTC) From: Po Lu To: Robert Pluim Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <87fsacx2qf.fsf@gmail.com> (Robert Pluim's message of "Fri, 10 Mar 2023 12:30:48 +0100") References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> <87fsacx2qf.fsf@gmail.com> Date: Sat, 11 Mar 2023 15:07:56 +0800 Message-ID: <87o7ozepf7.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.21284 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 1514 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62009 Cc: Philip Kaludercic , michael_heerdegen@web.de, Daniel Mendler , Gregory Heytings , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, Eli Zaretskii , Augusto Stoffel X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Robert Pluim writes: >>>>>> On Fri, 10 Mar 2023 12:09:59 +0100, Daniel Mendler said: > > Daniel> One could check if the string is located in read-only memory. Or one > Daniel> could add a flag bit to the string data structure (and possibly to other > Daniel> data structures too). Freezing data structures such that they become > Daniel> read-only is a generally useful feature. There won't be any performance > Daniel> overhead of the check since a branch not taken is fast thanks to the > Daniel> branch predictor. > > We already have such a flag: > > /* Number of characters in string; MSB is used as the mark bit. */ > ptrdiff_t size; > /* If nonnegative, number of bytes in the string (which is multibyte). > If negative, the string is unibyte: > -1 for data normally allocated > -2 for data in rodata (C string constants) > -3 for data that must be immovable (used for bytecode) */ > ptrdiff_t size_byte; > > Try this: > > diff --git a/src/lisp.h b/src/lisp.h > index 1276285e2f2..80bbb047824 100644 > --- a/src/lisp.h > +++ b/src/lisp.h > @@ -1685,6 +1685,8 @@ SREF (Lisp_Object string, ptrdiff_t index) > INLINE void > SSET (Lisp_Object string, ptrdiff_t index, unsigned char new) > { > + if (XSTRING (string)->u.s.size_byte == -2) > + Fsignal (Qsetting_constant, string); > SDATA (string)[index] = new; > } > INLINE ptrdiff_t > > Robert Why does this have to be in SSET and not in PURE_P? From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 11 02:47:40 2023 Received: (at 62009) by debbugs.gnu.org; 11 Mar 2023 07:47:40 +0000 Received: from localhost ([127.0.0.1]:56469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1patx6-0004sJ-D9 for submit@debbugs.gnu.org; Sat, 11 Mar 2023 02:47:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54656) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1patx4-0004rV-Hq for 62009@debbugs.gnu.org; Sat, 11 Mar 2023 02:47:39 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1patwv-0003oa-U2; Sat, 11 Mar 2023 02:47:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=JVQQaimYHIXVYHNSmAQ9iCqDCDYXIL47sUpoiMQXFlM=; b=LzDPrrnAUBwC BBxamKKUK/evjXobWSQiNl+oqIxy14HYYyO7t6ZZz1VIa/OfBMJI6Lp+ahg3PFmUqI6d7I38VlkmN Ls5MSMViOfN3QHYec/1y3HGBxDj8b4TRYSwRmnWhdq0dya/SuwlkNQgReUbZs0x57uFZOIa7xBkAv /jihjtwTQ0GqI/I2O8xujVWB7mzgHNC/OVIc3b52iW8xxaouX9A0iwp/BbM795c69NWBOd7iNqJZ6 A/0jhaOO4UD8bR5zD/5Io6OIslSMvAucK/mwrPS6DnNO2BCqbCwfteFeIBZSFhjBV7HeU1wt+nCnQ sPGOchbWULMqsgnywuZswQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1patwt-0006yZ-UM; Sat, 11 Mar 2023 02:47:29 -0500 Date: Sat, 11 Mar 2023 09:47:11 +0200 Message-Id: <83ilf7ybk0.fsf@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87sfebepgm.fsf@yahoo.com> (message from Po Lu on Sat, 11 Mar 2023 15:07:05 +0800) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <83v8j8zutj.fsf@gnu.org> <87sfebepgm.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, mail@daniel-mendler.de, gregory@heytings.org, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: Gregory Heytings , michael_heerdegen@web.de, > mail@daniel-mendler.de, philipk@posteo.net, monnier@iro.umontreal.ca, > 62009@debbugs.gnu.org > Date: Sat, 11 Mar 2023 15:07:05 +0800 > > > No, we will NOT increase GC pressure in Emacs just because someone > > could do a silly and nonsensical thing. No way. > > Can't we make puresize.h check (in addition to whether or not the string > is in pure space) whether or not the string lies in read-only segments > of the executable? > > Or maybe put all of string data of DEFSYM'd symbols in pure space, since > Faset already checks that the string is not in pure space. Let me remind us all that we intend to toss pure space soon. So let's not build any new features on what pure space means and does, certainly not for such marginal use cases. We don't want to take upon ourselves any jobs that might prove difficult to keep doing when some of the underlying infrastructure changes, because it would be ridiculous to have this little tail wag the Emacs dog when the time comes. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 11 10:16:41 2023 Received: (at 62009) by debbugs.gnu.org; 11 Mar 2023 15:16:41 +0000 Received: from localhost ([127.0.0.1]:58489 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pb0xc-00084A-SA for submit@debbugs.gnu.org; Sat, 11 Mar 2023 10:16:41 -0500 Received: from heytings.org ([95.142.160.155]:35864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pb0xa-00083y-Ia for 62009@debbugs.gnu.org; Sat, 11 Mar 2023 10:16:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1678547797; bh=8eNmFJVTBqg6KjlSBw9lZ3tunU/O+K/9nqh7LaGeh18=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=ZaSjMjwMn75Q7U1IJoELnfHqkReEsncAwFb9jyXHBybAqCpWd2/9BRqOn5AyuhREN fYNfhBZZvS5cg8zkdOhq9pKGDtWAg9pwx5khZ7PcnmoNBE2SyG+3b98ZifBqJoP+Fl i91JMX1q54uQCLL6qOY0TvevWFpSZZ39EQB3Uzp5uNocL7rmTh5idRbFCyitvYvhyU 8ph/c+JR/MoY7CgWJ1N96WmEm8DcVZzpWLbfNZfssUIZAPAOz/nTY3F42mw9vRPDAm A1HtwlQHT3TOF2r6z2rIKkx4xXoN2t93HgLWyNEGwSoQoxEq/86YWe2ZKDimpVDv9V 759itR1PWLfLQ== Date: Sat, 11 Mar 2023 15:16:36 +0000 From: Gregory Heytings To: Eli Zaretskii Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <83h6uszsvq.fsf@gnu.org> Message-ID: <0bd86aa3966395deee4f@heytings.org> References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <87ilf9571k.fsf@gmail.com> <87edpx56xm.fsf@gmail.com> <83wn3ozuyn.fsf@gnu.org> <83h6uszsvq.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, Daniel Mendler , rpluim@gmail.com, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > Sorry, I object to any change to cater for this use case. > IMO a reasonable change here would be to update the docstring of symbol-name, which only says "Return SYMBOL's name, a string.", with a warning similar to the one in the manual: Warning: Changing the string by substituting characters does change the name of the symbol, but fails to update the obarray, so don't do it! Perhaps we could also explicitly mention, in the docstring and/or in the manual, that doing that can also crash Emacs. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 11 10:37:42 2023 Received: (at 62009) by debbugs.gnu.org; 11 Mar 2023 15:37:42 +0000 Received: from localhost ([127.0.0.1]:58500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pb1Hy-00008X-2F for submit@debbugs.gnu.org; Sat, 11 Mar 2023 10:37:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pb1Hw-00008K-Cu for 62009@debbugs.gnu.org; Sat, 11 Mar 2023 10:37:40 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pb1Hn-0003ZD-O6; Sat, 11 Mar 2023 10:37:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=aT3SVwsJdQ74OVGomGhKKdwx+B90AUcHpWtTfPCgAnY=; b=lKTVPKD86Nm8 jhfwE0B3EQd0EwtQ2jBx58sE2yx543DSfY+ZWe7zYLpGP/PODUAwFDQURR5Uu9lZm+C6j9jLi5PjQ B6lHNChPKkQNA2O/Ijn6YrhMc164C93I50lz17+E97vinkcIyC3rtuciaB0ACWby6mJai4LfsUFEx 7GGHRP1UgyTF8ftrSCHCRNAY3Q7ovmYcKuVryA/NciniNtVO9/XoT2mZTMIme+sZmrq+EldTrQNnx WU0GFmMeVjM8IcOKJYsc6P/2OLmj6TMt6gia4Xhj0A+E2GVYOHvnNYSWoNRrRasFCfTup37KZ4jM2 1Qrxybzy2qvKcNyZsq7ovg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pb1Hn-0006NZ-6w; Sat, 11 Mar 2023 10:37:31 -0500 Date: Sat, 11 Mar 2023 17:37:16 +0200 Message-Id: <831qlvwb83.fsf@gnu.org> From: Eli Zaretskii To: Gregory Heytings In-Reply-To: <0bd86aa3966395deee4f@heytings.org> (message from Gregory Heytings on Sat, 11 Mar 2023 15:16:36 +0000) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <87ilf9571k.fsf@gmail.com> <87edpx56xm.fsf@gmail.com> <83wn3ozuyn.fsf@gnu.org> <83h6uszsvq.fsf@gnu.org> <0bd86aa3966395deee4f@heytings.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, mail@daniel-mendler.de, rpluim@gmail.com, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 11 Mar 2023 15:16:36 +0000 > From: Gregory Heytings > cc: Daniel Mendler , philipk@posteo.net, > michael_heerdegen@web.de, rpluim@gmail.com, monnier@iro.umontreal.ca, > 62009@debbugs.gnu.org, arstoffel@gmail.com > > > > > > Sorry, I object to any change to cater for this use case. > > > > IMO a reasonable change here would be to update the docstring of > symbol-name, which only says "Return SYMBOL's name, a string.", with a > warning similar to the one in the manual: > > Warning: Changing the string by substituting characters does change the > name of the symbol, but fails to update the obarray, so don't do it! That is okay, of course. My objection was to the code changes. > Perhaps we could also explicitly mention, in the docstring and/or in the > manual, that doing that can also crash Emacs. I think being a bit vague here and talking about "dangers" should be good enough, since not every such code will crash, and probably also not on every platform and in every build configuration. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 13 04:07:31 2023 Received: (at 62009) by debbugs.gnu.org; 13 Mar 2023 08:07:31 +0000 Received: from localhost ([127.0.0.1]:33540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbdDP-0005Xz-Mx for submit@debbugs.gnu.org; Mon, 13 Mar 2023 04:07:31 -0400 Received: from mail-wm1-f47.google.com ([209.85.128.47]:36788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbdDN-0005Xl-R7 for 62009@debbugs.gnu.org; Mon, 13 Mar 2023 04:07:30 -0400 Received: by mail-wm1-f47.google.com with SMTP id j19-20020a05600c191300b003eb3e1eb0caso10244229wmq.1 for <62009@debbugs.gnu.org>; Mon, 13 Mar 2023 01:07:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678694843; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=MdX0/ZD/TI3z9aweWCCwMY8cE2Pyh+NZMxfj/dzsN7M=; b=nBTrjcRJkN5VZt528g77IYXefyKX88oLEPOUh1uf6o3oiFUGFrmyzag72evP7GcARM cHbE8ypxYuCIK+IITv22h4vjwQwPuqp+pmRU2ARil/DH+louVm+dDLcgHSQuHhVQcEnd j65FNsr44lWvJbz/TyHxhKSGr4/hKPIxCC/tRGPxMcI+JYKXS7uD/wtKS6c6lRAW2ecv PDMi4qOwfBss5TjlM6iYLqPDc7izwQAs/SRmtIZ24NHowCIX9mI0+oEClqTGgFinJRvJ z7oTkvb6q8hykwDYTMqXt5brxoomWvS46MgpL+/LSpNnVRYu8ysuXJg4uZ8l4d2BWVzH nBTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678694843; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MdX0/ZD/TI3z9aweWCCwMY8cE2Pyh+NZMxfj/dzsN7M=; b=U8zinLuYUlMip0izPLR4HKdH0zixsntjayerst19BjfFEAI0uUG1vEmgrtWH41TRWI DmTy23L1nlnLJKe7MaC7OQiMR1Y4tKwiAzq1kgyoJJLwAhXh0D9DCfNfBNgK4lGijZ4O gsOJeAi5W7TBZHJKlsH61Cvou+ZIHdXHyWPv41vHCG3QpOyOcwqF2DSCAsokb5tqJAJd Cb651a+19QLA40Poqyyoxvk5ZY02rauqXfuQ447DfKcJWMtWwkzAafbXnIJ9f9WQsIpD 5GkaTnxs8xGMU/BYcGnbW5JuGccSDvs79PRyKctT+VWibBTYBlrIcVSwL1fKWoAGrxY+ jIHA== X-Gm-Message-State: AO0yUKXG2hlFyFZyimg02kxK7Uoh+iFeb3e0M6KWGQNLSgNJC05dh6q+ fmQFoXzlLZ9cgIUwbKckadU= X-Google-Smtp-Source: AK7set+WwJt8oYnOxT91oFON496nqGPWfn6Zm1CCLhjnXHeGFx0myG2L/3a1v1JPBM5aicSU2TsFIA== X-Received: by 2002:a05:600c:468e:b0:3e7:772d:22de with SMTP id p14-20020a05600c468e00b003e7772d22demr10457251wmo.30.1678694842628; Mon, 13 Mar 2023 01:07:22 -0700 (PDT) Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id y22-20020a7bcd96000000b003ecc64edf7esm7076054wmj.39.2023.03.13.01.07.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 01:07:21 -0700 (PDT) From: Robert Pluim To: Po Lu Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <87o7ozepf7.fsf@yahoo.com> (Po Lu's message of "Sat, 11 Mar 2023 15:07:56 +0800") References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> <87fsacx2qf.fsf@gmail.com> <87o7ozepf7.fsf@yahoo.com> Date: Mon, 13 Mar 2023 09:07:20 +0100 Message-ID: <873569vzuv.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62009 Cc: Philip Kaludercic , michael_heerdegen@web.de, Daniel Mendler , Gregory Heytings , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, Eli Zaretskii , Augusto Stoffel X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Sat, 11 Mar 2023 15:07:56 +0800, Po Lu said: Po Lu> Why does this have to be in SSET and not in PURE_P? That would work as well, although I thought purespace was going away? Robert -- From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 13 04:28:29 2023 Received: (at 62009) by debbugs.gnu.org; 13 Mar 2023 08:28:29 +0000 Received: from localhost ([127.0.0.1]:33553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbdXg-00062c-TZ for submit@debbugs.gnu.org; Mon, 13 Mar 2023 04:28:29 -0400 Received: from sonic316-22.consmr.mail.ne1.yahoo.com ([66.163.187.148]:45580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbdXf-00062Q-6l for 62009@debbugs.gnu.org; Mon, 13 Mar 2023 04:28:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678696099; bh=oEiCLg752TlARjthLS+RiQxmZKSDEi+C+AymuapaIbI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=tqJD1ARhLHH4bRl1/lrdrJM0IA65BVue5jE08QgG+ReSYb2vffBon6Y6q+OPuj8zb/aNKkwTJHD8wChl8QMn6e6yrsCgwvHS1nPoCraJVHdkIMMWYyf3/VARzZP3AW19gQEX0nzeQfiXj2wncIEBXNL5oZW6s7eZCsv+CJGPEmH2S4lSX3BB/jnbEuoKSgWmU7l8SjaIK0tq6q826yNIezl/JUuPx2Zl8pMZuHGw89LZryjiqJYYEwxXxK2t1KU3LyJ7y/f5lymFAA6RIQBvWtCXPdLT0Nzewyp+w09A17aaL63jljZPlWeqF7Fm16NRRMJIpp86U7zBNwdBrmqisg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678696099; bh=/NHDtw8EVGW35DuXfe6T+vPuYf/vVDvB1XyLP3ZhUQ1=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=C+Pn5swtX76Qld36jEjSpXHlFp0vDaaKBobgZq+d4Kv/2mwGT+tgxUdcuQsU1ljVarBg36kV8BDwOh+GiyibTfszgaska6Xp171D64HXjDVg5K5UctXGLXO+ZzZcZTzz2B/dGb1TH2Qb+7AgsIAGooqOQMUZEIuwLSyfySyRaOSGBGFb/AMwddGGZX+9nE2rqSo6SWAg6kLrbgKobYMt5yLoT0Dfe5q85l7eTDoCswRXW/jue6Y13T7XpctzTtM1/VUaN3kmSoJy0nW+abeUXyKa2aZloyPxtbyjk9ZIFMttanPSFuC03Uhn42EahSk35hVNgxYIy+8SydHLJLFqUg== X-YMail-OSG: t0POW00VM1lZmF7FQMkHMIRl0TjYq10iQO2EaD.J_en1nLNnnjM8m_tNLy_.ByW WKsoZkJMoKiT9O4m7_kj_KaOPYyDp0_jdSpiUuEDzNu_TSYwTOb2Ev1R2Fd8S42VaA_jOtWR_7oh ULJ5e.oP4EHmixKSTKYL8zll_XxbBFY1zTFKLiZGeoi81EPKJwXXut6fpFUacR7e.NYtR_maCS9S 6jzhW4CkLB_EYBR0CgKzIzTCf.pTO6ZvGL12dRfI3tQVhab_Z_gqKB5RDDKh5ok5dDjtu6IsKtds EP_GtApdkOqOR5KpNzT6XGFB3xaMw8QyGvIqxPUHsLH6Mc7IcF5UJ4FbnRQ1RwBH5DzYVNtRxH2l JsD96T7VPbxNcUSd0X7HtbNDArkxHgy34Yh1A5MEc1M_bS3GutXyuvuELnUuvrjK2mPg0p4_SQ.8 9LpLBBo7xR1CHUiox3nv2RyUSn_gFmoPl_c.f6fI.Wp5kwHkR8KAbOfTNdAkPzH2HrYZXdU6hDBn xNzmEzxPYzinSRW4JwzPvCCXxZO.d1UJneFqk.bL7IeRYJQKr_2qv0k7Vj2tcMf4.wbnOhANw_re ZZW0bdFQlC.GRKIecShVFXeQwG18g9f7wnTPU0YoGazEuPB0AQMUEiYIY7nBpw4NemKEz_tj2yuf yKmPHe5LT06_9n4mOXPAfpbH5bc7hKGq29Wwqh8e3YfMp5nM7SiskwPw7ZdQ8Y6HxljUqi8IEtMB twTzpphgASI.HwLy1GYV1ekMVC.wVaF.V4RrpA.CbViipm5b7qY3gwa9bc9VIILpPwUUDaSAAyCW 2PN8IHjSw608pRQU2wpEtnnnK8Az7JJQ8FAGYVSwNKgFD0XVbZg579IU3SIBmC0WicT2bi79t0XI ROnU47v80xjqKxVVpF5RFG.RoRr1.jIaTmpWWrVzIoawjtDqN8DNMfAMHuPULT7Kz.Pkec7QorUi DTa01MjDZCvAqTmnNPzr.IkbRr8prLuroYe1g_cBuhVVLEIGQ.MqFJULJLBeDz294OknvwAOHPBZ r.1b58sPhBX1szIfzTULJv4BHuAXnbScsfu9sp_4kmGveGbuGGk901NcItfVk5eh_V5cIcO30UIz G58xckCW1wCrg4Yu2tuShVdB.nWcW_eQ5rdBD_w39fFanMPeehbyEvKGXeLuICuA2OmxTCspluOF MgVaeQFz1Bq2jbDR4ztKaMMlm3TLoJV4OM5iwTNGG7Y8TbFNwg5eNpYG5PGhAAIqZGZYzRnrrflA Eb6qGyXYxrE3WQEOWA_VPPfRjQxIq8Y2OwEy_MnSFLpH6dSUao7Mlc6mCoJ5srqkxNGQknZjsvEl gvfxPeaFxCJi1nL17NzI3mL5pHGpA_FlZhNpKirY7Kxt9pi.NoOqHODmgmXY3ejE_JZn6Sy9jwTp gyTvAs69hxU_EWwHBp2bcGdU.1H3R1gmivnCxhqQGkNJUMs2Rhv8.91Cf44K2BM6T0SPopSRFv7h Wcs6GJm_kwbYnTQ0YHNGWlFlDZzR2A1XdhhGd7Tm5mbvAn4p9m0krskvylq_Tw.kEoVmRl3jmjP1 sdQoA9HrSaCDoxZ9tXxJNI.r47FQ8K4Y.U2DajiTeaYZPKIS5GgVEx9529NoXbwBwnuJEn9o1QGm w5iWIwyvRczKv3y27qKnpRRrgJc.QVYRkHZ5shID6zj9uEAHgXnrYN3Rwf8lVZ9LPs1ScRxuEeyc AZIIWaiPadnZ6WJsG_MPGLJy5lKBj0oh3lBogkKmZ1REWo0TO3GzE9y6ByEesgaaqh0B6BQl7HGE 0h0UK2Dkr_4NecYqlEKQDfzkD8hmIQNNvstO4cuJ_MLTrwlPS.W5O2XVrnxhwqe7a4xnGnyOfbaK hS7ju5Rte.NzmjgtNhP19bXJtKeT84t8tKbgIfTSZ_2mcDvyrGaXbrVtHsf5aVZSw6XfB1yMuyhl BU0zKIADO2OxUnvFdqCtNGCHj_H4UO2xhHSVEsTehyZRhUVLbdKvs.coD7TOEEN9WSYT7RUDkO_q fbKC2Rt6paXMYrmz55uaotWyeJvOcUkOR4BIT3ynTuUlYkNLWNqQyPiSaZdG0eEmU4q6oIbRa7R1 SzfYkKyIeaeHcHR1_y8V.KLwpUSPgTxowCIy5cQAyUEKxBVmisWtHNE6.qLzi8yZn4ZfbHG8ToME u.3ziqM43httAIr6_9Xk4z5_RFGg3BdBJOHOscFj1OGubPVt_UVA0p4rt1k9lHX90UitR_LhS_WG 5OAqAehlYM0Wm9o7KTM9nK4XTD3mALxvO6aZbn.Fxs8_bsvhhTf_sI9ZpWAJGV1yavS91n04- X-Sonic-MF: X-Sonic-ID: 8101b112-3b19-4514-afca-dfffc1d04c37 Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.ne1.yahoo.com with HTTP; Mon, 13 Mar 2023 08:28:19 +0000 Received: by hermes--production-sg3-67c57bccff-d5ptt (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 6de7d0daf66347dd26565e4b980276cd; Mon, 13 Mar 2023 08:28:16 +0000 (UTC) From: Po Lu To: Robert Pluim Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <873569vzuv.fsf@gmail.com> (Robert Pluim's message of "Mon, 13 Mar 2023 09:07:20 +0100") References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> <87fsacx2qf.fsf@gmail.com> <87o7ozepf7.fsf@yahoo.com> <873569vzuv.fsf@gmail.com> Date: Mon, 13 Mar 2023 16:28:10 +0800 Message-ID: <8735699ht1.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.21284 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 381 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62009 Cc: Philip Kaludercic , michael_heerdegen@web.de, Daniel Mendler , Gregory Heytings , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, Eli Zaretskii , Augusto Stoffel X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Robert Pluim writes: >>>>>> On Sat, 11 Mar 2023 15:07:56 +0800, Po Lu said: > > Po Lu> Why does this have to be in SSET and not in PURE_P? > > That would work as well, although I thought purespace was going away? > > Robert Once pure space goes away, we can change the call to PURE_P in Faset to only check if the string is read-only. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 13 07:46:51 2023 Received: (at 62009) by debbugs.gnu.org; 13 Mar 2023 11:46:51 +0000 Received: from localhost ([127.0.0.1]:33767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbgde-0005TX-S2 for submit@debbugs.gnu.org; Mon, 13 Mar 2023 07:46:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbgdd-0005TL-53 for 62009@debbugs.gnu.org; Mon, 13 Mar 2023 07:46:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbgdV-0004LW-RE; Mon, 13 Mar 2023 07:46:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=kB40i7n0SDgWlUBu9Ij8RAuYAVtsh0qefvU1Oe1JigU=; b=RpsAyT2pA6mp ehZa6UhyNWIVWNGEIdVO0CZFcV5rvX81r8JKsZbF5XXwmqGs/6OcQUOgphemraB4TIrk8d06OSQMW r7BM9ymzk8FY6QhuIO8bvpCuYaScW2jX19f2dN+YXe+3YCs31d7KFz9qOw+DWoiY31/wlkNTEWw6+ uo3452GeWc00HLZY4a/oN8gMcudrgXVITU2SOO1BmpGgNR5r1cgqXFDb5itgm0CwZ/aI4fZWpxmUE c60tHZEyPu1tpMQWObFluusHJ0va9PHrT+Rj36SnD1P5g7o7YTVPSilA3N2EbNbvnnCIGRdQ0adTw VuvYhZn22CsC2ccUAjRomg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbgdV-0005Hu-4l; Mon, 13 Mar 2023 07:46:41 -0400 Date: Mon, 13 Mar 2023 13:46:30 +0200 Message-Id: <83lek0ub55.fsf@gnu.org> From: Eli Zaretskii To: Robert Pluim In-Reply-To: <873569vzuv.fsf@gmail.com> (message from Robert Pluim on Mon, 13 Mar 2023 09:07:20 +0100) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> <87fsacx2qf.fsf@gmail.com> <87o7ozepf7.fsf@yahoo.com> <873569vzuv.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, mail@daniel-mendler.de, luangruo@yahoo.com, gregory@heytings.org, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Robert Pluim > Cc: Daniel Mendler , Philip Kaludercic > , michael_heerdegen@web.de, Gregory Heytings > , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, > Eli Zaretskii , Augusto Stoffel > Date: Mon, 13 Mar 2023 09:07:20 +0100 > > >>>>> On Sat, 11 Mar 2023 15:07:56 +0800, Po Lu said: > > Po Lu> Why does this have to be in SSET and not in PURE_P? > > That would work as well, although I thought purespace was going away? At some point, yes. So we shouldn't build any new features or improvements on aspects that will disappear when that happens. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 13 07:47:59 2023 Received: (at 62009) by debbugs.gnu.org; 13 Mar 2023 11:48:00 +0000 Received: from localhost ([127.0.0.1]:33772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbgel-0005XK-AH for submit@debbugs.gnu.org; Mon, 13 Mar 2023 07:47:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbgej-0005WY-Op for 62009@debbugs.gnu.org; Mon, 13 Mar 2023 07:47:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbged-0004fK-KB; Mon, 13 Mar 2023 07:47:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=S6gh4cokcC3E68xoyycdyZJhR0qM4Ic5xoKtYvoOfcQ=; b=Gm8FMy0qnYcP fq3uTDpNPwwj2mADEjS34+uIQhjLWE3LGfVq8W9+BW+HliEMipqJ0CZAiDmZ4oBxue0xIAMWKnX0T lavGsKXXUjcXE0o2q3Pe2nTJsGCmmQnRX5P1VOVWKXAy2BnRkaP81007yEzYg53a5WlHpjcHZRdOS ZPrgdw2dGmcbjfDhij/R4shZ82MiTxLTaMO8n3FbBVYES9+kOisfwG9QqvpNySxYSs3KZRJDAgOGW dQ5TkURTtlratnjowdav+IZtwwS9DGg6gEggLWPmlwVP54THgQzwL2lR4CGvKGxzj1KHgYbtYwufs Qf6atyMOVxAN2m64a/Cdaw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbgeb-0005Ry-FN; Mon, 13 Mar 2023 07:47:51 -0400 Date: Mon, 13 Mar 2023 13:47:39 +0200 Message-Id: <83jzzkub38.fsf@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <8735699ht1.fsf@yahoo.com> (message from Po Lu on Mon, 13 Mar 2023 16:28:10 +0800) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> <87fsacx2qf.fsf@gmail.com> <87o7ozepf7.fsf@yahoo.com> <873569vzuv.fsf@gmail.com> <8735699ht1.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, mail@daniel-mendler.de, rpluim@gmail.com, gregory@heytings.org, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: Daniel Mendler , Philip Kaludercic > , michael_heerdegen@web.de, Gregory Heytings > , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, > Eli Zaretskii , Augusto Stoffel > Date: Mon, 13 Mar 2023 16:28:10 +0800 > > Robert Pluim writes: > > >>>>>> On Sat, 11 Mar 2023 15:07:56 +0800, Po Lu said: > > > > Po Lu> Why does this have to be in SSET and not in PURE_P? > > > > That would work as well, although I thought purespace was going away? > > > > Robert > > Once pure space goes away, we can change the call to PURE_P in Faset to > only check if the string is read-only. There's no reason to believe someone will remember that. Just don't add anything that will require changes when we remove pure space (except if it's specific to the unexec build). From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 13 07:51:09 2023 Received: (at 62009) by debbugs.gnu.org; 13 Mar 2023 11:51:09 +0000 Received: from localhost ([127.0.0.1]:33777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbghp-0005ec-46 for submit@debbugs.gnu.org; Mon, 13 Mar 2023 07:51:09 -0400 Received: from sonic316-22.consmr.mail.ne1.yahoo.com ([66.163.187.148]:32974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbghm-0005eC-FX for 62009@debbugs.gnu.org; Mon, 13 Mar 2023 07:51:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678708261; bh=3nCWkVZT8I0tQgjLUtDWmcwKjd4r611OHAY55tSGY3Q=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=Pml42SxhMhSSdEtfN825Htc42N/T8FmhkGezu1Cyjx4q2YXdQ1Nj2KEhQKhoD7s7ftkSp5N2RZEhXksQNpBvqFfUElQVgfaIN2SmULgyyWgVIJ3RV9TVEVQMjvB7DnzmlNANmghyklvbYxQHHMsrYkWZnBs5gtC5Cinc1nIW7ar/1Ieb2Nq+aPv3fQet8xdIc431NL/zhgKugCfnsds0KhPYbhGZAJToMn0jviSu1JTCLHmfxFoRWvHJS4VaoxahEuuBTVXHcbyOzoPKeITtHdVcEVMx2xzV8TknjiTWdDKB8iG6H3SohqQCoc0vHQmwWwZLrXgl4eeBLuv8sgxfEg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678708261; bh=nHbjkobJZMvSEBQ54r8F8arwiaFs8UO4gyeYCdWnLhw=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=mwUw3P+qrySl4D6F9C94uVY6PJE+fruhD4os18NhWvjF1dlx5nyZQ9daKde5UPKnJ/H2qFDqsFd9ItxM227D4FoRa1PAAoZ2E92BaC0fmzOn77pwlzOXpdSadaDntORr3Rjl52qgd3TUKu8kHB7aCG8mStvb+ae4Q6i15cWMwerxQJWcPh0Sp/TYhk2ZoC19PAGpfUuMw2i5YJ9XjxSsd49SkJwW7HuIMsC/IxMKQARkaJGPNKzZeKOeiGzM6l1T0jh8L3bg6bKKJYjJAthGNW4KFMew+htsP523Iv7b05hKXwJi14Um699E+b7bIVve7AAs5GRAcJ42Kc0QDAcWSA== X-YMail-OSG: ughsANAVM1nrrTpNeB79nBNaD8hXe4ZVh0B2zijtFDXQ_LrYnroYC3UR1GZWLem Uxsh4wQUa65ZiDj5n1B1ggVU9s84aF4joSKGrZYtfdHb3OFQ.edRB1tEfmA4.oMz8pliQNXYiBG0 rXtvu2fY_j88FgreZDJL6TFAS_erR_I5c41ogAlDw8uGQbPTTMcVLoJ1G574BNxtADb_O5zgcaRv y_G8Pq5lwa80MTmLv0dqPM6oZzuVhOZ459cpTraP9pyuayGDfwijYseqOQh1tvhKUTcOcXsI0muV Fp.scR4D8Xauu49tgZaVQtSdo7yj2szBp0Yz2mPPQG2mTwiWbo8tl_olAkVfRCFHRuvEG4cIXgUJ MT6fJkd6fVF5VgbpIQTWgP8ctmcmXcE.hs_J9iQuCajmZ1lBFUKuQ8d1uI9wQaIv0w2bEWVYU6f4 UMsE2u_VhbWeF5cRAbbNuS80F5vbwQTIVc4jaOpsFPMKQCZtDazt0dXkYmaFM3xbqVODvo278J.e DMbApL7LFpv0ykYeQ..Izq.ZWHJWOqH0CjFe_68zUaku1E9LBANv5jBf9qdTqYUwCUjFJqLUYxvY 5B6ku4iFCYxj9.tOhtymRTCwx.fIulg7hKpV8HxcPN1WV8zDQSu9PG883m3wwGxFfPqPd6H9lkmN aWw8pbZKy9t5BYScmYj3pdAkSSdLNsW4TCC.D_jraFLCvgF0BQp70HBnuiUHJavnZJdWTw7HCg47 uMBIuPxxZt6wb8mdfdXgAMtQOBYo4BLpklnbxZ0O6IuafdIN4sg5ISFo1eTTAZEqdFoa37dUGjs6 csxbY.H7aoBSPsaaOHS__7htzMK3KzQH0.VfEnSnt_9thsHYRkiFa5x9X4SKZWXpVEP8spmeCqwO DG6i.dOwIrbow2HqQYfGDoPEc6NSFNGPByiiLHPKPiQ2PSjIbqkJ5pjLdYr5FoM6LSoZgco4RDkr mtZ5A4pOgLk0c7yHEjkJB6tfsC_d4jqr0HTpwqU3y0HwjPDkzOzRFsUxsMUrkQqrB1WmwCs8wBEN IouuEjzICt.0L.tIbnta.ul9BDlAaCjHBQQvd_6vvuJ4pRNKnHgSgriZbaqz82UVHQ7S79unheXK LW1hopkLaydiwSUvlbo07d3QQcF083SQABgLN5HTERXanr_JAvwsxgTxfiDpyUkVztmn2sfmFoo1 _VSu67q9InoOj3wxdoRJGC.AeYgs2tE167DZ7BTNNoUP_c1AkW.Vv83X5GcQWT8VhVkDJr9d8FVY 8.NkQV6P92c0ZfZR3Ar0K4_2Pov83TR.yiOnVWjLMk74Uqe3BGl7gw0JIVNQOM9lIIp4j6y9ISSp zY76aPfzlD5ERE4hrWOlpIpoTIqxKIJvLqWlVLeZBrF00by1ieHrv7LKNAo2bQ3jnS8xpZmhz.iI wpNJdDc77zDrVPsi4SV0yvboex8ZtM_gexyJXGHZvby5AXJQhYz4Uvr163U9iP55SYEDwIkoDhYV RuTLJpLKL8zEkTQ9d5SWjrdIQD6Q_2WDDDBOgT_Chg12DIlnxww_YfVzF5EBEomzK51HDZA6Jmvn WdAgVBYfHEvUPyzJJMpOY9eTM9gMXKKE2hMn6iCSlWtPn_C87nyUYSt4rYK5zyR8WSPIVbafeTjA RDLTEfVCZem3oznC2CSQwFZAVoIQIqLP8hKlGhBIQ93Fgapo.7d6Lx.pxHM.nesTugNDm0wTNlGl 552q4s9en6_nrjXwW.l_oWfb17WIfvDA0TXvQ3zFN7NdpmkCnjb26YHm1pmoq_niEhn8BEfLdpFy .9h5n150Y8aUmIgdRi3F7mGgTgEJWNd3hrpWKt6ECie.E0EBaQ2Yeg0GQrCtuuoFZ6DGANzlZpDe Sz6DAynmmosorWRhaLyT6yGPzqdQb.7.2RYwOPRSzBLM63sTLYp59dWmZ18mjKP8trupj3pDtBsN RrSAnP74Siv4p.EhpfPiZ8IRE9kSamnlMy9r9i.IrtkrC8IBF2j2sL25gx29rL3z4bGhqBeHt0tW Dh3.8SXE_Smh2tfAbhkGzq2Qc0DnNHCrhsr8R7gjWh8yP9scBFzXrIVYyn4koPSC4mWR3VEkY3mC yxOZZaychdDjjosMzVGi2ONpDAtqW3MmM_Q.9eaIBnK27kpheWXeD_z4K25jHSBL3SVpCZavz9lX V034Spb2RrSCzZjV7RzZ5H4t1WBsjUIEt._sCkB4JThSAdjz.p_ZzJJXJurGfYsbKJfNKWiqYDG. I8I7BAM0Y51_33jUrDbM28NlQVJbYA8RPGYTR0jz_aCXSFfJfwJHkm4agnZMdJyJiXv8- X-Sonic-MF: X-Sonic-ID: 69eb1c33-cb36-4968-81ff-85e7d0869c01 Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.ne1.yahoo.com with HTTP; Mon, 13 Mar 2023 11:51:01 +0000 Received: by hermes--production-sg3-67c57bccff-b6t8r (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID b57d762bb66d22e3d6cdb7ffb36fd033; Mon, 13 Mar 2023 11:50:58 +0000 (UTC) From: Po Lu To: Eli Zaretskii Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <83jzzkub38.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 13 Mar 2023 13:47:39 +0200") References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <16ecbe9ea8ba9d39d058@heytings.org> <16ecbe9ea85b22d008fd@heytings.org> <43460d2c-ba80-0f2f-656c-ef0aca5667b5@daniel-mendler.de> <87fsacx2qf.fsf@gmail.com> <87o7ozepf7.fsf@yahoo.com> <873569vzuv.fsf@gmail.com> <8735699ht1.fsf@yahoo.com> <83jzzkub38.fsf@gnu.org> Date: Mon, 13 Mar 2023 19:50:52 +0800 Message-ID: <87lek098f7.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.21284 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 1045 X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, mail@daniel-mendler.de, rpluim@gmail.com, gregory@heytings.org, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Po Lu >> Cc: Daniel Mendler , Philip Kaludercic >> , michael_heerdegen@web.de, Gregory Heytings >> , monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, >> Eli Zaretskii , Augusto Stoffel >> Date: Mon, 13 Mar 2023 16:28:10 +0800 >> >> Robert Pluim writes: >> >> >>>>>> On Sat, 11 Mar 2023 15:07:56 +0800, Po Lu said: >> > >> > Po Lu> Why does this have to be in SSET and not in PURE_P? >> > >> > That would work as well, although I thought purespace was going away? >> > >> > Robert >> >> Once pure space goes away, we can change the call to PURE_P in Faset to >> only check if the string is read-only. > > There's no reason to believe someone will remember that. Just don't > add anything that will require changes when we remove pure space > (except if it's specific to the unexec build). OK, will keep that in mind. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 18 18:46:40 2023 Received: (at 62009) by debbugs.gnu.org; 18 Mar 2023 22:46:40 +0000 Received: from localhost ([127.0.0.1]:49161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdfJw-00020Q-2q for submit@debbugs.gnu.org; Sat, 18 Mar 2023 18:46:40 -0400 Received: from heytings.org ([95.142.160.155]:45144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdfJt-00020D-An for 62009@debbugs.gnu.org; Sat, 18 Mar 2023 18:46:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1679179596; bh=YQ91DQJ6SgA2wIGn628pL/DQfSeLrRES1PpJN7dv+ZA=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=8jit/7T6Hjrbshf6v62YFnsKThYdFG630Q2tssQMkHqSposGmmIIFYOrCD2qkTejC 16PUXFTlsPPism/hEK/fXxA7ppdhRLzNEdG+MWuqZoa+AFFfN0vgVqMyIqon9EoyRG ujhovGS0oEJdX5KqshJh0xWmk9o27Ic1kV33eWg0lH4xNLIj2XjOzGeg1V4olPnNXO AoKy5jdgYK4i7vyFC8S42om4oboK6jg1/VxQHDp5u64NvUEhyaaGeEoXMY1hIP54pM 3g2E5Yfm2a5GMYtYLLzNZ3DFeA39QLlJuf6SCx5j88ZVVzMUQ24x+DOIjujb9YhVuo zwYE+8KMS+PbA== Date: Sat, 18 Mar 2023 22:46:35 +0000 From: Gregory Heytings To: Eli Zaretskii Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <831qlvwb83.fsf@gnu.org> Message-ID: References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <87ilf9571k.fsf@gmail.com> <87edpx56xm.fsf@gmail.com> <83wn3ozuyn.fsf@gnu.org> <83h6uszsvq.fsf@gnu.org> <0bd86aa3966395deee4f@heytings.org> <831qlvwb83.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="gQKAngKjCo" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, mail@daniel-mendler.de, rpluim@gmail.com, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --gQKAngKjCo Content-Type: text/plain; charset=us-ascii; format=flowed > > I think being a bit vague here and talking about "dangers" should be > good enough, since not every such code will crash, and probably also not > on every platform and in every build configuration. > Is the attached patch okay? --gQKAngKjCo Content-Type: text/x-diff; name=Improve-warning-about-changing-the-string-returned-b.patch Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: attachment; filename=Improve-warning-about-changing-the-string-returned-b.patch RnJvbSAzMmYwZmUwYWE1ZmNlN2ZkNzFmODBhMTY2Njc2ZWYzZTVmMWU3YjMy IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogR3JlZ29yeSBIZXl0 aW5ncyA8Z3JlZ29yeUBoZXl0aW5ncy5vcmc+DQpEYXRlOiBTYXQsIDE4IE1h ciAyMDIzIDIyOjQxOjMzICswMDAwDQpTdWJqZWN0OiBbUEFUQ0hdIEltcHJv dmUgd2FybmluZyBhYm91dCBjaGFuZ2luZyB0aGUgc3RyaW5nIHJldHVybmVk IGJ5DQogc3ltYm9sLW5hbWUNCg0KKiBzcmMvZGF0YS5jIChGc3ltYm9sX25h bWUpOiBBZGQgd2FybmluZy4NCg0KKiBkb2MvbGlzcHJlZi9zeW1ib2xzLnRl eGkgKENyZWF0aW5nIFN5bWJvbHMpOiBJbXByb3ZlIHdhcm5pbmcuDQotLS0N CiBkb2MvbGlzcHJlZi9zeW1ib2xzLnRleGkgfCA1ICsrLS0tDQogc3JjL2Rh dGEuYyAgICAgICAgICAgICAgIHwgNSArKysrLQ0KIDIgZmlsZXMgY2hhbmdl ZCwgNiBpbnNlcnRpb25zKCspLCA0IGRlbGV0aW9ucygtKQ0KDQpkaWZmIC0t Z2l0IGEvZG9jL2xpc3ByZWYvc3ltYm9scy50ZXhpIGIvZG9jL2xpc3ByZWYv c3ltYm9scy50ZXhpDQppbmRleCA1YjUzY2JlMzEwYS4uYzZhMDQwOGFiZDEg MTAwNjQ0DQotLS0gYS9kb2MvbGlzcHJlZi9zeW1ib2xzLnRleGkNCisrKyBi L2RvYy9saXNwcmVmL3N5bWJvbHMudGV4aQ0KQEAgLTI3Niw5ICsyNzYsOCBA QCBDcmVhdGluZyBTeW1ib2xzDQogQGVuZCBncm91cA0KIEBlbmQgZXhhbXBs ZQ0KIA0KLUBzdHJvbmd7V2FybmluZzp9IENoYW5naW5nIHRoZSBzdHJpbmcg Ynkgc3Vic3RpdHV0aW5nIGNoYXJhY3RlcnMgZG9lcw0KLWNoYW5nZSB0aGUg bmFtZSBvZiB0aGUgc3ltYm9sLCBidXQgZmFpbHMgdG8gdXBkYXRlIHRoZSBv YmFycmF5LCBzbyBkb24ndA0KLWRvIGl0IQ0KK0BzdHJvbmd7V2FybmluZzp9 IE5ldmVyIGFsdGVyIHRoZSBzdHJpbmcgcmV0dXJuZWQgYnkgdGhhdCBmdW5j dGlvbi4NCitEb2luZyB0aGF0IG1pZ2h0IG1ha2UgRW1hY3MgZHlzZnVuY3Rp b25hbCwgYW5kIG1pZ2h0IGV2ZW4gY3Jhc2ggRW1hY3MuDQogQGVuZCBkZWZ1 bg0KIA0KIEBjaW5kZXggdW5pbnRlcm5lZCBzeW1ib2wsIGFuZCBnZW5lcmF0 aW5nIExpc3AgY29kZQ0KZGlmZiAtLWdpdCBhL3NyYy9kYXRhLmMgYi9zcmMv ZGF0YS5jDQppbmRleCAwZjFkODgxZTAwYi4uOTMwZDQ3NmJjM2YgMTAwNjQ0 DQotLS0gYS9zcmMvZGF0YS5jDQorKysgYi9zcmMvZGF0YS5jDQpAQCAtNzcz LDcgKzc3MywxMCBAQCBERUZVTiAoInN5bWJvbC1wbGlzdCIsIEZzeW1ib2xf cGxpc3QsIFNzeW1ib2xfcGxpc3QsIDEsIDEsIDAsDQogfQ0KIA0KIERFRlVO ICgic3ltYm9sLW5hbWUiLCBGc3ltYm9sX25hbWUsIFNzeW1ib2xfbmFtZSwg MSwgMSwgMCwNCi0gICAgICAgZG9jOiAvKiBSZXR1cm4gU1lNQk9MJ3MgbmFt ZSwgYSBzdHJpbmcuICAqLykNCisgICAgICAgZG9jOiAvKiBSZXR1cm4gU1lN Qk9MJ3MgbmFtZSwgYSBzdHJpbmcuDQorDQorV2FybmluZzogbmV2ZXIgYWx0 ZXIgdGhlIHN0cmluZyByZXR1cm5lZCBieSBgc3ltYm9sLW5hbWUnLg0KK0Rv aW5nIHRoYXQgbWlnaHQgbWFrZSBFbWFjcyBkeXNmdW5jdGlvbmFsLCBhbmQg bWlnaHQgZXZlbiBjcmFzaCBFbWFjcy4gICovKQ0KICAgKHJlZ2lzdGVyIExp c3BfT2JqZWN0IHN5bWJvbCkNCiB7DQogICByZWdpc3RlciBMaXNwX09iamVj dCBuYW1lOw0KLS0gDQoyLjM5LjANCg0K --gQKAngKjCo-- From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 19 02:04:04 2023 Received: (at 62009) by debbugs.gnu.org; 19 Mar 2023 06:04:04 +0000 Received: from localhost ([127.0.0.1]:49310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdm9E-0005qU-9r for submit@debbugs.gnu.org; Sun, 19 Mar 2023 02:04:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdm9B-0005py-O3 for 62009@debbugs.gnu.org; Sun, 19 Mar 2023 02:04:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pdm95-0000AR-L2; Sun, 19 Mar 2023 02:03:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=BsYOZITHwcDaSjn40uLwLWXp0B3fBz1aY1J49+PxCuU=; b=DKUv6ZcoAhJ/ rBQnC5+xJkLvdwIu60pY0xvzIPbadSeSfCye8IEu/X4yft2LPURAgIM9OjSBurAZikU8jDr3lBMJM YSnqZnH7tLWP2tdksuaGLHTT7OdNiYDpUTgWOIkcjp8QTK/IH/TSVvCWd4kbfXUr8ufqpxQPM6JTB MvEXkJ9Rm+TPuYRFWsIwcE80mgMhrz1G5ozjjkoacCYNP+Ar/qcomoRhEn1UHCEQs4rafdnRNIWWt kxGXeRfWZRtzkv85WOCLaXPpRbYZeQV9ag1GE6fAfg/lzk3bgcw+zw2N1qIUZ/P4COTNMDpOPf4+S L8iRpJd5Hba/Ig2uQQr7uQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pdm94-0005t0-D3; Sun, 19 Mar 2023 02:03:55 -0400 Date: Sun, 19 Mar 2023 08:03:58 +0200 Message-Id: <834jqhb7ld.fsf@gnu.org> From: Eli Zaretskii To: Gregory Heytings In-Reply-To: (message from Gregory Heytings on Sat, 18 Mar 2023 22:46:35 +0000) Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <87ilf9571k.fsf@gmail.com> <87edpx56xm.fsf@gmail.com> <83wn3ozuyn.fsf@gnu.org> <83h6uszsvq.fsf@gnu.org> <0bd86aa3966395deee4f@heytings.org> <831qlvwb83.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, mail@daniel-mendler.de, rpluim@gmail.com, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 18 Mar 2023 22:46:35 +0000 > From: Gregory Heytings > cc: philipk@posteo.net, michael_heerdegen@web.de, mail@daniel-mendler.de, > rpluim@gmail.com, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, > arstoffel@gmail.com > > > I think being a bit vague here and talking about "dangers" should be > > good enough, since not every such code will crash, and probably also not > > on every platform and in every build configuration. > > Is the attached patch okay? Yes, thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 19 17:20:34 2023 Received: (at 62009) by debbugs.gnu.org; 19 Mar 2023 21:20:34 +0000 Received: from localhost ([127.0.0.1]:52901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pe0S9-0002Gu-S9 for submit@debbugs.gnu.org; Sun, 19 Mar 2023 17:20:34 -0400 Received: from heytings.org ([95.142.160.155]:46254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pe0S7-0002Gk-Vf for 62009@debbugs.gnu.org; Sun, 19 Mar 2023 17:20:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1679260829; bh=v0jqaiOz6FokntY1tDywr9rBDBPqJYNHuwGEss9O5Lo=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=GPQmQHzUuWCpBl6UMOOSwKFiw/OQG7tCfH4cTREZz1SCzLg54cIF1BRebrYdxOUrJ uHNqEz5FMVUW9t4O6+sICe6gfWIh89lcwH0Y+gWtzZ157avad1KB5yHAdTfpWdEXli tW0gQ2dTVfX1YpSo25n82BxzFj7K1AxclVR2rT3Z334AXHIhJ9Dcbcgy2xCzu0+Ozk 95Ewp+1B4QTkn4WajMJAcJZkNTULpXmO2XTXSKys5k1wPMuaDJ8gGd8XPqUR45Y8L0 D04l2DDHj7e/dVZjl/gRPKR/PxZBqAmByeezvRRFi6/s774nQezvkKaAZfROBvR9wX mFVOHCizjYRAQ== Date: Sun, 19 Mar 2023 21:20:28 +0000 From: Gregory Heytings To: Eli Zaretskii Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name In-Reply-To: <834jqhb7ld.fsf@gnu.org> Message-ID: References: <87o7p5of4n.fsf@daniel-mendler.de> <871qm01s6n.fsf@web.de> <9fcf05e8-506c-6566-e214-2ecf3194b85e@daniel-mendler.de> <83bkl45ul4.fsf@gnu.org> <87v8j9zl3i.fsf@posteo.net> <83a60l13p2.fsf@gnu.org> <87ilf9571k.fsf@gmail.com> <87edpx56xm.fsf@gmail.com> <83wn3ozuyn.fsf@gnu.org> <83h6uszsvq.fsf@gnu.org> <0bd86aa3966395deee4f@heytings.org> <831qlvwb83.fsf@gnu.org> <834jqhb7ld.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 62009 Cc: philipk@posteo.net, michael_heerdegen@web.de, mail@daniel-mendler.de, rpluim@gmail.com, monnier@iro.umontreal.ca, 62009@debbugs.gnu.org, arstoffel@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> Is the attached patch okay? > > Yes, thanks. > Thanks, pushed (b7f0333355).