From unknown Sat Aug 09 15:57:48 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#78690 <78690@debbugs.gnu.org> To: bug#78690 <78690@debbugs.gnu.org> Subject: Status: 31.0.50; split string: args out of range with TRIM Reply-To: bug#78690 <78690@debbugs.gnu.org> Date: Sat, 09 Aug 2025 22:57:48 +0000 retitle 78690 31.0.50; split string: args out of range with TRIM reassign 78690 emacs submitter 78690 Michael Heerdegen severity 78690 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 03 22:35:00 2025 Received: (at submit) by debbugs.gnu.org; 4 Jun 2025 02:35:00 +0000 Received: from localhost ([127.0.0.1]:44530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uMdxz-0005kN-Mq for submit@debbugs.gnu.org; Tue, 03 Jun 2025 22:35:00 -0400 Received: from lists.gnu.org ([2001:470:142::17]:53190) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uMdxw-0005jv-NP for submit@debbugs.gnu.org; Tue, 03 Jun 2025 22:34:57 -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 1uMdxr-00073X-3O for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2025 22:34:51 -0400 Received: from mout.web.de ([212.227.15.4]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uMdxn-0005TF-Mt for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2025 22:34:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1749004485; x=1749609285; i=michael_heerdegen@web.de; bh=ggjIc3ju8nYONqg9A7pUJJ3Dyo/Le5L5ZhFwcIzOcKQ=; h=X-UI-Sender-Class:From:To:Subject:Date:Message-ID:MIME-Version: Content-Type:cc:content-transfer-encoding:content-type:date:from: message-id:mime-version:reply-to:subject:to; b=A9rcS8+Sgqe7hVhcnUWfJ9Bf4j1oCwodEcBrv7YQuK1acrkG6SyI9ry3LJBY1rwx 2y/Pe2OD7K2/vvUDIm9CGafmG+Uv/VDpi18/GYx3LtGrTGWGug/X1+Mn90DVMdlhl xGMvK+30DIHKFOO5C2/kYnYsQ5QLfbXmj/OFpTsDZR650ZNoZ+3PALWKtrMRwLr/8 DkIGkCIJW+kyFTm9aMlzFRZFwRKYjCKMduQVfL2WWPo4vQ3xjF1J+HWvvUPuQX9mT Ul9YcI3uGQdx9NDe3CLwTCzxgQ3uxU8R2RKUJ0rdr5uGELVsuzVReSLkY6DqTLSPE SfzAk3lvMTCvqgGtfA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([88.66.201.164]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N4eGJ-1v2cTa0rGp-017E6U for ; Wed, 04 Jun 2025 04:34:45 +0200 From: Michael Heerdegen To: bug-gnu-emacs@gnu.org Subject: 31.0.50; split string: args out of range with TRIM X-Debbugs-Cc: Date: Wed, 04 Jun 2025 04:36:26 +0200 Message-ID: <87frggmdw5.fsf@web.de> MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:IuKkrK1bxmo7k1zMaxqRL1Y97rX2wQOLA5cFGLzIir/f58ilYdc /4YJUXU0dx/wLHx/w3C8clbtsPxLSvgfVqaW9Jzr4XR76mi5e/TW9LBTynM1ZdmFPKU4xTh 8Wrui4+ph9rgiiqfv2NIIHiP2QkGxWaxPwBk/6enn/IJH3VmQT+XpjgM3k3EHlCPc+kfRK4 RaTgB/K11qpGjj89QW/sg== X-Spam-Flag: NO UI-Out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ZII4RDtc83JMM/vm6TD6vwYmqGvnjLKpQMe o9SbgB/8FmpBNRCKtV00apK0t Received-SPF: pass client-ip=212.227.15.4; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.0 (/) 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: -1.0 (-) Hello, I stumbled across this: #+begin_src emacs-lisp (split-string "-*- lexical-binding: t; -*-" "-\\*-" nil "[ \t\n\r-]+") #+end_src ~~> | Debugger entered--Lisp error: (args-out-of-range "-*- lexical-binding: t; -*-" 1 0) | (substring "-*- lexical-binding: t; -*-" 1 0) | (let ((this (substring string this-start this-end))) (if trim (progn (let ((tem (string-match (concat trim "\\'") this 0))) (and tem (< tem (length this)) (setq this (substring this 0 tem)))))) (if (or keep-nulls (> (length this) 0)) (progn (setq list (cons this list))))) | (progn (let ((this (substring string this-start this-end))) (if trim (progn (let ((tem (string-match ... this 0))) (and tem (< tem (length this)) (setq this (substring this 0 tem)))))) (if (or keep-nulls (> (length this) 0)) (progn (setq list (cons this list)))))) | (if (or keep-nulls (< this-start this-end)) (progn (let ((this (substring string this-start this-end))) (if trim (progn (let ((tem ...)) (and tem (< tem ...) (setq this ...))))) (if (or keep-nulls (> (length this) 0)) (progn (setq list (cons this list))))))) | (#f(lambda () [(list nil) (this-end 0) (this-start 1) (keep-nulls t) (trim "[ \11\n\15-]+") (string "-*- lexical-binding: t; -*-")] (if trim (progn (let ((tem (string-match trim string this-start))) (and (eq tem this-start) (setq this-start (match-end 0)))))) (if (or keep-nulls (< this-start this-end)) (progn (let ((this (substring string this-start this-end))) (if trim (progn (let ... ...))) (if (or keep-nulls (> ... 0)) (progn (setq list ...)))))))) | (funcall #f(lambda () [(list nil) (this-end 0) (this-start 1) (keep-nulls t) (trim "[ \11\n\15-]+") (string "-*- lexical-binding: t; -*-")] (if trim (progn (let ((tem (string-match trim string this-start))) (and (eq tem this-start) (setq this-start (match-end 0)))))) (if (or keep-nulls (< this-start this-end)) (progn (let ((this (substring string this-start this-end))) (if trim (progn (let ... ...))) (if (or keep-nulls (> ... 0)) (progn (setq list ...)))))))) | (while (and (string-match rexp string (if (and notfirst (= start (match-beginning 0)) (< start (length string))) (1+ start) start)) (< start (length string))) (setq notfirst t) (progn (setq this-start start) (setq this-end (match-beginning 0)) (setq start (match-end 0))) (funcall push-one)) | (let* ((keep-nulls (not (if separators omit-nulls t))) (rexp (or separators split-string-default-separators)) (start 0) this-start this-end notfirst (list nil) (push-one #'(lambda nil (if trim (progn (let ... ...))) (if (or keep-nulls (< this-start this-end)) (progn (let ... ... ...)))))) (while (and (string-match rexp string (if (and notfirst (= start (match-beginning 0)) (< start (length string))) (1+ start) start)) (< start (length string))) (setq notfirst t) (progn (setq this-start start) (setq this-end (match-beginning 0)) (setq start (match-end 0))) (funcall push-one)) (progn (setq this-start start) (setq this-end (length string))) (funcall push-one) (nreverse list)) | (split-string "-*- lexical-binding: t; -*-" "-\\*-" nil "[ \11\n\15-]+") No problem without TRIM arg in the call. TIA, Michael. In GNU Emacs 31.0.50 (build 23, x86_64-pc-linux-gnu, cairo version 1.16.0) of 2025-06-03 built on drachen Repository revision: 8e4a0ea35908e08c2220bafee33a05c33f24bbc3 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101007 System Description: Debian GNU/Linux 12 (bookworm) Configured using: 'configure --with-x-toolkit=no --with-native-compilation=no' From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 05 11:48:55 2025 Received: (at 78690) by debbugs.gnu.org; 5 Jun 2025 15:48:55 +0000 Received: from localhost ([127.0.0.1]:35550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uNCpq-0004xw-Ov for submit@debbugs.gnu.org; Thu, 05 Jun 2025 11:48:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35214) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uNCpo-0004xH-2b for 78690@debbugs.gnu.org; Thu, 05 Jun 2025 11:48:52 -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 1uNCpi-0005k0-Gw; Thu, 05 Jun 2025 11:48:46 -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=IdmRqysw9bcacubUuKyGXaZluiZg705Q2wO/JSaiCPc=; b=W2+2tUcItv0t fQZB3g8uBOa7uCkQpGt2w9lQAXAOQBsFHWBoGT8IQR4JmyIhnoxJu0FjDb/s6RXq0QauEiyu1mv2y w6LWkxtTVSLl63+jo2rNIwObof3c3EmwsoY+kEEURn62TABRDNSlfqly7L1Fyeop8c8NwCOpXIUxQ l2Co25CERH0zpC7XkYlVqdo8Jk+lCXn+zxcp+oXI0PrFfwgH1Gve7s66E54lWMXlPICWC4hYh4vtm nrGZXC5wtrQnGKjyE+LoixyZXPbGa5CS+3ZGYmq+zGes6i0jptvVMGiO06wTFgn/rMoGISBiz2cxl G7Z517GYnkj+UhtOLv/R0w==; Date: Thu, 05 Jun 2025 18:48:44 +0300 Message-Id: <86ecvymboj.fsf@gnu.org> From: Eli Zaretskii To: Michael Heerdegen In-Reply-To: <87frggmdw5.fsf@web.de> (bug-gnu-emacs@gnu.org) Subject: Re: bug#78690: 31.0.50; split string: args out of range with TRIM References: <87frggmdw5.fsf@web.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78690 Cc: 78690@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: Wed, 04 Jun 2025 04:36:26 +0200 > From: Michael Heerdegen via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > > Hello, > > I stumbled across this: > > #+begin_src emacs-lisp > (split-string > "-*- lexical-binding: t; -*-" > "-\\*-" nil "[ \t\n\r-]+") > #+end_src > > ~~> > > | Debugger entered--Lisp error: (args-out-of-range "-*- lexical-binding: t; -*-" 1 0) > | (substring "-*- lexical-binding: t; -*-" 1 0) > | (let ((this (substring string this-start this-end))) (if trim (progn (let ((tem (string-match (concat trim "\\'") this 0))) (and tem (< tem (length this)) (setq this (substring this 0 tem)))))) (if (or keep-nulls (> (length this) 0)) (progn (setq list (cons this list))))) It is quite obvious that split-string is not prepared to deal with a situation where the argument STRING begins with a match for SEPARATORS. The breakage here happens because the match for SEPARATORS at the very beginning of STRING also matches TRIM, but even if that is not so, a match for SEPARATORS at the beginning of STRING sets THIS-START incorrectly for the first call to push-one inside the while-loop. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 05 21:52:18 2025 Received: (at 78690) by debbugs.gnu.org; 6 Jun 2025 01:52:18 +0000 Received: from localhost ([127.0.0.1]:40007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uNMFl-0003UD-Ol for submit@debbugs.gnu.org; Thu, 05 Jun 2025 21:52:18 -0400 Received: from mout.web.de ([212.227.17.11]:38797) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uNMFi-0003Ts-RI for 78690@debbugs.gnu.org; Thu, 05 Jun 2025 21:52:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1749174728; x=1749779528; i=michael_heerdegen@web.de; bh=JwYjBFpm7uWi6ecLGesQrU8aElCh37OEcARbUmWTu2k=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=OLuVC6X3+p7UzDrPyZSruHGgHj5rkao/dwbMiS0ZnPnlEJoVi9CacwBPKHn2qYca Uhe6tpvgC1UbJBTzYCCsneF4Hnz/GcN9YTmVMJFrrYQnw8olCMpCXPnGjBXmVbgV7 WMLqtghT0s3/0v3O+Dutg7EYukdFWRRP1m9gRR5aaOl76WyQajIKw9XPxjY4IFUrd wOPBbIb+EUjwLX5EQsRjIrgA5Qxg1vXTztsVwS1/RKmAT4HS1eEsKnt4nQtsidMO8 ImBL3P+5Jk97vhmgm2KGT8WsfkwaXbe1Gpczf+yoIkFYX7ngAdh4vfa79rixl84ed VFryU9TH5cZABC5A1w== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([88.66.201.164]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M2xrq-1uQeZX3Hn2-004Eii; Fri, 06 Jun 2025 03:52:07 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#78690: 31.0.50; split string: args out of range with TRIM In-Reply-To: <86ecvymboj.fsf@gnu.org> References: <87frggmdw5.fsf@web.de> <86ecvymboj.fsf@gnu.org> Date: Fri, 06 Jun 2025 03:53:47 +0200 Message-ID: <87plfh1vpw.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:ai3j62J963O4g66my54Xp0ixGu2nWLaHfHrSgOioCTwdG+F9c3H nx7Y/yaLkqX3YyI5AzFeu8KTyYnKGLDOC0FcZBfqpn5Jk25weIuFqfsYAa5u5EkiihPGp2U DbodkoAj+F9+VUlUxtF64MheZ1fIgD1dE929kTa9GWhy98vQxnIicxPE9HlelVh+lSruSQT caPm1KwOXHBV/ohALxQjw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:XmtQuXk/9/o=;jUZfwxg9hWcI5ERMZ5EQaaas66X o8L8iTH+cEpRS/gVJKWC8VIj8YxUsASc31whVp+bGU98BYsYnLbV13C5myn1ivp5hf/j57M7x c5Sgkw/9j4Tkhy+1hpUtBU9gmF6mO2J3Vnacaz94NPXQi5VZJ3VtCbS2ieD3+0NuOl05ZRgnp SNkpRR02TcfEaqklYly9sktFN5vVQT1s5Mff2qp6EiwY+s0YXEVxUIKp7POadzJoLkphw4lEw WIEV8OJkFIxBix7WH/dGTTmhSNWskMvuJOGRpzXYFffVKkEmkX96IDMX3LzK443Js2MkGKBRr EE8uAitaLwaHxuWyak9G3FXqfqJyN+l/PwbPaKy3doCkOFc9dAPYgKOT7gz53nZ6bqZk7VZjJ 8VZLjyu8uS4V47pOj+6+I7t0UIIn6Ld5agUU1NC70MeNZLnwQpFx+7ADyL8pGAwcjBjWjP9/7 vzFIRxVsgW0kuLnKH4jNiiM4//3RxOyxjLaIBWyXXPhbNaPbgdNNmAQSQe2Mt9e+ufjMOcrXC WXdXxbTtAQbMA47RDMI6s5IgXASKL7dAV5mEk3MHRLtFJwS5MZnwt+wK3bpvpN0sk5vfOWLnH b8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Kr/A0OG5OMGsUpsBSB2xi5UyC6J+/dCHsTpEpspPRJgHf6Glp7Z3i BvXOaAcdxZfWHtDTD28SN0lTcIJamEZ4Al2LDRT6RE70o9rzVbTySyozS1Icgs6NuSuweynZd 1btV+hyEd2NmmRLtrSbbhJUunmSecAFVTCDjwruFNZXAARCM2B0fm/AksrjWtIMiShNhY4Giy 5wrCk+W8m0QHrLVoJYd6aLBECyUBYDcuQyNbtgrjIjxdWuOZtj9VZXRTPxkhnIUnICQ5+dT52 VK4yt8gdHCk1z0rfIUoE/dLSXP8y6DrrDtjlm4LMV2zgEJtWaVdcjNKp05+6eCxX9iXN+ZIfR hrjdxxOorF6CAItCqlye9C9AicEjq77g5r29Tbd8b5RaSDPNHmoyel7iuJvaLpV6ut5rw40gJ GVtVInvA5ZQy/3jHOk9tQDbOUtAccD6eE/6QlMFrRjnFBjEjhnxpmNTsFJ5oZGOvl23auGVE1 oD66ZK4kr5SA/zCG4adlboSITfP2TAB7pD8SW4o772nG6Ng== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 78690 Cc: 78690@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 (-) Eli Zaretskii writes: > It is quite obvious that split-string is not prepared to deal with a > situation where the argument STRING begins with a match for > SEPARATORS. The breakage here happens because the match for > SEPARATORS at the very beginning of STRING also matches TRIM, but even > if that is not so, a match for SEPARATORS at the beginning of STRING > sets THIS-START incorrectly for the first call to push-one inside the > while-loop. I read that as "confirmed, a bug". Ok, thanks for the analysis. The original use case is in Helm btw, which does a call like this. I made the example a bit shorter for this report - in the original issue the string starts with whitespace, like " -*- lexical-binding: t; -*-" but as you already mentioned the issue is the same. Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 06 03:10:38 2025 Received: (at 78690) by debbugs.gnu.org; 6 Jun 2025 07:10:38 +0000 Received: from localhost ([127.0.0.1]:41293 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uNRDp-0004gm-8Q for submit@debbugs.gnu.org; Fri, 06 Jun 2025 03:10:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55256) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uNRDm-0004fC-4A for 78690@debbugs.gnu.org; Fri, 06 Jun 2025 03:10:35 -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 1uNRDg-00055x-Gx; Fri, 06 Jun 2025 03:10:28 -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=VSj6UjYs+qVrh+es3+2Ii2YpMRBG1lhBJUJg3ChsIQc=; b=fsLrqqbXwqf4 AusOMJftz4jyISCnO/nausUxuwAPhhViHnjwSzP3Ol2uKMEbDZc9J7ghH5A6/AkaeRTrbu+lVSpGV gZGdwT7C5uAdBA89StBREvlSjokE0fpQjZyP3BluSeGsG8TE1CMB8jDlaQxcNDNQKiKfK0WYXymGk 4cl98qfKObBg4JNErfeXFWS0LhcBqtFp1tnM9E3Cm8omW9qX+bfbCvzcBRS1ZPSZp8Uhwm56lDiqO nNmbovKDjitbg7CcP7VKXXB2daHIBwr5zXslWPLV04hwh/LG3+VFi7m6BNha9A4LiVY7m14lq4+aD SAA3GuR7kvAqGkf0ZXvqbg==; Date: Fri, 06 Jun 2025 10:10:25 +0300 Message-Id: <86wm9pl50e.fsf@gnu.org> From: Eli Zaretskii To: Michael Heerdegen In-Reply-To: <87plfh1vpw.fsf@web.de> (message from Michael Heerdegen on Fri, 06 Jun 2025 03:53:47 +0200) Subject: Re: bug#78690: 31.0.50; split string: args out of range with TRIM References: <87frggmdw5.fsf@web.de> <86ecvymboj.fsf@gnu.org> <87plfh1vpw.fsf@web.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78690 Cc: 78690@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: Michael Heerdegen > Cc: 78690@debbugs.gnu.org > Date: Fri, 06 Jun 2025 03:53:47 +0200 > > Eli Zaretskii writes: > > > It is quite obvious that split-string is not prepared to deal with a > > situation where the argument STRING begins with a match for > > SEPARATORS. The breakage here happens because the match for > > SEPARATORS at the very beginning of STRING also matches TRIM, but even > > if that is not so, a match for SEPARATORS at the beginning of STRING > > sets THIS-START incorrectly for the first call to push-one inside the > > while-loop. > > I read that as "confirmed, a bug". Ok, thanks for the analysis. It's more than that: I'm working on this bug. It just takes time to unlock all the subtleties of the implementation and understand how to fix it in a most economical and safe way. I've just succeeded to understand what was the root cause when I ran out of time. The interim analysis was intended to attract others to the problem and perhaps nudge someone to work out a solution. Also to serve a reminder to myself when I get to look at this next time. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 07 15:32:42 2025 Received: (at 78690) by debbugs.gnu.org; 7 Jun 2025 19:32:42 +0000 Received: from localhost ([127.0.0.1]:49657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uNzHV-0005Sw-O9 for submit@debbugs.gnu.org; Sat, 07 Jun 2025 15:32:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45190) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uNzHT-0005Se-EE for 78690@debbugs.gnu.org; Sat, 07 Jun 2025 15:32:40 -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 1uNzHN-0008Kl-KM; Sat, 07 Jun 2025 15:32:33 -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=37u/SCIWSJ5TYfD3LwiM1bela//9YKfrUWRmjOLRma8=; b=TKyTrP2nXH6V PD/BcxmSkQJyrl7U7hkTM6g3/Kyx1k8XKgOLew6micuhib2HDrmI8Prf79uoLvjiK3aOqGE4MeN90 M1+tq1aGp/h5GlW2oYofb0ASISu3f0XDR52UoeY7ZE2CHj0/SJ0pYkcc61UQT0sgRcg6vxqtDNR+1 hYQW3sHkvlngKoVaa6V3Z0DDQUk4yz4Xhn799qlyCI+mpV9L0YKCE2wFeQkYAudYFnFADsmMEMLzG CpJoO40UmhAMrHlATZWW4ZI279YERoR699Fcv2u6epl4ZHBMwOVSWEDkvuuIp9DL7Xe4VagVcroEw 9YlXXa6SycUTh53DXcM5eg==; Date: Sat, 07 Jun 2025 22:32:15 +0300 Message-Id: <86o6uzgxfk.fsf@gnu.org> From: Eli Zaretskii To: michael_heerdegen@web.de In-Reply-To: <86wm9pl50e.fsf@gnu.org> (message from Eli Zaretskii on Fri, 06 Jun 2025 10:10:25 +0300) Subject: Re: bug#78690: 31.0.50; split string: args out of range with TRIM References: <87frggmdw5.fsf@web.de> <86ecvymboj.fsf@gnu.org> <87plfh1vpw.fsf@web.de> <86wm9pl50e.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78690 Cc: 78690@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: 78690@debbugs.gnu.org > Date: Fri, 06 Jun 2025 10:10:25 +0300 > From: Eli Zaretskii > > > From: Michael Heerdegen > > Cc: 78690@debbugs.gnu.org > > Date: Fri, 06 Jun 2025 03:53:47 +0200 > > > > Eli Zaretskii writes: > > > > > It is quite obvious that split-string is not prepared to deal with a > > > situation where the argument STRING begins with a match for > > > SEPARATORS. The breakage here happens because the match for > > > SEPARATORS at the very beginning of STRING also matches TRIM, but even > > > if that is not so, a match for SEPARATORS at the beginning of STRING > > > sets THIS-START incorrectly for the first call to push-one inside the > > > while-loop. > > > > I read that as "confirmed, a bug". Ok, thanks for the analysis. > > It's more than that: I'm working on this bug. It just takes time to > unlock all the subtleties of the implementation and understand how to > fix it in a most economical and safe way. I've just succeeded to > understand what was the root cause when I ran out of time. > > The interim analysis was intended to attract others to the problem and > perhaps nudge someone to work out a solution. Also to serve a > reminder to myself when I get to look at this next time. The patch below seems to fix the problem, and passes all the tests. Does it look reasonable? I took the opportunity to also fix the (dangerous, IMO) calls to match-beginning in the 'while' condition, since I couldn't be certain it cannot be affected by the calls to string-match inside push-one. diff --git a/lisp/subr.el b/lisp/subr.el index 729f8b3..41aaadf 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -5785,7 +5785,9 @@ split-string (start 0) this-start this-end notfirst + match-beg (list nil) + (strlen (length string)) (push-one ;; Push the substring in range THIS-START to THIS-END ;; onto LIST, trimming it and perhaps discarding it. @@ -5794,6 +5796,7 @@ split-string ;; Discard the trim from start of this substring. (let ((tem (string-match trim string this-start))) (and (eq tem this-start) + (not (eq this-start this-end)) (setq this-start (match-end 0))))) (when (or keep-nulls (< this-start this-end)) @@ -5811,18 +5814,22 @@ split-string (while (and (string-match rexp string (if (and notfirst - (= start (match-beginning 0)) - (< start (length string))) + (= start match-beg) + (< start strlen)) (1+ start) start)) - (< start (length string))) - (setq notfirst t) - (setq this-start start this-end (match-beginning 0) - start (match-end 0)) + (< start strlen)) + (setq notfirst t + match-beg (match-beginning 0)) + (if (= start match-beg) + (setq this-start (match-end 0) + this-end this-start) + (setq this-start start this-end match-beg)) + (setq start (match-end 0)) (funcall push-one)) ;; Handle the substring at the end of STRING. - (setq this-start start this-end (length string)) + (setq this-start start this-end strlen) (funcall push-one) (nreverse list))) diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 024cbe8..2e8cbec 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -1505,5 +1505,14 @@ hash-table-contains-p (should (hash-table-contains-p 'cookie h)) (should (hash-table-contains-p 'milk h)))) +(ert-deftest subr-test-split-string () + (let ((text "-*- lexical-binding: t; -*-") + (seps "-\\*-") + (trim "[ \t\n\r-]+")) + (should (equal (split-string text seps nil trim) + '("" "lexical-binding: t;" ""))) + (should (equal (split-string text seps t trim) + '("lexical-binding: t;"))))) + (provide 'subr-tests) ;;; subr-tests.el ends here From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 08 21:20:54 2025 Received: (at 78690) by debbugs.gnu.org; 9 Jun 2025 01:20:54 +0000 Received: from localhost ([127.0.0.1]:53333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uORC1-0000XS-Jt for submit@debbugs.gnu.org; Sun, 08 Jun 2025 21:20:54 -0400 Received: from mout.web.de ([212.227.15.3]:35777) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uORBx-0000XC-DP for 78690@debbugs.gnu.org; Sun, 08 Jun 2025 21:20:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1749432037; x=1750036837; i=michael_heerdegen@web.de; bh=LSQovHM9kL5PEANuV8qZ/nRMHMzk8XvYEM0n8soJstU=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=M4gdu63+rUi9Ts+yXbnAw4F1tCTSvjDyUVuQqrFiw7BU+UPDzU3AXnf8rIjEa1/S 9OPzyCcfx8W5Jmn9Bm5GqnT122c94CUMHlNWzRmXsW+WWpNPU5yygB2nDlXB/3ITd 165Q5i5xkP1KY7xyQFPsMwH8+JiQaoRy6ncZJtbMRhFMbVTo4NKqO7o+00TdI7SIl qER32X7coqpLjZ+ics858hgH22HFJfB7QhZkWMvjm498EudAhux7VL/JiBLh+0xst RajQNNFgZX/XWETXmZp5PXMABnZs9o0phZAporwgNof96HtoqF4pDRz9B3j1z91mh mDFrFwXJXESdvBMYPA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([88.66.201.69]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MgiXQ-1v3G7k3GMW-00ZOId; Mon, 09 Jun 2025 03:20:36 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#78690: 31.0.50; split string: args out of range with TRIM In-Reply-To: <86o6uzgxfk.fsf@gnu.org> References: <87frggmdw5.fsf@web.de> <86ecvymboj.fsf@gnu.org> <87plfh1vpw.fsf@web.de> <86wm9pl50e.fsf@gnu.org> <86o6uzgxfk.fsf@gnu.org> Date: Mon, 09 Jun 2025 03:22:16 +0200 Message-ID: <87ldq1hfp3.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:LO/EpZHsEuN7dYpyep/vfvu9LNNhmmyFiFLB/W5agGpD3GKh3zG Ck6HAG9wnIVfNZYmTN2RjVOGUlzIA89UzY7cynlD1WgT7i2SYIRtQ7wcvvQ65Sn77mZWeAF JXaPdVBtYivsHICVEhbtYQYD9dPNCBN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GyD1J6PeHbzyDhpe644dZh2/hEdDUbEhDEeqbZqU9c6VFS4dsnVsUhKl/B CcWTwM9uP6o0ryJNQlBa2KCLaaFMu3aaCswfgrbXC2NC0voB4H/2v3zo5NXamSedYxahX5xwi vS9jz1ptBAvHXLmPsF2hqfpj8Ev12AlOo25maz6ZZt5Ib3Q== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 78690 Cc: 78690@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 (-) Eli Zaretskii writes: > The patch below seems to fix the problem, and passes all the tests. > Does it look reasonable? Thank you very much. I did not look at the details of your change yet; however, I see that a string starting with whitespace still makes the function error: #+begin_src emacs-lisp (let ((text " -*- lexical-binding: t; -*-") ;; ^^^ see here (seps "-\\*-") (trim "[ \t\n\r-]+")) (split-string text seps nil trim)) #+end_src ~~> split-string: Args out of range: " -*- lexical-binding: t; -*-", 2, 1 Could you please have a look? Michael. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 12 03:49:33 2025 Received: (at 78690) by debbugs.gnu.org; 12 Jun 2025 07:49:33 +0000 Received: from localhost ([127.0.0.1]:55908 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uPcgm-0002lq-HG for submit@debbugs.gnu.org; Thu, 12 Jun 2025 03:49:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33598) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uPcgk-0002lM-B0 for 78690@debbugs.gnu.org; Thu, 12 Jun 2025 03:49:30 -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 1uPcgf-0007gN-1d; Thu, 12 Jun 2025 03:49:25 -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=gqXn4fAxGzWs0BkiTsTHNsK/yCJtEL98IALEMk8H5dU=; b=PaMzrJQsPgc0 i4QMnze74HtUZH7QQqEp07VaNiAMVIDo4h2Sm2NbhQkjpyP9crO5gmDaEm4tFNg5vBwsS8ai7OqAJ g9Sh3HcDsU0INbv2codKgRzLVmqhSYkUnwbWf4r8aTigma7czAnELyVTxvhfpVagW0FLF9oYfjSv0 GS798R9uK9cN9zmfb3IsX+0i19im6/42GwS/Www0dcu/MDwB62QyL2qz5Xk882wP43BtZ7dLQy/2f hsRCWUtZJQXZ5XfPT/IkQ1U5nd23lx7TYc3H80fPYj7kyz7vrDun2Fsdisz0C37GSiTYQK+3xGv0G xQFpIzD6WI0M0ZiqWCTPwQ==; Date: Thu, 12 Jun 2025 10:49:21 +0300 Message-Id: <86sek5flha.fsf@gnu.org> From: Eli Zaretskii To: Michael Heerdegen In-Reply-To: <87ldq1hfp3.fsf@web.de> (message from Michael Heerdegen on Mon, 09 Jun 2025 03:22:16 +0200) Subject: Re: bug#78690: 31.0.50; split string: args out of range with TRIM References: <87frggmdw5.fsf@web.de> <86ecvymboj.fsf@gnu.org> <87plfh1vpw.fsf@web.de> <86wm9pl50e.fsf@gnu.org> <86o6uzgxfk.fsf@gnu.org> <87ldq1hfp3.fsf@web.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78690 Cc: 78690@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: Michael Heerdegen > Cc: 78690@debbugs.gnu.org > Date: Mon, 09 Jun 2025 03:22:16 +0200 > > Eli Zaretskii writes: > > > The patch below seems to fix the problem, and passes all the tests. > > Does it look reasonable? > > Thank you very much. I did not look at the details of your change yet; > however, I see that a string starting with whitespace still makes the > function error: > > #+begin_src emacs-lisp > (let ((text " -*- lexical-binding: t; -*-") > ;; ^^^ see here > (seps "-\\*-") > (trim "[ \t\n\r-]+")) > (split-string text seps nil trim)) > #+end_src > > ~~> split-string: Args out of range: " -*- lexical-binding: t; -*-", 2, 1 > > Could you please have a look? Thanks. I guess I've found something similar independently, because the changes I have stashed (reproduced below) don't signal an error in this case. With those changes, I get what I think is the expected value ("" "lexical-binding: t;" "") Here's the up-to-date version of the patch: diff --git a/lisp/subr.el b/lisp/subr.el index 729f8b3..f674e51 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -5785,7 +5785,9 @@ split-string (start 0) this-start this-end notfirst + match-beg (list nil) + (strlen (length string)) (push-one ;; Push the substring in range THIS-START to THIS-END ;; onto LIST, trimming it and perhaps discarding it. @@ -5794,6 +5796,7 @@ split-string ;; Discard the trim from start of this substring. (let ((tem (string-match trim string this-start))) (and (eq tem this-start) + (<= (match-end 0) this-end) (setq this-start (match-end 0))))) (when (or keep-nulls (< this-start this-end)) @@ -5811,18 +5814,25 @@ split-string (while (and (string-match rexp string (if (and notfirst - (= start (match-beginning 0)) - (< start (length string))) + (= start match-beg) ; empty match + (< start strlen)) (1+ start) start)) - (< start (length string))) - (setq notfirst t) - (setq this-start start this-end (match-beginning 0) - start (match-end 0)) + (< start strlen)) + (setq notfirst t + match-beg (match-beginning 0)) + ;; If the separator is right at the beginning, produce an empty + ;; substring in the result list. + (if (= start match-beg) + (setq this-start (match-end 0) + this-end this-start) + ;; Otherwise produce a substring from start to the separator. + (setq this-start start this-end match-beg)) + (setq start (match-end 0)) (funcall push-one)) ;; Handle the substring at the end of STRING. - (setq this-start start this-end (length string)) + (setq this-start start this-end strlen) (funcall push-one) (nreverse list))) diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 024cbe8..2e8cbec 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -1505,5 +1505,14 @@ hash-table-contains-p (should (hash-table-contains-p 'cookie h)) (should (hash-table-contains-p 'milk h)))) +(ert-deftest subr-test-split-string () + (let ((text "-*- lexical-binding: t; -*-") + (seps "-\\*-") + (trim "[ \t\n\r-]+")) + (should (equal (split-string text seps nil trim) + '("" "lexical-binding: t;" ""))) + (should (equal (split-string text seps t trim) + '("lexical-binding: t;"))))) + (provide 'subr-tests) ;;; subr-tests.el ends here From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 12 04:41:21 2025 Received: (at 78690) by debbugs.gnu.org; 12 Jun 2025 08:41:21 +0000 Received: from localhost ([127.0.0.1]:56177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uPdUv-0006NQ-8P for submit@debbugs.gnu.org; Thu, 12 Jun 2025 04:41:21 -0400 Received: from mout.web.de ([212.227.17.12]:32893) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uPdUt-0006Mx-MC for 78690@debbugs.gnu.org; Thu, 12 Jun 2025 04:41:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1749717662; x=1750322462; i=michael_heerdegen@web.de; bh=wD+oOvO/qf6uRfYrtMheUsXpijdxz51JaahBeCcMLtc=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=ryhYzxVSIQ9WP/EE3clEGQNhI8PawXktryv1aKt58TQ2cnR/wa889NW0SAsnEtzh n7Z0X/atZhAWva2uwn7KL38bdmXXUoe8T69Mj03MIniGiQ+K80jOS8T8GDkD1cFyr rRvXivk8t5pLoiAcVXxoUc/FmyoBohncg8HN2qEt2n938cWAegeIkHcuv271FKYN2 jmpeNrywIEsIfYq4f1gLaW4taY0W1KFuBogF9PLIP9zkMdUUN/r7ZsMhPewxqj4MW YCtElhRDDu7ivKSKsyMe93m0W1hx/+oFh2tWucI1Pfc140RWomWtVp7o8UIfbl/Lp xrEvK2cL7cNOPNT8Qg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([88.66.201.69]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1N7xaT-1uu6e51q0h-00y9ST; Thu, 12 Jun 2025 10:41:02 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#78690: 31.0.50; split string: args out of range with TRIM In-Reply-To: <86sek5flha.fsf@gnu.org> References: <87frggmdw5.fsf@web.de> <86ecvymboj.fsf@gnu.org> <87plfh1vpw.fsf@web.de> <86wm9pl50e.fsf@gnu.org> <86o6uzgxfk.fsf@gnu.org> <87ldq1hfp3.fsf@web.de> <86sek5flha.fsf@gnu.org> Date: Thu, 12 Jun 2025 10:42:42 +0200 Message-ID: <87zfedgxkt.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:fwl6ek+KWhdfZb1xEibBuk7u+UD+4vvFz2IfvOObVK9lFlF1dFS j3Lf+nOazfYnuYQYDf51cqqmWiASQ4PVXwuAkF6ZTkjSsQcJG2QXblu0yHSLU1e+RnEFYxX 1HP+3IkNsDlDH2Q/IMObg8uipOcSsO5yG0Sbgr5HfbRnPHQvQdnVX3IKm1XHDKXovYyAl65 kaA0rwe0PNHCdHGBz7jEg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:IYT2nUBnx6E=;PfwHZSsFUenmcIPzC2OqBAGBnmj KF0H7Q14ruAKAeECppjKC5EzyV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kFpqr4yZyhJf+Lyv7L5hLogXWt+Uw9b1SI3pDw== Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 78690 Cc: 78690@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 (-) Eli Zaretskii writes: > > #+begin_src emacs-lisp > > (let ((text " -*- lexical-binding: t; -*-") > > ;; ^^^ see here > > (seps "-\\*-") > > (trim "[ \t\n\r-]+")) > > (split-string text seps nil trim)) > > #+end_src > >=20 > > ~~> split-string: Args out of range: " -*- lexical-binding: t; -*-",= 2, 1 > >=20 > > Could you please have a look? > > Thanks. I guess I've found something similar independently, because > the changes I have stashed (reproduced below) don't signal an error in > this case. With those changes, I get what I think is the expected > value > > ("" "lexical-binding: t;" "") > Here's the up-to-date version of the patch: > [...] Confirmed - works for me, thank you. BTW, I tried to follow the code and find it a bit troublesome. If you would want to try to give some local variables a bit more meaningful names where possible, or want to add some very short comments, I would not be opposed to that. Michael. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 12 07:05:42 2025 Received: (at 78690) by debbugs.gnu.org; 12 Jun 2025 11:05:42 +0000 Received: from localhost ([127.0.0.1]:56827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uPfkc-0002Bq-2V for submit@debbugs.gnu.org; Thu, 12 Jun 2025 07:05:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57882) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uPfkZ-0002BS-My for 78690@debbugs.gnu.org; Thu, 12 Jun 2025 07:05:40 -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 1uPfkU-0003nD-1p; Thu, 12 Jun 2025 07:05:34 -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=pDVQ3jPOhkePoQqj4YsJbLEipUaWxQs5f1z3824GXMc=; b=pPz10jM90MKf Y+E6mZSQ7kyhmOTOP6oZjR+W57JDktQet3waUFNC3Cv4HhM5YJUjoprfpYTCOrv9U6TWrR9YCcCcW HLt8Cw7Re9uK5jwFj1SlFmcy9XZ7gk8VqesQVWxKooRGzdYu+fYinqRiqXF0Ex8pOpXlWXXS5dc4D 96IXbjL1LkK5I2WMvuT6UuFt5VZSDwDPQruNePqaTeA1fyqyE9d23cjp51jx14fpkTy4caJnSyGJ1 NpMv9iY6NWr52KLBRs/vaFJ62g09wZ34nqCzjnFRJvmiA/abl4nnj3lDeauuvL53qCX4H+AzaRmI6 sO0AH7TAKFyKSSVxK1GbOQ==; Date: Thu, 12 Jun 2025 14:05:31 +0300 Message-Id: <86o6utfcec.fsf@gnu.org> From: Eli Zaretskii To: Michael Heerdegen In-Reply-To: <87zfedgxkt.fsf@web.de> (message from Michael Heerdegen on Thu, 12 Jun 2025 10:42:42 +0200) Subject: Re: bug#78690: 31.0.50; split string: args out of range with TRIM References: <87frggmdw5.fsf@web.de> <86ecvymboj.fsf@gnu.org> <87plfh1vpw.fsf@web.de> <86wm9pl50e.fsf@gnu.org> <86o6uzgxfk.fsf@gnu.org> <87ldq1hfp3.fsf@web.de> <86sek5flha.fsf@gnu.org> <87zfedgxkt.fsf@web.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78690 Cc: 78690@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: Michael Heerdegen > Cc: 78690@debbugs.gnu.org > Date: Thu, 12 Jun 2025 10:42:42 +0200 > > Eli Zaretskii writes: > > > Thanks. I guess I've found something similar independently, because > > the changes I have stashed (reproduced below) don't signal an error in > > this case. With those changes, I get what I think is the expected > > value > > > > ("" "lexical-binding: t;" "") > > > Here's the up-to-date version of the patch: > > [...] > > Confirmed - works for me, thank you. Thanks, will install soon. > BTW, I tried to follow the code and find it a bit troublesome. If you > would want to try to give some local variables a bit more meaningful > names where possible, or want to add some very short comments, I would > not be opposed to that. If you tell me what is confusing or unclear, I will try to clarify that. I guess after staring at the code as much as I did, I've lost the ability to see the confusing parts, beyond the comments I added that you saw in the patch. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 19 13:42:03 2025 Received: (at 78690) by debbugs.gnu.org; 19 Jun 2025 17:42:04 +0000 Received: from localhost ([127.0.0.1]:36759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uSJH0-0001Wh-CJ for submit@debbugs.gnu.org; Thu, 19 Jun 2025 13:42:03 -0400 Received: from mout.web.de ([217.72.192.78]:54601) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uSJGw-0001VT-UB for 78690@debbugs.gnu.org; Thu, 19 Jun 2025 13:41:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1750354912; x=1750959712; i=michael_heerdegen@web.de; bh=Quc3lITuEzMIvZk/qRNsfF3cYJwdE7cdvVNOabVKpTM=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=XDJoQhdfMpeTf+Sq2gl+VosuC38aiSKtaDhL2+Xu42s/TQIt7qvaJSEySUGj3hF9 yVSH4JPx7W+3UT1YJhXDoHjSPGltnGhVYv3asuV1YjJqRUcL8O2wetV9B2eVcHPDn +WsTqBewxZlAdtEBiIGFjuLN28qUS80iUqqRL1DK1p9ASs+a/dD9XxA9kEkV9JtFT kYzo+NPnjfeEX51FiMdsRgUQobjUBZxgKOOSJD7wLa3dr7Vh5emmDrhMvxVw+SITh /CCug+jn2ifAHVX3R2RDFkAbMoDff2eBvWzl0PBp96fBQ2pFmMrWJV7tGuzYsE97e 8T+7XkbGokQHLa/oOw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([88.66.201.69]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MzCA5-1ugPqd0d0t-016za1; Thu, 19 Jun 2025 19:41:52 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#78690: 31.0.50; split string: args out of range with TRIM In-Reply-To: <86o6utfcec.fsf@gnu.org> References: <87frggmdw5.fsf@web.de> <86ecvymboj.fsf@gnu.org> <87plfh1vpw.fsf@web.de> <86wm9pl50e.fsf@gnu.org> <86o6uzgxfk.fsf@gnu.org> <87ldq1hfp3.fsf@web.de> <86sek5flha.fsf@gnu.org> <87zfedgxkt.fsf@web.de> <86o6utfcec.fsf@gnu.org> Date: Thu, 19 Jun 2025 19:43:31 +0200 Message-ID: <87plez8w58.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:t9PAxfwPLvlKJicyF4dsCnzEchluzmVTvXshgoVJgwFzVpWgPZ8 UvQLSOkaAf2e8zBara9g24N7ik9w9x3nHHyqrExFFkhQQVVkdyjzEyv9iqo2UELK/w5+vX/ oWPEHhzL7zx0Jd7l1NDe+BICBHAMy/N1yBrud3BCaUbBVySDd3nqKeEzlVhrsdm4GyTYI2r 9CQRlSQRuz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9a6WXaXJPS7wUKifudlwzE/3B8NG 22F++QZ8uXmnatsfXdwyKF0fld6V8c8zyZqFwFCYuWn1EQdOcpRiYUYjfy69Id9KwHu7aS0wn brAxDXwUWN86AgUMKkcah8ZA+CXpZxG7FcebGyvVMHf0yKQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 78690 Cc: 78690@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 (-) Eli Zaretskii writes: > If you tell me what is confusing or unclear, I will try to clarify > that. I guess after staring at the code as much as I did, I've lost > the ability to see the confusing parts, beyond the comments I added > that you saw in the patch. The comments are actually good. I got a bit confused because of the non-functional programming style (the helper lambda `push-one' changes state that is not local to that helper function), but... it's ok, it's just a complicated semantics being implemented so it takes some time to see what is going on where here. All good. Along with the comments one can make the way through the code. Thanks, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 21 04:13:49 2025 Received: (at 78690-done) by debbugs.gnu.org; 21 Jun 2025 08:13:49 +0000 Received: from localhost ([127.0.0.1]:33451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uStMD-0002aF-43 for submit@debbugs.gnu.org; Sat, 21 Jun 2025 04:13:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57180) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uStM9-0002ZI-TE for 78690-done@debbugs.gnu.org; Sat, 21 Jun 2025 04:13:47 -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 1uStM4-0007Au-Er; Sat, 21 Jun 2025 04:13:40 -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=A0N7x07t7zLm/SeWkbIJOvV8JtX+ZNZ1HbpX4B5sMIw=; b=OGU0dGWRBM86 tdtQuKGG1ywm6Zuyjxs1zLLkhWYtny3qm75QYf+t3oqRN/Oivr+k8/QyeX4gsu89gb0wTwhs4+xGp OPDBTpIjXp9PKwPdpxMZq2c54AR2VdSLB0L9gpaimxGB7wwNDcxzLlXW+uSX4Y+/fgPOdJduPr9Gm RR/HtBZQU4Gq7/PpOm/fliiYXkGqXDhT0HBb8VzB1ov0iagYln20zWmBRIwDKO0jFN4qbfmoCsjDq kb3W+MLli5dvivj3vUhXwA2uTssrIbxQU8Z68e7RBtgfZTmL6FsjmnyKuLrHh2sqBW1Av7QJBYVsU r0ang8ZdsGV5lKbuTMjvYw==; Date: Sat, 21 Jun 2025 11:13:36 +0300 Message-Id: <86frftjyvj.fsf@gnu.org> From: Eli Zaretskii To: Michael Heerdegen In-Reply-To: <87plez8w58.fsf@web.de> (message from Michael Heerdegen on Thu, 19 Jun 2025 19:43:31 +0200) Subject: Re: bug#78690: 31.0.50; split string: args out of range with TRIM References: <87frggmdw5.fsf@web.de> <86ecvymboj.fsf@gnu.org> <87plfh1vpw.fsf@web.de> <86wm9pl50e.fsf@gnu.org> <86o6uzgxfk.fsf@gnu.org> <87ldq1hfp3.fsf@web.de> <86sek5flha.fsf@gnu.org> <87zfedgxkt.fsf@web.de> <86o6utfcec.fsf@gnu.org> <87plez8w58.fsf@web.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78690-done Cc: 78690-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: -3.3 (---) > From: Michael Heerdegen > Cc: 78690@debbugs.gnu.org > Date: Thu, 19 Jun 2025 19:43:31 +0200 > > Eli Zaretskii writes: > > > If you tell me what is confusing or unclear, I will try to clarify > > that. I guess after staring at the code as much as I did, I've lost > > the ability to see the confusing parts, beyond the comments I added > > that you saw in the patch. > > The comments are actually good. I got a bit confused because of the > non-functional programming style (the helper lambda `push-one' changes > state that is not local to that helper function), but... it's ok, it's > just a complicated semantics being implemented so it takes some time to > see what is going on where here. All good. Along with the comments one > can make the way through the code. Thanks, now installed on the master branch, and closing the bug. From unknown Sat Aug 09 15:57:48 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 19 Jul 2025 11:24:11 +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