From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 23 06:00:10 2025 Received: (at submit) by debbugs.gnu.org; 23 Jul 2025 10:00:10 +0000 Received: from localhost ([127.0.0.1]:48500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ueWGf-0003u8-0v for submit@debbugs.gnu.org; Wed, 23 Jul 2025 06:00:09 -0400 Received: from lists.gnu.org ([2001:470:142::17]:39136) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ueWGb-0003sK-CQ for submit@debbugs.gnu.org; Wed, 23 Jul 2025 06:00:06 -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 1ueWGO-0005N3-Bl for bug-gnu-emacs@gnu.org; Wed, 23 Jul 2025 05:59:53 -0400 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1] helo=mail.qxqx.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ueWGM-0004KY-K4 for bug-gnu-emacs@gnu.org; Wed, 23 Jul 2025 05:59:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=nNVp5XIgG9bC21PKoPhqrmBhogO7+jnbXno7VrkuVFA=; b=yYdi6Lb4W6d4d9526or0KknQLz Oc+NXWXQcPRkMTYOn7ssd/AHQhSVAp/k79qMNBp07kTWVTxb075Y3jeI8xS8eVh8Bbxd0PAEexYxF jHeYL76GqLuohoeykGLFvgAeqAmRrZw0EM8GZNT+PkVlLcrdRkLFOBO9zZ+Np/EXgb9g=; From: Daniel Mendler To: bug-gnu-emacs@gnu.org Subject: 31.0.50; report-emacs-bug-check-org errors with args-out-range X-Debbugs-Cc: Date: Wed, 23 Jul 2025 11:59:48 +0200 Message-ID: <87ms8v5isr.fsf@daniel-mendler.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a01:4f8:c012:9177::1; envelope-from=mail@daniel-mendler.de; helo=mail.qxqx.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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) 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: -0.1 (/) While sending my last bug report I observed the following issue, where `report-emacs-bug-check-org' throws an `args-out-of-range' error. I've got the following stack trace: Debugger entered--Lisp error: (args-out-of-range "From: Daniel Mendler \nTo: bug-gnu-emacs@gnu.org\nSubject: 31.0.50; Piped co= mmand output is sometimes lost in Eshell\nGcc: nnimap+privat:sent\nX-Debbug= s-Cc: Jim Porter \n--text follows this line--\nHello= ,\n\nsometimes when executing commands in Eshell with pipes the output seem= s\nto get lost, for example:\n\ngit log | head -n 10 | cat\n\nInstead of th= e expected ten lines of output, there is no output. This\nproblem does not = happen always, but from time to time, so maybe there is\nsome timing issue = regarding the process handling? In case the issue does\nnot occur immediate= ly one can try this:\n\nwhile true { echo \"test\"; git log | head -n 1 | c= at }\n\nFor such loops the following error might occur:\n\nCreating pipe: T= oo many open files\nCannot redirect stderr: Too many open files, /dev/null\= n\nI tested this with emacs -Q on Emacs 31 with a relatively recent commit\= nfrom a few days ago (1e3d76af5a7a16682e71f9df46f6788c0880cccd).\n\nCan som= eone confirm these problems? Thanks!\n\nIn GNU Emacs 31.0.50 (build 1, x86_= 64-pc-linux-gnu, GTK+ Version\n 3.24.49, cairo version 1.18.4) of 2025-07-1= 5\nWindowing system distributor 'The X.Org Foundation', version 11.0.121010= 16\nSystem Description: Debian GNU/Linux 13 (trixie)\n\nConfigured using:\n= 'configure --prefix=3D$HOME/.local/share/emacs\n --without-compress-instal= l --with-tree-sitter --with-native-compilation\n --with-dbus --without-seli= nux --without-threads --disable-gc-mark-trace\n --without-gsettings --witho= ut-gpm --with-cairo --with-cairo-xcb\n --with-xinput2 --with-x-toolkit=3Dgt= k3 --without-toolkit-scroll-bars\n 'CFLAGS=3D-O3 -mtune=3Dnative -march=3Dn= ative''\n\nConfigured features:\nCAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS HA= RFBUZZ JPEG LIBOTF LIBSYSTEMD\nLIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY P= DUMPER PNG RSVG SECCOMP\nSOUND SQLITE3 TIFF TREE_SITTER WEBP X11 XDBE XIM X= INERAMA XINPUT2 XPM\nXRANDR GTK3 ZLIB" 0 7762) (report-emacs-bug-check-org) (report-emacs-bug-hook) (message-send nil) (message-send-and-exit nil) (funcall-interactively message-send-and-exit nil) (command-execute message-send-and-exit) In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.49, cairo version 1.18.4) of 2025-07-15 Windowing system distributor 'The X.Org Foundation', version 11.0.12101016 System Description: Debian GNU/Linux 13 (trixie) Configured using: 'configure --prefix=3D$HOME/.local/share/emacs --without-compress-install --with-tree-sitter --with-native-compilation --with-dbus --without-selinux --without-threads --disable-gc-mark-trace --without-gsettings --without-gpm --with-cairo --with-cairo-xcb --with-xinput2 --with-x-toolkit=3Dgtk3 --without-toolkit-scroll-bars 'CFLAGS=3D-O3 -mtune=3Dnative -march=3Dnative'' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ JPEG LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 TIFF TREE_SITTER WEBP X11 XDBE XIM XINERAMA XINPUT2 XPM XRANDR GTK3 ZLIB From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 26 05:57:50 2025 Received: (at 79080) by debbugs.gnu.org; 26 Jul 2025 09:57:50 +0000 Received: from localhost ([127.0.0.1]:40112 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ufbf3-0005ws-Qa for submit@debbugs.gnu.org; Sat, 26 Jul 2025 05:57:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59636) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ufbf0-0005wW-O1 for 79080@debbugs.gnu.org; Sat, 26 Jul 2025 05:57: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 1ufbeu-0006dn-FM; Sat, 26 Jul 2025 05:57:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:Subject:In-Reply-To:To:From: Date; bh=zn6v6DLUTw/RhyrbIJwG3Pfpn3AXwxe5ymJivyHqG2M=; b=QGhtQhUTgTZqJHKCx7Sj 8m4mnM788Ej3t4Ss3cVSEeSB0isMggQjLSONu+YQhYZDOA9YrA3Hm6esXjMj6AbojSOLR77P2iT8L Oc0QO2ioFrIirhpLRUdOAXeO7yjM+zybmtpIIkRlS82eyzT7VSd387A1NbVsei6D4jFVkdA4Txn+v CZznHRZJc6JnIMtSgcPQmNilnWNfoM9AnrFTB2qjciMAIKoMboggdijOxCWeWTxQfz1QmsvjLZBVP wBrWUnzjqsJasViuFxUkELCMZKXqQzBu562TF4Wj4t8m/Haa4B7GxUE1vz6i/XJLd7RhdED0PvH6E X00uKL5m9oiPCQ==; Date: Sat, 26 Jul 2025 12:57:37 +0300 Message-Id: <86bjp71dgu.fsf@gnu.org> From: Eli Zaretskii To: Daniel Mendler , Antero Mejr In-Reply-To: <87ms8v5isr.fsf@daniel-mendler.de> (bug-gnu-emacs@gnu.org) Subject: Re: bug#79080: 31.0.50; report-emacs-bug-check-org errors with args-out-range References: <87ms8v5isr.fsf@daniel-mendler.de> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79080 Cc: 79080@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, 23 Jul 2025 11:59:48 +0200 > From: Daniel Mendler via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" >=20 > While sending my last bug report I observed the following issue, where > `report-emacs-bug-check-org' throws an `args-out-of-range' error. I've > got the following stack trace: >=20 > Debugger entered--Lisp error: (args-out-of-range "From: Daniel Mendler \nTo: bug-gnu-emacs@gnu.org\nSubject: 31.0.50; Piped = command output is sometimes lost in Eshell\nGcc: nnimap+privat:sent\nX-Debb= ugs-Cc: Jim Porter \n--text follows this line--\nHel= lo,\n\nsometimes when executing commands in Eshell with pipes the output se= ems\nto get lost, for example:\n\ngit log | head -n 10 | cat\n\nInstead of = the expected ten lines of output, there is no output. This\nproblem does no= t happen always, but from time to time, so maybe there is\nsome timing issu= e regarding the process handling? In case the issue does\nnot occur immedia= tely one can try this:\n\nwhile true { echo \"test\"; git log | head -n 1 |= cat }\n\nFor such loops the following error might occur:\n\nCreating pipe:= Too many open files\nCannot redirect stderr: Too many open files, /dev/nul= l\n\nI tested this with emacs -Q on Emacs 31 with a relatively recent commi= t\nfrom a few days ago (1e3d76af5a7a16682e71f9df46f6788c0880cccd).\n\nCan s= omeone confirm these problems? Thanks!\n\nIn GNU Emacs 31.0.50 (build 1, x8= 6_64-pc-linux-gnu, GTK+ Version\n 3.24.49, cairo version 1.18.4) of 2025-07= -15\nWindowing system distributor 'The X.Org Foundation', version 11.0.1210= 1016\nSystem Description: Debian GNU/Linux 13 (trixie)\n\nConfigured using:= \n 'configure --prefix=3D$HOME/.local/share/emacs\n --without-compress-inst= all --with-tree-sitter --with-native-compilation\n --with-dbus --without-se= linux --without-threads --disable-gc-mark-trace\n --without-gsettings --wit= hout-gpm --with-cairo --with-cairo-xcb\n --with-xinput2 --with-x-toolkit=3D= gtk3 --without-toolkit-scroll-bars\n 'CFLAGS=3D-O3 -mtune=3Dnative -march= =3Dnative''\n\nConfigured features:\nCAIRO DBUS FREETYPE GIF GLIB GMP GNUTL= S HARFBUZZ JPEG LIBOTF LIBSYSTEMD\nLIBXML2 MODULES NATIVE_COMP NOTIFY INOTI= FY PDUMPER PNG RSVG SECCOMP\nSOUND SQLITE3 TIFF TREE_SITTER WEBP X11 XDBE X= IM XINERAMA XINPUT2 XPM\nXRANDR GTK3 ZLIB" 0 7762) > (report-emacs-bug-check-org) Thanks. I added the author of that function to the discussion. Antero, I think the bug here is in the assumption that the user edits the original text inserted by report-emacs-bug only to _add_ text. But that might not be true: users could remove some of the original text as well. So something like the below is in order. But I also wonder why we should look for the regular expression only in part of the message to be sent. Can you explain why you did that? diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 5ffb86e..51954a1 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -430,8 +430,11 @@ report-emacs-bug-check-org (goto-char (point-max)) (skip-chars-backward " \t\n") (let* ((text (buffer-substring-no-properties (point-min) (point))) - (l (length report-emacs-bug-orig-text)) - (text (substring text 0 l)) + (ltext (length text)) + (lorig (length report-emacs-bug-orig-text)) + (text (if (< lorig ltext) + (substring text 0 lorig) + text)) (org-regex "\\b[Oo]rg\\(-mode\\)?\\b")) (when (string-match-p org-regex text) (when (yes-or-no-p "Is this bug about org-mode?") From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 26 06:04:14 2025 Received: (at 79080) by debbugs.gnu.org; 26 Jul 2025 10:04:14 +0000 Received: from localhost ([127.0.0.1]:40156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ufblG-0006OA-4N for submit@debbugs.gnu.org; Sat, 26 Jul 2025 06:04:14 -0400 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:58439 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ufblC-0006Nt-Vb for 79080@debbugs.gnu.org; Sat, 26 Jul 2025 06:04:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=LYB3M5hBjcaio3nMzNczceKs2TMG1glW3odPXIZYido=; b=O1wvHOO5rs+Z29aBQNso3mAqP2 kSVygwz3PIZ2JExRZtMWP5byk7A4XAxGRxLdja56UVvzlPcBcC+GUY7b+TrOfzWVjq6litLwKXJsn nDBuHv6W47GlbgG/5A+SQUgYxkejwLhdlveHpCx5W6Dm/oyRUrdKuuWrpQsjDZTvYLFA=; From: Daniel Mendler To: Eli Zaretskii Subject: Re: bug#79080: 31.0.50; report-emacs-bug-check-org errors with args-out-range In-Reply-To: <86bjp71dgu.fsf@gnu.org> References: <87ms8v5isr.fsf@daniel-mendler.de> <86bjp71dgu.fsf@gnu.org> Date: Sat, 26 Jul 2025 12:04:02 +0200 Message-ID: <87y0sbs1yl.fsf@daniel-mendler.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79080 Cc: Antero Mejr , 79080@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: >> Date: Wed, 23 Jul 2025 11:59:48 +0200 >> From: Daniel Mendler via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >>=20 >> While sending my last bug report I observed the following issue, where >> `report-emacs-bug-check-org' throws an `args-out-of-range' error. I've >> got the following stack trace: >>=20 >> Debugger entered--Lisp error: (args-out-of-range "From: Daniel Mendler <= mail@daniel-mendler.de>\nTo: bug-gnu-emacs@gnu.org\nSubject: 31.0.50; Piped= command output is sometimes lost in Eshell\nGcc: nnimap+privat:sent\nX-Deb= bugs-Cc: Jim Porter \n--text follows this line--\nHe= llo,\n\nsometimes when executing commands in Eshell with pipes the output s= eems\nto get lost, for example:\n\ngit log | head -n 10 | cat\n\nInstead of= the expected ten lines of output, there is no output. This\nproblem does n= ot happen always, but from time to time, so maybe there is\nsome timing iss= ue regarding the process handling? In case the issue does\nnot occur immedi= ately one can try this:\n\nwhile true { echo \"test\"; git log | head -n 1 = | cat }\n\nFor such loops the following error might occur:\n\nCreating pipe= : Too many open files\nCannot redirect stderr: Too many open files, /dev/nu= ll\n\nI tested this with emacs -Q on Emacs 31 with a relatively recent comm= it\nfrom a few days ago (1e3d76af5a7a16682e71f9df46f6788c0880cccd).\n\nCan = someone confirm these problems? Thanks!\n\nIn GNU Emacs 31.0.50 (build 1, x= 86_64-pc-linux-gnu, GTK+ Version\n 3.24.49, cairo version 1.18.4) of 2025-0= 7-15\nWindowing system distributor 'The X.Org Foundation', version 11.0.121= 01016\nSystem Description: Debian GNU/Linux 13 (trixie)\n\nConfigured using= :\n 'configure --prefix=3D$HOME/.local/share/emacs\n --without-compress-ins= tall --with-tree-sitter --with-native-compilation\n --with-dbus --without-s= elinux --without-threads --disable-gc-mark-trace\n --without-gsettings --wi= thout-gpm --with-cairo --with-cairo-xcb\n --with-xinput2 --with-x-toolkit= =3Dgtk3 --without-toolkit-scroll-bars\n 'CFLAGS=3D-O3 -mtune=3Dnative -marc= h=3Dnative''\n\nConfigured features:\nCAIRO DBUS FREETYPE GIF GLIB GMP GNUT= LS HARFBUZZ JPEG LIBOTF LIBSYSTEMD\nLIBXML2 MODULES NATIVE_COMP NOTIFY INOT= IFY PDUMPER PNG RSVG SECCOMP\nSOUND SQLITE3 TIFF TREE_SITTER WEBP X11 XDBE = XIM XINERAMA XINPUT2 XPM\nXRANDR GTK3 ZLIB" 0 7762) >> (report-emacs-bug-check-org) > > Thanks. I added the author of that function to the discussion. > > Antero, I think the bug here is in the assumption that the user edits > the original text inserted by report-emacs-bug only to _add_ text. Yes, I can confirm that this is the problem. I edited the original text. Daniel From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 26 11:23:40 2025 Received: (at 79080) by debbugs.gnu.org; 26 Jul 2025 15:23:40 +0000 Received: from localhost ([127.0.0.1]:44025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ufgkN-0000Wm-T7 for submit@debbugs.gnu.org; Sat, 26 Jul 2025 11:23:40 -0400 Received: from sender4-op-o10.zoho.com ([136.143.188.10]:17024) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ufgkK-0000W9-Fm for 79080@debbugs.gnu.org; Sat, 26 Jul 2025 11:23:37 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1753543399; cv=none; d=zohomail.com; s=zohoarc; b=haYQk9B5ZuT7sHkntsbldNNJQmaiBmVpzAJopmSNOb5VgIdjmoa5Qei0nJFzfgPY0MXaz3lOWe0sh8s5lnFTIOEx2vh30eIN8L+fHi0/m7HYAnyH+UKUvlPxxCE3Bkb9OYCRNKVRdv/2To1M2hqIuiBmXWCVazoE2BEETMTY+BM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753543399; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=nXWLKYdJ8UJASuT5SWw+Dcy/tJwysVReP/Bv5pVj2Ug=; b=A6rl6hrbQP6g3mnXgWkyO7XXhxLUKroJu1eIHezCz6pOoZWa+93ok8BBykzkeuR2et1R1RPGi0JPB1BLYbKs93Bv43EhXHDzr/wbvpIyyf7LmTo6SpBbrzcA6uXAeghH5OJxhg6w7lF81bgRTMLTUNklfLIeOEwphFdbFalnFJA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=antr.me; spf=pass smtp.mailfrom=mail@antr.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1753543399; s=zmail; d=antr.me; i=mail@antr.me; h=From:From:To:To:Cc:Cc:Subject:Subject:In-Reply-To:References:Date:Date:Message-ID:MIME-Version:Content-Type:Message-Id:Reply-To; bh=nXWLKYdJ8UJASuT5SWw+Dcy/tJwysVReP/Bv5pVj2Ug=; b=KP9ogoaAAECqUWG8m2tQG32NRt4DnuLWB8M63qs38vOxBMlSwob/djyfjPOv50kE UHTsdLVkxzox241BO9UzYyJmPb452fB66AiHAwWAHo+KrFxWHcTcTfZ2hGNc97v4QCy B0siOkPapr5iJ0g6EB7HSxGSm73rY0Yr5tQH1JxQ= Received: by mx.zohomail.com with SMTPS id 1753543397285185.35179625141825; Sat, 26 Jul 2025 08:23:17 -0700 (PDT) From: Antero Mejr To: Eli Zaretskii Subject: Re: bug#79080: 31.0.50; report-emacs-bug-check-org errors with args-out-range In-Reply-To: <86bjp71dgu.fsf@gnu.org> References: <87ms8v5isr.fsf@daniel-mendler.de> <86bjp71dgu.fsf@gnu.org> Date: Sat, 26 Jul 2025 15:23:16 +0000 Message-ID: <87frejc6xn.fsf@antr.me> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Zoho-Virus-Status: 1 X-Zoho-Virus-Status: 1 X-Zoho-AV-Stamp: zmail-av-1.4.2/253.536.6 X-ZohoMailClient: External X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79080 Cc: Daniel Mendler , 79080@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 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> Date: Wed, 23 Jul 2025 11:59:48 +0200 >> From: Daniel Mendler via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> While sending my last bug report I observed the following issue, where >> `report-emacs-bug-check-org' throws an `args-out-of-range' error. I've >> got the following stack trace: >> > Antero, I think the bug here is in the assumption that the user edits > the original text inserted by report-emacs-bug only to _add_ text. > But that might not be true: users could remove some of the original > text as well. So something like the below is in order. But I also > wonder why we should look for the regular expression only in part of > the message to be sent. Can you explain why you did that? The Features: section of the original text contains the string " org ", which will match the regex and always flag a false positive. The snippet you posted works but I think it will match that " org " feature if the user removes any of the original text. I attached a patch that compares the number of matches in the original text to the edited text. This should avoid false positives unless the user deletes the " org " strings from the original text. And it will fix the error. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-index-error-when-checking-edited-bug-reports.patch >From c92b9e63f30bde4b6ec0e94ca4ece8494c21c8b6 Mon Sep 17 00:00:00 2001 From: Antero Mejr Date: Sat, 26 Jul 2025 15:13:15 +0000 Subject: [PATCH] Fix index error when checking edited bug reports * lisp/mail/emacsbug.el (report-emacs-bug-check-org): Improve regex check. (Bug#79080) --- lisp/mail/emacsbug.el | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 5ffb86e68b6..d43647a12ca 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -427,13 +427,16 @@ emacs-build-description (defun report-emacs-bug-check-org () "Warn the user if the bug report mentions org-mode." (unless report-emacs-bug-no-confirmation - (goto-char (point-max)) - (skip-chars-backward " \t\n") - (let* ((text (buffer-substring-no-properties (point-min) (point))) - (l (length report-emacs-bug-orig-text)) - (text (substring text 0 l)) - (org-regex "\\b[Oo]rg\\(-mode\\)?\\b")) - (when (string-match-p org-regex text) + (let* ((org-regex "\\(^\\|\\s-\\)[Oo]rg\\(-mode\\)?\\(\\s-\\|$\\)") + (count (lambda (r s) + (let ((c 0) (start 0)) + (while (string-match r s start) + (setq c (1+ c)) + (setq start (match-end 0))) + c))) + (m (funcall count org-regex (buffer-string))) + (m-orig (funcall count org-regex report-emacs-bug-orig-text))) + (when (> m m-orig) (when (yes-or-no-p "Is this bug about org-mode?") (error (substitute-command-keys "\ Not sending, use \\[org-submit-bug-report] to report an Org-mode bug."))))))) -- 2.34.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 01 02:46:22 2025 Received: (at control) by debbugs.gnu.org; 1 Aug 2025 06:46:23 +0000 Received: from localhost ([127.0.0.1]:54106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uhjX4-0000Pw-Hr for submit@debbugs.gnu.org; Fri, 01 Aug 2025 02:46:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42766) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uhjX1-0000PH-5c; Fri, 01 Aug 2025 02:46:20 -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 1uhjWv-0004SB-I1; Fri, 01 Aug 2025 02:46: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=cBqLJHpQAGmk/q+IksWKaiHaBR6NipwudZikuFk5yGo=; b=lDqzXedx1FSJ IEnfM+mmRkqkKSbIpjcGsXB76npkzGMmtJnh57f8eVOMAAQ2B+r47/JvesInkz2c3dxT6MNRwHGJ/ 98aI0/XHUSuQpK4iCZxxH1ZjI8bMTJaCk3wPvG+Eds2ZW0yiLgKAOU0/MKR+9tyHmR17U10PvJfA+ AKCSM04O9kXGe94N0uIfI76krNjhrZIEYr2Z/UVukfaQDIGalCKDdNNtTuL2gulvyNXfp42mB1xW9 zAtQLUgd3e8q2s39IB6s7+1C2uFxepSExiUqyVAvN6v/a90V9TYQ6AtgLBzClr5PTX1E9RYp+VzyD XNSKor1tLpZChmJRsC7T8w==; Date: Fri, 01 Aug 2025 09:46:09 +0300 Message-Id: <86v7n7tu8e.fsf@gnu.org> From: Eli Zaretskii To: Dima Kogan In-Reply-To: <87zfckhwqf.fsf@secretsauce.net> (message from Dima Kogan on Thu, 31 Jul 2025 14:32:56 -0700) Subject: Re: bug#79138: 31.0.50; (report-emacs-bug-check-org) throws an error when reporting unrelated bug References: <87zfckhwqf.fsf@secretsauce.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control Cc: 79138@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 (---) merge 79138 79080 thanks > From: Dima Kogan > Date: Thu, 31 Jul 2025 14:32:56 -0700 > > Hi. I'm using the bleeding-edge emacs from git: 99080d0c049. On Debian. > GTK. > > I just tried to M-x reportbug for something, and it repeatedly failed > because (report-emacs-bug-check-org) throws an "Args out of range" > error. The function in question: > > (defun report-emacs-bug-check-org () > "Warn the user if the bug report mentions org-mode." > (unless report-emacs-bug-no-confirmation > (goto-char (point-max)) > (skip-chars-backward " \t\n") > (let* ((text (buffer-substring-no-properties (point-min) (point))) > (l (length report-emacs-bug-orig-text)) > (text (substring text 0 l)) > (org-regex "\\b[Oo]rg\\(-mode\\)?\\b")) > (when (string-match-p org-regex text) > (when (yes-or-no-p "Is this bug about org-mode?") > (error (substitute-command-keys "\ > Not sending, use \\[org-submit-bug-report] to report an Org-mode bug."))))))) > > So it gets the current buffer text into 'text > > (goto-char (point-max)) > (text (buffer-substring-no-properties (point-min) (point))) > > And then it cuts this variable to the size of the text in > 'report-emacs-bug-orig-text. > > (l (length report-emacs-bug-orig-text)) > (text (substring text 0 l)) > > In this case report-emacs-bug-orig-text is much bigger than text, so the > (substring) fails. So currently (report-emacs-bug-check-org) is not > self-contained: it's making assumptions on the value of some external > variable ('report-emacs-bug-orig-text) when called, and if those > assumptions fail (as they do here), it dies. This is bug#79080, so I'm now merging them. If you can try the patch proposed there, it would help. (It would also help if other people with write access would examine and install patches instead of always waiting for me to do it, which sometime makes the reaction times too slow, but that's a rant.) From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 02 09:31:59 2025 Received: (at 79080-done) by debbugs.gnu.org; 2 Aug 2025 13:31:59 +0000 Received: from localhost ([127.0.0.1]:35072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uiCL8-0005kp-O2 for submit@debbugs.gnu.org; Sat, 02 Aug 2025 09:31:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36246) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uiCL6-0005kY-2v for 79080-done@debbugs.gnu.org; Sat, 02 Aug 2025 09:31:57 -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 1uiCKz-0002Ub-Lz; Sat, 02 Aug 2025 09:31:49 -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=0xKzubimS8jz1uHTG2X5higQp3qR+Gk/xMM756c2E4k=; b=ampGazwNvBy2 G/4w1dk/9A+lpR4XSizw9uXsf0WhHDZNrpkQ7jnY1LCJEGn3DVUbTYSjqSum5Ob/MsY2GlVg2AfIs +Dt2NCst5SZnJYLBMN6dr7sjkAyAjwbLIvWkWoQwQWrDPf8XfHCdW7Ecmk1x9zqVxcg27/egTac3w XEVd1jiXf7VcZvrH0NzFHynvAztTDJri+eRP0HmTumMjBbCV0XwGm84bVcJG5oU6FuIPH6VzoZ5fQ pHZj/pYGcozkPmVMOsm/gMgpAAd7PepidBWv+zvLKd9ux9+nUHm1n0R0LTAd1nFWZ7dWPIFighmKU vXeEiXP8ACwjNo8sMtSB9Q==; Date: Sat, 02 Aug 2025 16:31:46 +0300 Message-Id: <865xf5svct.fsf@gnu.org> From: Eli Zaretskii To: Antero Mejr In-Reply-To: <87frejc6xn.fsf@antr.me> (message from Antero Mejr on Sat, 26 Jul 2025 15:23:16 +0000) Subject: Re: bug#79080: 31.0.50; report-emacs-bug-check-org errors with args-out-range References: <87ms8v5isr.fsf@daniel-mendler.de> <86bjp71dgu.fsf@gnu.org> <87frejc6xn.fsf@antr.me> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79080-done Cc: mail@daniel-mendler.de, 79080-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: Antero Mejr > Cc: Daniel Mendler , 79080@debbugs.gnu.org > Date: Sat, 26 Jul 2025 15:23:16 +0000 > > Eli Zaretskii writes: > > >> Date: Wed, 23 Jul 2025 11:59:48 +0200 > >> From: Daniel Mendler via "Bug reports for GNU Emacs, > >> the Swiss army knife of text editors" > >> > >> While sending my last bug report I observed the following issue, where > >> `report-emacs-bug-check-org' throws an `args-out-of-range' error. I've > >> got the following stack trace: > >> > > Antero, I think the bug here is in the assumption that the user edits > > the original text inserted by report-emacs-bug only to _add_ text. > > But that might not be true: users could remove some of the original > > text as well. So something like the below is in order. But I also > > wonder why we should look for the regular expression only in part of > > the message to be sent. Can you explain why you did that? > > The Features: section of the original text contains the string " org ", > which will match the regex and always flag a false positive. > > The snippet you posted works but I think it will match that " org " > feature if the user removes any of the original text. > > I attached a patch that compares the number of matches in the original > text to the edited text. This should avoid false positives unless the > user deletes the " org " strings from the original text. And it will fix > the error. Thanks, now installed on the master branch, and closing the bug. From unknown Fri Sep 19 06:16:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 31 Aug 2025 11:24:09 +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