From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Tobias Zawada Newsgroups: gmane.emacs.bugs Subject: bug#34769: Bug in emacs 26.1 gdb-send match-string applied after non-matching string-match Date: Wed, 6 Mar 2019 21:10:54 +0100 (CET) Message-ID: <1047508139.239469.1551903054974@email.ionos.de> References: <1969119607.262870.1551871623530@email.ionos.de> <835zsvdfz4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="175414"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34769@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 06 22:03:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1dh3-000jVw-Ma for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Mar 2019 22:03:13 +0100 Original-Received: from localhost ([127.0.0.1]:39519 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1dh2-0002sC-Mo for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Mar 2019 16:03:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1dgu-0002s7-CR for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 16:03:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1dgt-0007l5-Mi for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 16:03:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49425) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1dgt-0007kr-J8 for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 16:03:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h1dgs-0003TX-DL for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 16:03:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tobias Zawada Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Mar 2019 21:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34769 X-GNU-PR-Package: emacs Original-Received: via spool by 34769-submit@debbugs.gnu.org id=B34769.155190618013350 (code B ref 34769); Wed, 06 Mar 2019 21:03:02 +0000 Original-Received: (at 34769) by debbugs.gnu.org; 6 Mar 2019 21:03:00 +0000 Original-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 Original-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 Original-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 In-Reply-To: <835zsvdfz4.fsf@gnu.org> 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-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-Mailman-Approved-At: Wed, 06 Mar 2019 16:02:59 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156109 Archived-At: 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