GNU bug report logs - #79138
31.0.50; (report-emacs-bug-check-org) throws an error when reporting unrelated bug

Previous Next

Package: emacs;

Reported by: Dima Kogan <dima <at> secretsauce.net>

Date: Thu, 31 Jul 2025 21:31:02 UTC

Severity: normal

Merged with 79080

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

To reply to this bug, email your comments to 79138 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#79138; Package emacs. (Thu, 31 Jul 2025 21:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dima Kogan <dima <at> secretsauce.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 31 Jul 2025 21:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dima Kogan <dima <at> secretsauce.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; (report-emacs-bug-check-org) throws an error when
 reporting unrelated bug
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.

Thanks




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79138; Package emacs. (Fri, 01 Aug 2025 06:47:01 GMT) Full text and rfc822 format available.

Message #8 received at 79138 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dima Kogan <dima <at> secretsauce.net>
Cc: 79138 <at> debbugs.gnu.org
Subject: Re: bug#79138: 31.0.50;
 (report-emacs-bug-check-org) throws an error when reporting unrelated
 bug
Date: Fri, 01 Aug 2025 09:46:09 +0300
merge 79138 79080
thanks

> From: Dima Kogan <dima <at> secretsauce.net>
> 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.)




Merged 79080 79138. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 01 Aug 2025 06:47:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79138; Package emacs. (Sat, 02 Aug 2025 13:34:02 GMT) Full text and rfc822 format available.

Message #13 received at 79138 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: dima <at> secretsauce.net
Cc: 79138 <at> debbugs.gnu.org
Subject: Re: bug#79138: 31.0.50;
 (report-emacs-bug-check-org) throws an error when reporting unrelated
 bug
Date: Sat, 02 Aug 2025 16:32:52 +0300
> Cc: 79138 <at> debbugs.gnu.org
> Date: Fri, 01 Aug 2025 09:46:09 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> merge 79138 79080
> thanks
> 
> > From: Dima Kogan <dima <at> secretsauce.net>
> > 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.

The bug should be fixed now.




This bug report was last modified 7 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.