From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 06 10:58:22 2019 Received: (at submit) by debbugs.gnu.org; 6 Mar 2019 15:58:22 +0000 Received: from localhost ([127.0.0.1]:34595 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1Yw1-0002Bp-IT for submit@debbugs.gnu.org; Wed, 06 Mar 2019 10:58:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54203) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1Uhf-0008O6-Gc for submit@debbugs.gnu.org; Wed, 06 Mar 2019 06:27:15 -0500 Received: from lists.gnu.org ([209.51.188.17]:34479) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1Uha-0004p8-1l for submit@debbugs.gnu.org; Wed, 06 Mar 2019 06:27:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1UhZ-0001B3-B8 for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 06:27:09 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1UhY-0004oK-Pc for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 06:27:09 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:47279) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1UhY-0004mT-DC for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 06:27:08 -0500 Received: from oxbaltgw38.schlund.de ([172.19.246.46]) by mrelayeu.kundenserver.de (mreue012 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MDv1A-1grYY73U3A-009zT4 for ; Wed, 06 Mar 2019 12:27:03 +0100 Date: Wed, 6 Mar 2019 12:27:03 +0100 (CET) From: Tobias Zawada To: bug-gnu-emacs@gnu.org Message-ID: <1969119607.262870.1551871623530@email.ionos.de> Subject: Bug in emacs 26.1 gdb-send match-string applied after non-matching string-match MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev51 X-Originating-Client: open-xchange-appsuite X-Provags-ID: V03:K1:u2eiuKjkqNBasZMVYCvhojrJ/UFzf1zGpCDRXXHUdfw++un8zHF z1+Dpk9p+Q2mbVRQACfE+HvaaA4YaWv2cSG4MEKa5cq2ATeEUQXqijbxGGNvbdW3t/7if7X 0p2mD34kuvsLmB42KPrZA18jo136+LMWYlHQayEmSMEg9AnnRIH2Xg7Cy1NmejKorwiJmK+ GG0yJA57visy7XCy1ygeQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:QpUL8FBzZyo=:dWREQB7GRJQDy3LRB0OrjP v30w2Z9xINlt3sGpAOQbncrCQ1i+HHI+DGkr03sJE9DGx0yA1A6znBcCVZobMtP6t0mrC2YiK oXG6/3GvGAPszGKiA3IsxyEEVt1Z+6TEZJO6z7+OGNU3SLMzxr0ncIDY7Grk295cs/yno4brm iE874IwTS+k8vBaRssUcyNEYD+LR34/Kqg07X2/Qb/t95JdHR2elH5Rq3fztqYYnFg6EMjbuq wlblfxid96NF56YYH89v0yrsigor2gDgs4jBDw73ONVjpM8KoYinysiBKJTBayjNOLBRQ1jPv nzEbVt559YYtgjbACieslBnjt4a6rh2FFThzhQCwBOD4UYr+5khQKVZSsKr8hL2nIsjqZ/f5T /yHCTzYIAlP37qKvY1gPKxwAHGlC4jmPGg+XdVxRjVnSBFlaZp19knNkAHp2+2ueVZeclVCk6 uBcs9715cwKOFkPxlDC5zzC6h6YNhaKEpD7gcRgZGDLQ2+ZBT8JexG57BKuM/8Xi6Rx19tdaC EiZl7913XngTRnGbdMVcJJ+k1Aws5+JkLetqJd8T0vOjJyFvB7jj2Gj46Qy7Hr7jXrltiHydG PIJxLelAZ8DFXNfMnuDR7+26nkTGXa8nMMLsQRwok9k6oI16pGxoIARr1tHsGJyHxrOMwV9qn jxRtgQNXkQqxXDZzWNgUVkgJOV6IqG4M5fHd9Y0pPaRQzG8U8GABBQEyrepsbyB9ssK/0ovHS 1ORr/wsF4oYuisucq8NyzpkW6krTjVQ5dhE1tRgE7H6oXhdkel32VM7CvuI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.133 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.2 (+) 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: Dear Emacs maintainers, At the end of gdb-send one finds the following lines: (let* ((control-command-p (string-match gdb-control-commands-regexp string)) (command-arg (match-string 3 string)) Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 XPRIO Has X-Priority header X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 06 Mar 2019 10:58:21 -0500 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 (-) Dear Emacs maintainers, At the end of gdb-send one finds the following lines: (let* ((control-command-p (string-match gdb-control-commands-regexp string)) (command-arg (match-string 3 string)) It is wrong to call (match-string 3 string) if (string-match gdb-control-commands-regexp string) returned nil. The doc of match-string says: "Return string of text matched by last search." That means match-string only returns sensible results if the last match was successful. Possible correction: (let* ((control-command-p (string-match gdb-control-commands-regexp string)) (command-arg (and control-command-p (match-string 3 string))) System info: GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-05-29 Best regards, Tobias From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 06 13:18:21 2019 Received: (at 34769) by debbugs.gnu.org; 6 Mar 2019 18:18:21 +0000 Received: from localhost ([127.0.0.1]:34658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1b7U-0007hV-T4 for submit@debbugs.gnu.org; Wed, 06 Mar 2019 13:18:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1b7T-0007hI-BY for 34769@debbugs.gnu.org; Wed, 06 Mar 2019 13:18:19 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46805) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1b7M-0001YY-O1; Wed, 06 Mar 2019 13:18:12 -0500 Received: from [176.228.60.248] (port=4079 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h1b7L-0004Yg-Vb; Wed, 06 Mar 2019 13:18:12 -0500 Date: Wed, 06 Mar 2019 20:18:07 +0200 Message-Id: <835zsvdfz4.fsf@gnu.org> From: Eli Zaretskii To: Tobias Zawada In-reply-to: <1969119607.262870.1551871623530@email.ionos.de> (message from Tobias Zawada on Wed, 6 Mar 2019 12:27:03 +0100 (CET)) Subject: Re: bug#34769: Bug in emacs 26.1 gdb-send match-string applied after non-matching string-match References: <1969119607.262870.1551871623530@email.ionos.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34769 Cc: 34769@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 (-) > Date: Wed, 6 Mar 2019 12:27:03 +0100 (CET) > From: Tobias Zawada > > At the end of gdb-send one finds the following lines: > > (let* ((control-command-p (string-match gdb-control-commands-regexp string)) > (command-arg (match-string 3 string)) > > It is wrong to call (match-string 3 string) if (string-match gdb-control-commands-regexp string) returned nil. > The doc of match-string says: > "Return string of text matched by last search." > That means match-string only returns sensible results if the last match was successful. That is true, and a cleanup is a good idea. But please note that the undefined results are not used if control-command-p is nil, so the issue is not that serious. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 06 16:03:00 2019 Received: (at 34769) by debbugs.gnu.org; 6 Mar 2019 21:03:00 +0000 Received: from localhost ([127.0.0.1]:34736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1dgp-0003TG-Pb for submit@debbugs.gnu.org; Wed, 06 Mar 2019 16:03:00 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:49705) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1csY-0002Ba-US for 34769@debbugs.gnu.org; Wed, 06 Mar 2019 15:11:03 -0500 Received: from oxbaltgw60.schlund.de ([172.19.246.147]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1M1pk6-1h3ojX44PA-002G0j; Wed, 06 Mar 2019 21:10:55 +0100 Date: Wed, 6 Mar 2019 21:10:54 +0100 (CET) From: Tobias Zawada To: Eli Zaretskii Message-ID: <1047508139.239469.1551903054974@email.ionos.de> In-Reply-To: <835zsvdfz4.fsf@gnu.org> References: <1969119607.262870.1551871623530@email.ionos.de> <835zsvdfz4.fsf@gnu.org> Subject: Re: bug#34769: Bug in emacs 26.1 gdb-send match-string applied after non-matching string-match MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev51 X-Originating-Client: open-xchange-appsuite X-Provags-ID: V03:K1:EVej+dXRVyZl0ncjfRfOwbU1rJO8hpkVvrf/NpmG+GnieVBR4oT +qciXwS9C1VdBvn1ouqbEhjjNbh94KwVldNhh0cW0fKcMZS59ymVMPbxJGvCRKH8Nx7cmdu JKFqH4RDL+yKCJG4mkmr/vZ7+qEpyyCIavU61FOtKIjNromHd3LvRtiaVBvEndmuQw/UniT Hyufu75yjaD+4Jre0AQnA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:JefXaSxCPBU=:VlAaW8aA6m9Sa2/+DxMrgN jAjY5TB0dHPM0ouIMIxzNCD4inYEqJy42JSf6aMat3G8TtOOvc3PpfxMUv88FxsDKD3smxtH0 2Dl+EjxXnZkADbshUPS5+MtV5RwHzYfoIUXxPyM0g4oUhN6DsTBG1u0jPHAPLcWVzopVMvCME gElkjyr6BRnywJlrZi2zeJndfnAhIGZgRCnu0MKxVptyYpoeVikZxCO6i12oe8TflNxCcmOfD 0xHomEHkqJ4+KzVCO/U4xETijUylWHTW/U4qiW2umLRjyyOZndW0490kKgULl4pd9i3/HG8pn x5I84bmTEIC73+FHlk6s41MtKH0qecZXqGO5A+/sAAITRQlRwDHYug0GxPxd/2s6UqtsJtiaq D1jz3iXzzVhitS7wfHyo2JcyVjv5tXzejip+Pbj4OUhg7TX3YJX0pvoQ4yx50l/9lnTDolJIs 2PxUFCIS8SxRwYPfxujMU7qaNE3YqG8pxwHUont8KPdhD+bRI14FA83N0VEpCmBRShQe8rg2c ajrXjPvs8uZclABsD/vXy4cDVnmvX6Lzl8BrLZwiy1knEkkV6dbbl08MiB2GvmIWAkAY6UHfb cloCcxSEOGc1KUZy2/O4gd+cXfYm8vFcxWmTg4RNIeQ8NNKi3ixThziL49baBsyALvORA+Udj KSFuKnAY2fqX+I3kXiLCzdIayBKZGIucuAFBZ3n46erMHALElpPsGC/m2h//LM7lwJ7lyQgfv UvKs7FpOw+Qpd9alS0T5YqffpqcMViA0OY/nH+7r/KY29P307cuJkWxtWL0= X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 34769 X-Mailman-Approved-At: Wed, 06 Mar 2019 16:02:59 -0500 Cc: 34769@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 (-) Dear Eli, thanks for looking into this. > > It is wrong to call (match-string 3 string) if (string-match gdb-control-commands-regexp string) returned nil. > ... > That is true, and a cleanup is a good idea. But please note that the > undefined results are not used if control-command-p is nil, so the > issue is not that serious. The match data is that one of the previous successful matching operation. One gets an args-out-of-range signal if the indexes in the match data are larger than the width of the string argument to match-string. That is how I discovered the error. A reconstruction with gdb-send is too involved. Instead I demonstrate the effect with the following orgmode source code block inclusive results: #+BEGIN_SRC emacs-lisp (string-match "\\(1\\) *\\(2\\)" "1 2") (string-match "\\(3 \\(4\\)\\)" "1 2") (append (match-data) (condition-case err (match-string 2 "1 2") (error (list err)))) #+END_SRC #+RESULTS: | 0 | 12 | 0 | 1 | 11 | 12 | (args-out-of-range 1 2 11 12) | Best regards, Tobias From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 07 10:18:47 2019 Received: (at 34769-done) by debbugs.gnu.org; 7 Mar 2019 15:18:47 +0000 Received: from localhost ([127.0.0.1]:35569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1unH-0001PK-5l for submit@debbugs.gnu.org; Thu, 07 Mar 2019 10:18:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45959) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1unF-0001P7-Ft for 34769-done@debbugs.gnu.org; Thu, 07 Mar 2019 10:18:45 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1unA-0008Ud-7l; Thu, 07 Mar 2019 10:18:40 -0500 Received: from [176.228.60.248] (port=2049 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h1un9-00064J-Ci; Thu, 07 Mar 2019 10:18:39 -0500 Date: Thu, 07 Mar 2019 17:18:20 +0200 Message-Id: <83h8cebtmr.fsf@gnu.org> From: Eli Zaretskii To: Tobias Zawada In-reply-to: <1047508139.239469.1551903054974@email.ionos.de> (message from Tobias Zawada on Wed, 6 Mar 2019 21:10:54 +0100 (CET)) Subject: Re: bug#34769: Bug in emacs 26.1 gdb-send match-string applied after non-matching string-match References: <1969119607.262870.1551871623530@email.ionos.de> <835zsvdfz4.fsf@gnu.org> <1047508139.239469.1551903054974@email.ionos.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34769-done Cc: 34769-done@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 (-) > Date: Wed, 6 Mar 2019 21:10:54 +0100 (CET) > From: Tobias Zawada > Cc: 34769@debbugs.gnu.org > > Dear Eli, > thanks for looking into this. > > > > It is wrong to call (match-string 3 string) if (string-match gdb-control-commands-regexp string) returned nil. > > ... > > That is true, and a cleanup is a good idea. But please note that the > > undefined results are not used if control-command-p is nil, so the > > issue is not that serious. > > The match data is that one of the previous successful matching operation. > One gets an args-out-of-range signal if the indexes in the match data are larger than the width of the string argument to match-string. That is how I discovered the error. You are right; I've now fixed this on the emacs-26 branch. From unknown Tue Jun 24 17:26:02 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 05 Apr 2019 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator