From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 04 05:17:50 2024 Received: (at submit) by debbugs.gnu.org; 4 Apr 2024 09:17:51 +0000 Received: from localhost ([127.0.0.1]:60531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsJEC-0004kA-7Y for submit@debbugs.gnu.org; Thu, 04 Apr 2024 05:17:50 -0400 Received: from lists.gnu.org ([2001:470:142::17]:35298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsIjJ-0001kz-VR for submit@debbugs.gnu.org; Thu, 04 Apr 2024 04:45:54 -0400 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 1rsIj9-0002Uu-Aq for bug-gnu-emacs@gnu.org; Thu, 04 Apr 2024 04:45:43 -0400 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rsIj7-0001bL-A8 for bug-gnu-emacs@gnu.org; Thu, 04 Apr 2024 04:45:43 -0400 Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-69185f093f5so4239626d6.3 for ; Thu, 04 Apr 2024 01:45:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712220340; x=1712825140; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=XuHSOSef0A3CWcV7KhhL0sdF00hkd1JzIoGEHWE0LC4=; b=fENvEJfkv3hsfcV+5zqiOTqJYrb4dyFtJgJarY5VCs9z1hWsl30wBVW7+f/c5OeIBl x4nfqEb3JEHrMFuaz+Bqe0UDsC9lMp2XUZteOLzbL0c9BqBkQLPT0IiXKTZ8gbAHCmO+ qkMv/OP4KX/5bbnakgTPsgNnO8poCnz2e3ttuXBmHdcO66JYQu4ecFwHF8u6obV3pWP5 G1QqPk00+ToMemw70l0kuSWAhllHHJ1RyOA2j45LK5xJonQTPyLONr3z2Dphg2iP59yq wavMqbvh9Jvv+jipTBZZFeDLRWZ/ODyz5DowbycATwum5ZTLLBGw1dT7Wh2Fhm8saW9c Kakw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712220340; x=1712825140; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=XuHSOSef0A3CWcV7KhhL0sdF00hkd1JzIoGEHWE0LC4=; b=tPpcIYoCdINYWHsR5+hOPvL/lSuuPuKRzj/bKzKfpEnz8ra4qehB4yHEk5XuFAi14R 5jz1OHaUKwocmtY/6MWFhMNHEHsEsAlwUTKVdK1jR3e2MTLn6GsQyBZj1KlDO9C982bL rbtBh7QOomXZIChQqWfeNoEEgKF24chS0Mt5r8reaD4A1aHUzRkuRtn36f7SqFrBpqgx J1QUBgpU2jvlKsLxK1wHU9EyMYXga4Gsv9vbJnISoR9DDy1SYLYkbRurcu23aEf4aBLu JFpz+/FnqHC4/o8Xe8ELk8XFgZMRz8VC+EFD/nxuMJuoWlabeT7T4D7E4F+YDM2S0Av7 T8qg== X-Gm-Message-State: AOJu0YxL4d9CPMPTvpXNleksZYOil2CgptPGgTbsdhznuwlgvxKPLFVF vogNMbN1lEGio4zp3t4BnySLFE2AefY+tORYacHZgj2buBJjH15vbfjba7XPaq91Ol+JJ2gjynZ dRbF3NYQhQN6SAupJ4mrZr9OjlPeUxik= X-Google-Smtp-Source: AGHT+IE/9lmi1awu9FB1AlFyC2z51Pzh5hSRGoQXjzfFc5g4qCrD0JltSXGKl595/6bnngdcCRPEBBYzz2RU0syz3HU= X-Received: by 2002:a05:6214:2465:b0:699:28ee:da99 with SMTP id im5-20020a056214246500b0069928eeda99mr1777487qvb.65.1712220339512; Thu, 04 Apr 2024 01:45:39 -0700 (PDT) MIME-Version: 1.0 From: Robert Burks Date: Thu, 4 Apr 2024 04:44:22 -0400 Message-ID: Subject: [PATCH] Fix + ert for segmentation fault in get-variable-watchers (1 of 9) To: GNU BUGS Content-Type: multipart/mixed; boundary="0000000000001d7d900615415ddf" Received-SPF: pass client-ip=2607:f8b0:4864:20::f32; envelope-from=rburksdev@gmail.com; helo=mail-qv1-xf32.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 04 Apr 2024 05:17:46 -0400 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: -0.0 (/) --0000000000001d7d900615415ddf Content-Type: multipart/alternative; boundary="0000000000001d7d8e0615415ddd" --0000000000001d7d8e0615415ddd Content-Type: text/plain; charset="UTF-8" (1 of 9) ** All patches in this and following emails have been re-based and tested on 7a41de3d515 04/03/2024 ** The following segmentation faults are repeatable on version 27.1 that is obtained through debian apt as well the current 30.0.50 master branch (I pull and rebuild regularly). I have attached a patch which includes a fix and ert. (Please note the BUG# placeholder in six(6) places will need to be updated.) I have rebased on master then rebuilt and tested the results. The function that caused the problem had no tests previously. The c DEFUN get_variable_watchers used the function SYMBOL_TRAPPED_WRITE_P without guarding its input. This inline function is an interface to the XSYMBOL function for accessing symbol structure data and has no provision for type checking its inputs. XSYMBOL changed between 27.1 and 30.0.50 (2128cd8c08d). So while they will both crash with numbers or lists a string or a variable with a string value will not crash the later version, though it wrongly returns nil. However, the XSYMBOL function is not the cause of the issue, it merely concealed the issue in some situations. The patch included fixes the issue in get_variable_watchers going back much further. ***Update, builds from the end of January on now also seg fault. The other functions in the variable-watcher family do not suffer the same flaw as they catch invalid inputs with CHECK_SYMBOL or rely on the error checking in Fget. Also, while simply putting CHECK_SYMBOL at the top would have solved this one problem, there is a reasoning behind me moving Findirect_variable to the top as well. One, is to make it more like the other functions in it's family. Second, is that it is actually required to fix other bugs that I discovered and will layout over the course of several bug reports, associated patches, and ert's. Bug Recreation Follows------------------------------------------------ WARNING: This crash requires just the 1 command below. Do not repeat in an Emacs session you are not willing to lose immediately. (run under gdb control ideally) Session 1------------------------------------------------------------- emacs -Q (get-variable-watchers load-path) ;; opps forgot the apostrophe.... Fatal error 11: Segmentation fault Session 2------------------------------------------------------------- Update *****These Bugs Now All Crash in 30.0.50 after the end of January****** emacs -Q (get-variable-watchers nil) nil (defvar test-str "test") test-str (get-variable-watchers test-str) ;; no apostrophe, value = string nil ;; no error?, no crash at least (this crashes 27.1) (get-variable-watchers 'test-str) nil ;; expected result (get-variable-watchers "test") nil ;; no error?, no crash (this crashes 27.1) (defvar test-num 5) ;; let's try a number with watcher test-num (add-variable-watcher 'test-num (lambda () nil)) nil (get-variable-watchers 'test-num) ((closure (t) nil nil)) ;; expected result (get-variable-watchers "test-num") ;; string = symbol name nil ;; no error?, no crash (this crashes 27.1) (get-variable-watchers test-num) ;; no apostrophe, value = number ---seg fault--- ;;crash Session 3------------------------------------------------------------- ;; A number as parameter also crashes. ;; It also happens in batch mode. >emacs --batch --eval "(get-variable-watchers 5)" Fatal error 11: Segmentation fault Other Crashes -------------------------------------------------------- ;; Session 1 was a symbol with a list of strings as it's value. ;; So I also tried some direct lists. (get-variable-watchers '(1 2 3)) ---seg fault--- (get-variable-watchers '("test" "test")) ---seg fault--- --0000000000001d7d8e0615415ddd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
(1 of 9)
** All patches in this and following emails ha= ve been re-based and tested on
=C2=A0 =C2=A07a41de3d515 04/03/2024 **
The following segmentation faults are repeatable on version 27.1 that = is
obtained through debian apt as well the current 30.0.50 master
bra= nch (I pull and rebuild regularly).

I have attached a patch which in= cludes a fix and ert.
(Please note the BUG# placeholder in six(6) places= will need to be updated.)
I have rebased on master then rebuilt and tes= ted the results.
The function that caused the problem had no tests previ= ously.

The c DEFUN get_variable_watchers used the function SYMBOL_TR= APPED_WRITE_P
without guarding its input.=C2=A0 This inline function is = an interface to
the XSYMBOL function for accessing symbol structure data= and has no
provision for type checking its inputs.=C2=A0 XSYMBOL change= d between
27.1 and 30.0.50 (2128cd8c08d). So while they will both crash = with numbers
or lists a string or a variable with a string value will no= t crash the later
version, though it wrongly returns nil.=C2=A0 However,= the XSYMBOL function is not
the cause of the issue, it merely concealed= the issue in some situations.=C2=A0 The
patch included fixes the issue = in get_variable_watchers going back much further.
***Update, builds from= the end of January on now also seg fault.

The other functions in th= e variable-watcher family do not suffer the
same flaw as they catch inva= lid inputs with CHECK_SYMBOL or rely on the
error checking in Fget.
<= br>Also, while simply putting CHECK_SYMBOL at the top would have solved thi= s one
problem, there is a reasoning behind me moving Findirect_variable = to the top as
well. One, is to make it more like the other functions in = it's family. Second, is
that it is actually required to fix other bu= gs that I discovered and will layout
over the course of several bug repo= rts, associated patches, and ert's.

Bug Recreation Follows------= ------------------------------------------

WARNING: This crash requi= res just the 1 command below.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Do not r= epeat in an Emacs session you are not
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= willing to lose immediately. (run under gdb control ideally)

Session= 1-------------------------------------------------------------

emac= s -Q
(get-variable-watchers load-path) ;; opps forgot the apostrophe....=

Fatal error 11: Segmentation fault

Session 2----------------= ---------------------------------------------
Update *****These Bugs Now= All Crash in 30.0.50 after the end of January******

emacs -Q
(ge= t-variable-watchers nil)
nil
(defvar test-str "test")
te= st-str
(get-variable-watchers test-str) =C2=A0 =C2=A0;; no apostrophe, v= alue =3D string
nil =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; no error?, n= o crash at least (this crashes 27.1)
(get-variable-watchers 'test-st= r)
nil =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; expected result
(get= -variable-watchers "test")
nil =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 ;; no error?, no crash (this crashes 27.1)
(defvar test-num 5) = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; let's try a = number with watcher
test-num
(add-variable-watcher 'test-num (lam= bda () nil))
nil
(get-variable-watchers 'test-num)
((closure (= t) nil nil)) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; expected result(get-variable-watchers "test-num") =C2=A0;; string =3D symbol n= ame
nil =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; no error?, no crash (th= is crashes 27.1)
(get-variable-watchers test-num) =C2=A0 =C2=A0;; no apo= strophe, value =3D number
---seg fault--- =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;;crash

Session 3---------= ----------------------------------------------------

;; A number as = parameter also crashes.
;; It also happens in batch mode.

>ema= cs --batch --eval "(get-variable-watchers 5)"
Fatal error 11: = Segmentation fault

Other Crashes -----------------------------------= ---------------------

;; Session 1 was a symbol with a list of strin= gs as it's value.
;; So I also tried some direct lists.

(get-= variable-watchers '(1 2 3))
---seg fault---

(get-variable-wat= chers '("test" "test"))
---seg fault---
--0000000000001d7d8e0615415ddd-- --0000000000001d7d900615415ddf Content-Type: application/x-patch; name="0001-Fix-ert-segmentation-fault-in-get-variable-watchers-.patch" Content-Disposition: attachment; filename="0001-Fix-ert-segmentation-fault-in-get-variable-watchers-.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lukv417g0 RnJvbSAwYWQxZGIyZTkyMTJhNGJhZmFjMDRmOTRhZmZhZWVjZjBjOWJiMzkyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiAiUm9iZXJ0IEEuIEJ1cmtzIiA8cmJ1cmtzZGV2QGdtYWlsLmNv bT4KRGF0ZTogU3VuLCAzIE1hciAyMDI0IDE1OjUwOjU1IC0wNTAwClN1YmplY3Q6IFtQQVRDSCAw MS8zMV0gRml4K2VydCBzZWdtZW50YXRpb24gZmF1bHQgaW4gJ2dldC12YXJpYWJsZS13YXRjaGVy cycKIChidWcjMDAwMDApCgpBZGRlZCBjaGVjayBmb3IgdmFsaWQgc3ltYm9sIHByaW9yIHRvIHBh c3NpbmcgaXQgdG8KJ1NZTUJPTF9UUkFQUEVEX1dSSVRFX1AnLgoKKiBzcmMvZGF0YS5jIChGZ2V0 X3ZhcmlhYmxlX3dhdGNoZXJzKToKJ2dldC12YXJpYWJsZS13YXRjaGVycycgd2lsbCBubyBsb25n ZXIgY2F1c2UgYSBzZWdtZW50YXRpb24gZmF1bHQgd2hlbgpwYXNzZWQgaW52YWxpZCBhcmd1bWVu dHMuIChCVUcjMDAwMDApCiogdGVzdC9zcmMvZGF0YS10ZXN0cy5lbCAoZGF0YS10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zMpKQorICAgIChzaG91bGQtZXJyb3IgKGdldC12YXJpYWJsZS13YXRj aGVycyBmb280KSkKKyAgICAoc2hvdWxkLWVycm9yIChnZXQtdmFyaWFibGUtd2F0Y2hlcnMgZm9v NSkpKQorICA7OyBXaXRob3V0IEJVRyMwMDAwMCBmaXggdGhlIHRlc3RzIGJlbG93IHdpbGwgc2Vn bWVudGF0aW9uIGZhdWx0CisgIChsZXQgKChiYXIxIDUpCisgICAgICAgIChiYXIyICcoInRlc3Qi KSkKKyAgICAgICAgKGJhcjMgWzEgMiAzXSkpCisgICAgKHNob3VsZC1lcnJvciAoZ2V0LXZhcmlh YmxlLXdhdGNoZXJzIGJhcjEpKQorICAgIChzaG91bGQtZXJyb3IgKGdldC12YXJpYWJsZS13YXRj aGVycyBiYXIyKSkKKyAgICAoc2hvdWxkLWVycm9yIChnZXQtdmFyaWFibGUtd2F0Y2hlcnMgYmFy MykpKSkKKwogKGVydC1kZWZ0ZXN0IGRhdGEtdGVzdHMta2lsbC1hbGwtbG9jYWwtdmFyaWFibGVz ICgpIDtidWcjMzA4NDYKICAgKHdpdGgtdGVtcC1idWZmZXIKICAgICAoc2V0cS1sb2NhbCBkYXRh LXRlc3RzLWZvbzEgMSkKLS0gCjIuMzQuMQoK --0000000000001d7d900615415ddf-- From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 06 03:25:27 2024 Received: (at 70182) by debbugs.gnu.org; 6 Apr 2024 07:25:27 +0000 Received: from localhost ([127.0.0.1]:38071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rt0QZ-00050u-2J for submit@debbugs.gnu.org; Sat, 06 Apr 2024 03:25:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41758) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rt0QX-00050R-3F for 70182@debbugs.gnu.org; Sat, 06 Apr 2024 03:25:25 -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 1rt0QL-0006sA-On; Sat, 06 Apr 2024 03:25:13 -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=dUW/cbGjVT8mU0eWKM8cOHrBIG8isGjbxBkZMUUjWGE=; b=Q4pEKd2Ejz3q TLyyMiDCSxa4/APQE1y+b0syIA1mV9h1px4+9VyDzFZhDvx9GbU6Q3pyORB90jnU8+0nmaecjOGYA rm9pMBaqCph/VsaEtepVzuyhzCbohQZ43aAcnCihLv3XaimaPcZCD6l535BAKTC9M4rA9Wmp3nG4i q3+oCj3prRHonOoduOhxDi6rm9sOLzu09ejStU8CmR9djWe2TCfIXQ2NsyKp80beTjEpassw6n9ao KXkCcYfwvvnLtJuoGXtVELafKdsj4NYLpLZrKJ6aYb7qT2uj6ai2Ic1DjjrkU3CvghgvOs0p9NFa9 q//YZn2VQZwBcmcsjyNHqw==; Date: Sat, 06 Apr 2024 10:25:11 +0300 Message-Id: <86sezz3qco.fsf@gnu.org> From: Eli Zaretskii To: Robert Burks In-Reply-To: (message from Robert Burks on Thu, 4 Apr 2024 04:44:22 -0400) Subject: Re: bug#70182: [PATCH] Fix + ert for segmentation fault in get-variable-watchers (1 of 9) References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70182 Cc: 70182@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: Robert Burks > Date: Thu, 4 Apr 2024 04:44:22 -0400 > > +++ b/src/data.c > @@ -1838,7 +1838,7 @@ SYMBOL (or its aliases) are set. */) > (Lisp_Object symbol, Lisp_Object watch_function) > { > symbol = Findirect_variable (symbol); > - Lisp_Object watchers = Fget (symbol, Qwatchers); > + Lisp_Object watchers = Fget (symbol, Qwatchers); /* CHECK_SYMBOL is in Fget */ This commentary is not needed here, so please remove it. Also, please note that our conventions are to end a comment in a period and two spaces. > + symbol = Findirect_variable (symbol); > + CHECK_SYMBOL (symbol); /* BUG#00000 Must guard SYMBOL_TRAPPED_WRITE_P */ This comment is also redundant: the fact that we check a symbol doesn't need any explanations. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 07 03:58:16 2024 Received: (at 70182) by debbugs.gnu.org; 7 Apr 2024 07:58:16 +0000 Received: from localhost ([127.0.0.1]:41497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtNPs-000342-Ej for submit@debbugs.gnu.org; Sun, 07 Apr 2024 03:58:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtNPq-00033p-7s for 70182@debbugs.gnu.org; Sun, 07 Apr 2024 03:58:14 -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 1rtNPe-00076d-8x; Sun, 07 Apr 2024 03:58:02 -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=y4pAVb8j2sWHSWlTzO60KZaupLav0gHw875LzWrBiDU=; b=DlqpYr7URWS6 13sNyB7IW5lPVLplKQMOb44w+JO9c+ccL4jF5Y5LeE6Y4Auo5CxAN3s25aWSOr8GPKenYFv19N2iA dGf46rSd9JdBX6Qr2+4VNOkO41DaiVWRgPTZwc4bthYHSegUlUEV5It2efNCqnG5xOh2SJ6Hcmo+P grnMp41NWq+9Dzg/BlXqhsnZz/GCdv/Js6Rk4ZQPsZtLiS5SBLqw2kXFQuFnd8PDyk+eSZwY007Oi hVaQr6YgsxsddgciFbTDwDhTi8cj2/6hu+CTJDasJTCVhjuIvaYg9jhVK/+PAPrjtw4qXsMDGIKNV P8MpPCNyUpsKP+l/dNkWgw==; Date: Sun, 07 Apr 2024 10:58:00 +0300 Message-Id: <86bk6l1u5z.fsf@gnu.org> From: Eli Zaretskii To: Robert Burks In-Reply-To: (message from Robert Burks on Sun, 7 Apr 2024 02:30:54 -0400) Subject: Re: bug#70182: [PATCH] Fix + ert for segmentation fault in get-variable-watchers (1 of 9) References: <86sezz3qco.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70182 Cc: 70182@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 (---) [Please use Reply All to reply, to keep the bug tracker CC'ed.] > From: Robert Burks > Date: Sun, 7 Apr 2024 02:30:54 -0400 > > I will make the changes. Sorry if my previous reply came across as rash, wasn't the intent. > Should I remove the bug number tag also? The bug number should be mentioned in the commit log message, not in the sources. > Also, kicking myself, I know they should end with a period and two spaces, every other > comment I've written probably does. Somehow the only ones I didn't check was the very > first patch, lol. That first comment wasn't even supposed to go out, that was my personal note > for when I was going through looking for more of the same bug. > > There will probably be other comments to remove. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 08 00:56:35 2024 Received: (at 70182) by debbugs.gnu.org; 8 Apr 2024 04:56:35 +0000 Received: from localhost ([127.0.0.1]:45088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rth3a-0004ck-6s for submit@debbugs.gnu.org; Mon, 08 Apr 2024 00:56:35 -0400 Received: from mail-oo1-xc30.google.com ([2607:f8b0:4864:20::c30]:57561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtWZw-0002ff-FY for 70182@debbugs.gnu.org; Sun, 07 Apr 2024 13:45:16 -0400 Received: by mail-oo1-xc30.google.com with SMTP id 006d021491bc7-5aa2dcd4454so334539eaf.2 for <70182@debbugs.gnu.org>; Sun, 07 Apr 2024 10:45:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712511903; x=1713116703; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=qbX6cxzEDbxIkQsSpb5+/yqhIjaoEftM0Z4y+wsEgKY=; b=GhXDKTcZrEtbpFFXoE56VQ/aYdBAaJGvI0iI8RuTVv0bZhEtk6Iut58N5IVXOA+USR 3eFkJKgAoBHp/uzcxvY7otmQrijXLnM5n361m0GC42DPhRwttmf7SXUNNUW3sisKh7wh IiD124TzpdOEMJU8yz4msSAmIITm1qpXfUbiPG3AOLXfjSjBh32xtkdYvyU0xI1XiaTr o2Zq4Ccug6upKYYdk3HR+HosHY3kVVE2ISzsaFJHShLMADyiSOAxXmxFBbtFHno63mSJ im6LUk/8kJ8Txc1VL8FZCz1jBwmV7wkKsUP3pEsTWT43kT3UMzx31tB+Jae5HrJ/v02q dS8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712511903; x=1713116703; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qbX6cxzEDbxIkQsSpb5+/yqhIjaoEftM0Z4y+wsEgKY=; b=bQsLVrBgUt9SbktWTjLT54YPH2+rtVH/1oJAkvPxhX7tH/7qxXfgStN80oyWrFTUPM 4ZhCyyuUG2Ql2RiuhZTAf1wwEWC0Hbv+OUW7RA9mdfg7bvbOdcEY1FPTFllOcduMn3mG OTXaLrXk3JP1muWwu1s+/Q+wck5gDw5iara7bmHNXUyJtNvsZfdSgSD6rDnyWp01FH12 ShboHqtO6pDucbMHqY4Rez6mNBq0d/933FfLGRBOeheaZi/LIv9zstFIIFaGhYHGz3fC A3TXEc+udWXrP1ktME+hn2TEi/jI84myhmTKySCk1qtAuc31k2dXv9CM9YbLX5mNOlQH /xrA== X-Gm-Message-State: AOJu0YyrrYqN9smI2j58zL+TAqq4yDNFa8M4daxkbCcLMft96vx+xukk OM5wdGPErsBeYQ7O1jtYtdYsJY9EJaabj3G4SZZJQHSYWXxk1rb3sebAJHQWdZZBK2nwlbljmhw TstOYPP8/gQRgB2/L/NDA3nm57g== X-Google-Smtp-Source: AGHT+IExgVN4lDnuZXhvUo15WFgiRvj8eS9hVs1vvbqNj9RMcaRKt2Rwah5nvOPbxTOSoxZbmJaKOiWQjXQMHHBeQqY= X-Received: by 2002:a9d:618f:0:b0:6ea:194c:d1c6 with SMTP id g15-20020a9d618f000000b006ea194cd1c6mr312746otk.25.1712511903663; Sun, 07 Apr 2024 10:45:03 -0700 (PDT) MIME-Version: 1.0 References: <86sezz3qco.fsf@gnu.org> <86bk6l1u5z.fsf@gnu.org> In-Reply-To: <86bk6l1u5z.fsf@gnu.org> From: Robert Burks Date: Sun, 7 Apr 2024 13:43:45 -0400 Message-ID: Subject: Re: bug#70182: [PATCH] Fix + ert for segmentation fault in get-variable-watchers (1 of 9) To: Eli Zaretskii Content-Type: multipart/alternative; boundary="000000000000b10f980615853f20" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70182 X-Mailman-Approved-At: Mon, 08 Apr 2024 00:56:31 -0400 Cc: 70182@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 (-) --000000000000b10f980615853f20 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Got it. On Sun, Apr 7, 2024 at 3:58=E2=80=AFAM Eli Zaretskii wrote: > [Please use Reply All to reply, to keep the bug tracker CC'ed.] > > > From: Robert Burks > > Date: Sun, 7 Apr 2024 02:30:54 -0400 > > > > I will make the changes. Sorry if my previous reply came across as > rash, wasn't the intent. > > Should I remove the bug number tag also? > > The bug number should be mentioned in the commit log message, not in > the sources. > > > Also, kicking myself, I know they should end with a period and two > spaces, every other > > comment I've written probably does. Somehow the only ones I didn't > check was the very > > first patch, lol. That first comment wasn't even supposed to go out, > that was my personal note > > for when I was going through looking for more of the same bug. > > > > There will probably be other comments to remove. > > Thanks. > --000000000000b10f980615853f20 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Got it.

On Sun, Apr 7, 2024 at 3:58=E2=80=AFAM Eli Zaretskii &= lt;eliz@gnu.org> wrote:
[Please use Reply All to rep= ly, to keep the bug tracker CC'ed.]

> From: Robert Burks <rburksdev@gmail.com>
> Date: Sun, 7 Apr 2024 02:30:54 -0400
>
> I will make the changes.=C2=A0 Sorry if my previous reply came across = as rash, wasn't the intent.
> Should I remove the bug number tag also?

The bug number should be mentioned in the commit log message, not in
the sources.

> Also, kicking myself, I know they should end with a period and two spa= ces, every other
> comment I've written probably does.=C2=A0 Somehow the only ones I = didn't check was the very
> first patch, lol.=C2=A0 That first comment wasn't even supposed to= go out, that was my personal note
> for when I was going through looking for more of the same bug.
>
> There will probably be other comments to remove.

Thanks.
--000000000000b10f980615853f20-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 22 07:06:28 2024 Received: (at 70182) by debbugs.gnu.org; 22 Jun 2024 11:06:28 +0000 Received: from localhost ([127.0.0.1]:44554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKyZf-0003xH-Na for submit@debbugs.gnu.org; Sat, 22 Jun 2024 07:06:28 -0400 Received: from mail-ed1-f51.google.com ([209.85.208.51]:53483) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKyZe-0003x4-48 for 70182@debbugs.gnu.org; Sat, 22 Jun 2024 07:06:26 -0400 Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-57cc30eaf0aso1580804a12.2 for <70182@debbugs.gnu.org>; Sat, 22 Jun 2024 04:06:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719054320; x=1719659120; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=lkNThm+uGwhUIftRKohK03b9KkdpTjfJXMLfQFDA00w=; b=Zx2a+rFVsbTgnq9nywpp+iVmCfaEpsUTbF5pAR3zoYACGeDEQ5vsu4CQN0ofjgU6o/ 7fk4HSpiPrrDjcp7aiyYMwjOkV7/NIGpFZlPHPdM5gpNn5z59N8ndRcOSRjZ/R6qQIfA vL9IJLh5gVfjqd++Hy67HMpL5N2557Hb8sVvgtH+6DJ06DabcVyLzCUewL+P1m4+B9LJ 9bpdy63nkEjUnAIN+jvV9dyw5uQQx2EwdeNjLrdIODkUnWlCE3fHHikXolKZQUlp7YbI 387peU4t8l9WOUXEHpOOmPlVsVofX9Yb/9pt1XbOWxyo0JuEa//kt3YXqkkxnPOi1dB5 up6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719054320; x=1719659120; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=lkNThm+uGwhUIftRKohK03b9KkdpTjfJXMLfQFDA00w=; b=TE/nHrVJcPZoVS+SuUyzhSu0Ytf+5UhL+rJ5vFr7Xekc+cLJOMfxo1d/frC9sE3Eie 5DZfjESbIRYKGQDbHjPOlS0AeI/8X/ZBTaD987/jrxGlPfgsvtmLAtX8PacGi44AzZsk p3nV0r3ptQP04x8WjYOIkPSTV1yYYnFjUxYfLZqlggHLyQ7gwxr6KnonenLpfghE0s7e RvTahDVgZdExeN6/AJwq7is6z2EANCbMhS8a32I5qAvrvYtrZBgFar0jYwhjP0X9pdGG xyFtJ79w+61zdpVerOKdKuI47OYA6nxbAltmMX8MgtQe6t0HKZ99ANAgC1qpL7luY7kB BgYQ== X-Gm-Message-State: AOJu0YzTN77tteDQpcul+QEcMACiPJBbuBxtEVco7ElNLsn4tw7mfYtb Vfd1ariWPEAdikHGVPIu72U3jFRVRBow6LcoEACdJ3Qtd7aXjntPGAtbbPtXXRA07bbboxNOX94 cJI7c0b2Cj5pTQxCB41fRvdSGIew= X-Google-Smtp-Source: AGHT+IEASf7t4wcmaeUINuHBt0de0qGuCcwK0Ulav4XicDt1k4vtum0P7nB0BnyUwsqISphzIq402OSMt/bEmrbiNyQ= X-Received: by 2002:a05:6402:2789:b0:57d:f84:11aa with SMTP id 4fb4d7f45d1cf-57d0f841369mr10601706a12.31.1719054320284; Sat, 22 Jun 2024 04:05:20 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 22 Jun 2024 04:05:19 -0700 From: Stefan Kangas In-Reply-To: References: <86sezz3qco.fsf@gnu.org> <86bk6l1u5z.fsf@gnu.org> MIME-Version: 1.0 Date: Sat, 22 Jun 2024 04:05:19 -0700 Message-ID: Subject: Re: bug#70182: [PATCH] Fix + ert for segmentation fault in get-variable-watchers (1 of 9) To: Robert Burks , Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70182 Cc: 70182@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 (-) Robert Burks writes: > Got it. > > On Sun, Apr 7, 2024 at 3:58=E2=80=AFAM Eli Zaretskii wrote= : > >> [Please use Reply All to reply, to keep the bug tracker CC'ed.] >> >> > From: Robert Burks >> > Date: Sun, 7 Apr 2024 02:30:54 -0400 >> > >> > I will make the changes. Sorry if my previous reply came across as >> rash, wasn't the intent. >> > Should I remove the bug number tag also? >> >> The bug number should be mentioned in the commit log message, not in >> the sources. >> >> > Also, kicking myself, I know they should end with a period and two >> spaces, every other >> > comment I've written probably does. Somehow the only ones I didn't >> check was the very >> > first patch, lol. That first comment wasn't even supposed to go out, >> that was my personal note >> > for when I was going through looking for more of the same bug. >> > >> > There will probably be other comments to remove. >> >> Thanks. >> Any news here? The patch looks okay to me, so perhaps we should just fix up the minor stylistic issues and install it?