GNU bug report logs - #61395
28.2; bug-reference warning seems incorrect

Previous Next

Package: emacs;

Reported by: Tom Tromey <tom <at> tromey.com>

Date: Thu, 9 Feb 2023 19:10:02 UTC

Severity: normal

Found in version 28.2

Done: Tassilo Horn <tsdh <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Tassilo Horn <tsdh <at> gnu.org>
To: Tom Tromey <tom <at> tromey.com>
Cc: Basil Contovounesios <contovob <at> tcd.ie>, Eli Zaretskii <eliz <at> gnu.org>,
 61395 <at> debbugs.gnu.org
Subject: Re: bug#61395: 28.2; bug-reference warning seems incorrect
Date: Fri, 10 Feb 2023 18:21:09 +0100
Tom Tromey <tom <at> tromey.com> writes:

>> I'll have a look later today!
>
> It seems difficult to reproduce.  I can't do it reliably.
>
> My co-worker Kévin suggested that perhaps the problem is here, in
> bug-reference-fontify:
>
>       (while (and (< (point) end-line)
>                   (re-search-forward bug-reference-bug-regexp end-line 'move))
>         (when (or (not bug-reference-prog-mode)
>                   ;; This tests for both comment and string syntax.
>                   (nth 8 (syntax-ppss)))
>
> ... with the question being whether the call to syntax-ppss needs to
> be wrapped in save-match-data.

Hm, I've tried somthing like

  (while (re-search-forward "\\(NILP\\)\\(.*\\)$" nil t)
    (syntax-ppss-flush-cache (point-min))
    (let ((md (match-data)))
      (syntax-ppss)
      (unless (equal md (match-data))
        (error "Match-data clobbered: %S %S" md (match-data)))))

many times in buffer.c but `syntax-ppss' doesn't seem to clobber
match-data.

If you can reproduce the issue, try changing
`bug-reference--overlay-bounds' so that the check

  (member bug-reference-bug-regexp
          bug-reference--nonconforming-regexps)

isn't performed inhibiting the warning for this regexp and add some more
info to the warning message like (match-string N) for N in 0..9.  If the
match-data isn't about matches of `bug-reference-bug-regexp', we are on
the right track, i.e., someone clobbers our match data.

Bye,
Tassilo




This bug report was last modified 2 years and 101 days ago.

Previous Next


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