GNU bug report logs -
#24166
With --eval, errors in string-match-p do not produce backtraces (but errors in string-match do?!)
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24166 in the body.
You can then email your comments to 24166 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24166
; Package
emacs
.
(Sat, 06 Aug 2016 01:58:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Clément Pit--Claudel <clement.pitclaudel <at> live.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 06 Aug 2016 01:58:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hey bug-gnu-emacs,
Is the following a bug?
# No backtrace?!
$ emacs -Q --batch --eval '(setq debug-on-error t)' --eval '(string-match-p nil "A")'
Wrong type argument: stringp, nil
# Yes backtrace?!?
$ emacs -Q --batch --eval '(setq debug-on-error t)' --eval '(string-match nil "A")'
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
string-match(nil "A")
eval((string-match nil "A"))
...
This isn't new, but it behaved differently in Emacs 24.5:
$ emacs-24.5 -Q --batch --eval '(setq debug-on-error t)' --eval '(string-match nil "A")'
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
string-match(nil "A")
eval((string-match nil "A"))
...
$ emacs-24.5 -Q --batch --eval '(setq debug-on-error t)' --eval '(string-match-p nil "A")'
Args out of range: 0
Clément.
In GNU Emacs 25.1.50.7 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
of 2016-07-20 built on clem-w50-mint
Repository revision: a1a0c208e3e895a6ea0942e8e5c4077faf12c7ad
Windowing system distributor 'The X.Org Foundation', version 11.0.11803000
System Description: Linux Mint 18 Sarah
[signature.asc (application/pgp-signature, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24166
; Package
emacs
.
(Sat, 06 Aug 2016 02:16:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 24166 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
merge 23949 24166
quit
Clément Pit--Claudel <clement.pitclaudel <at> live.com> writes:
> Hey bug-gnu-emacs,
>
> Is the following a bug?
Yes, it's another instance of #23949
Actually, I wonder why the trivial fix suggested there wasn't applied already:
[v1-0001-Fix-debugging-of-string-match-p-errors.patch (text/plain, inline)]
From d7c19f35861f12a16e7571340f3f0802a7e85adb Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Fri, 5 Aug 2016 22:11:00 -0400
Subject: [PATCH v1] Fix debugging of string-match-p errors
* lisp/emacs-lisp/debug.el (debug): Bind inhibit-changing-match-data to
nil so that debugger code that needs to do regexp match won't break
(Bug #23949, Bug #24166, Bug#16294).
---
lisp/emacs-lisp/debug.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 22a3f39..22f86e4 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -177,6 +177,7 @@ debug
(or enable-recursive-minibuffers (> (minibuffer-depth) 0)))
(standard-input t) (standard-output t)
inhibit-redisplay
+ inhibit-changing-match-data
(cursor-in-echo-area nil)
(window-configuration (current-window-configuration)))
(unwind-protect
--
2.8.0
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24166
; Package
emacs
.
(Sat, 06 Aug 2016 03:05:01 GMT)
Full text and
rfc822 format available.
Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 2016-08-05 22:15, npostavs <at> users.sourceforge.net wrote:
> merge 23949 24166
> quit
>
> Clément Pit--Claudel <clement.pitclaudel <at> live.com> writes:
>
>> Hey bug-gnu-emacs,
>>
>> Is the following a bug?
>
> Yes, it's another instance of #23949
>
> Actually, I wonder why the trivial fix suggested there wasn't applied already:
Thanks Noam. I did try to search for dupes before posting, but my debbugs-fu is still limited; sorry about this!
Clément.
[signature.asc (application/pgp-signature, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24166
; Package
emacs
.
(Sat, 06 Aug 2016 07:26:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 24166 <at> debbugs.gnu.org (full text, mbox):
> From: npostavs <at> users.sourceforge.net
> Date: Fri, 05 Aug 2016 22:15:09 -0400
> Cc: 24166 <at> debbugs.gnu.org
>
> > Is the following a bug?
>
> Yes, it's another instance of #23949
Indeed.
> Actually, I wonder why the trivial fix suggested there wasn't applied already:
I think Andreas's suggestion to do this in call_debugger is more
robust, because it does that for _any_ debugger whose value is placed
in the 'debugger' variable, not just for debug.el.
Would you please make that change?
TIA
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24166
; Package
emacs
.
(Sat, 06 Aug 2016 10:29:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 24166 <at> debbugs.gnu.org (full text, mbox):
On Sat, Aug 6, 2016 at 3:25 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> I think Andreas's suggestion to do this in call_debugger is more
> robust, because it does that for _any_ debugger whose value is placed
> in the 'debugger' variable, not just for debug.el.
What about all the other variables that debug.el is binding? (I see
that they both bind inhibit-redisplay to nil)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24166
; Package
emacs
.
(Sat, 06 Aug 2016 10:35:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 24166 <at> debbugs.gnu.org (full text, mbox):
> From: Noam Postavsky <npostavs <at> users.sourceforge.net>
> Date: Sat, 6 Aug 2016 06:28:10 -0400
> Cc: Clément Pit--Claudel <clement.pitclaudel <at> live.com>,
> 24166 <at> debbugs.gnu.org
>
> On Sat, Aug 6, 2016 at 3:25 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> > I think Andreas's suggestion to do this in call_debugger is more
> > robust, because it does that for _any_ debugger whose value is placed
> > in the 'debugger' variable, not just for debug.el.
>
> What about all the other variables that debug.el is binding? (I see
> that they both bind inhibit-redisplay to nil)
Sorry, I don't understand how those variables are related to the issue
at hand. What am I missing?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24166
; Package
emacs
.
(Sat, 06 Aug 2016 10:50:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 24166 <at> debbugs.gnu.org (full text, mbox):
On Sat, Aug 6, 2016 at 6:34 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> From: Noam Postavsky <npostavs <at> users.sourceforge.net>
>> Date: Sat, 6 Aug 2016 06:28:10 -0400
>> Cc: Clément Pit--Claudel <clement.pitclaudel <at> live.com>,
>> 24166 <at> debbugs.gnu.org
>>
>> On Sat, Aug 6, 2016 at 3:25 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> > I think Andreas's suggestion to do this in call_debugger is more
>> > robust, because it does that for _any_ debugger whose value is placed
>> > in the 'debugger' variable, not just for debug.el.
>>
>> What about all the other variables that debug.el is binding? (I see
>> that they both bind inhibit-redisplay to nil)
>
> Sorry, I don't understand how those variables are related to the issue
> at hand. What am I missing?
Not related to this issue as such, but if we want to bind
inhibit-changing-match-data for all debuggers, why not the others too?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24166
; Package
emacs
.
(Sat, 06 Aug 2016 11:21:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 24166 <at> debbugs.gnu.org (full text, mbox):
> From: Noam Postavsky <npostavs <at> users.sourceforge.net>
> Date: Sat, 6 Aug 2016 06:49:41 -0400
> Cc: Clément Pit--Claudel <clement.pitclaudel <at> live.com>,
> 24166 <at> debbugs.gnu.org
>
> On Sat, Aug 6, 2016 at 6:34 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> >> From: Noam Postavsky <npostavs <at> users.sourceforge.net>
> >> Date: Sat, 6 Aug 2016 06:28:10 -0400
> >> Cc: Clément Pit--Claudel <clement.pitclaudel <at> live.com>,
> >> 24166 <at> debbugs.gnu.org
> >>
> >> On Sat, Aug 6, 2016 at 3:25 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> >> > I think Andreas's suggestion to do this in call_debugger is more
> >> > robust, because it does that for _any_ debugger whose value is placed
> >> > in the 'debugger' variable, not just for debug.el.
> >>
> >> What about all the other variables that debug.el is binding? (I see
> >> that they both bind inhibit-redisplay to nil)
> >
> > Sorry, I don't understand how those variables are related to the issue
> > at hand. What am I missing?
>
> Not related to this issue as such, but if we want to bind
> inhibit-changing-match-data for all debuggers, why not the others too?
Which ones specifically did you have in mind? We need to consider
each one carefully, in order to determine whether every debugger needs
that, or just debug.el.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24166
; Package
emacs
.
(Sat, 06 Aug 2016 12:26:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 24166 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Not related to this issue as such, but if we want to bind
>> inhibit-changing-match-data for all debuggers, why not the others too?
>
> Which ones specifically did you have in mind? We need to consider
> each one carefully, in order to determine whether every debugger needs
> that, or just debug.el.
Well I thought all of the ones in the let-binding except
enable-recursive-minibuffers (which has a comment about a specific
debug.el command) and window-configuration (which is just a local
lexical variable), as they don't look debug.el specific. But I don't
really have the patience for careful consideration of each variable just
to solve some hypothetical problems, so let's leave it for another time.
Here's the new patch. Is it correct to put the DEFSYM next to the
DEFVAR_LISP? I saw a few places where they were separated, but that
seems odd since it's then documented twice, and I thought maybe it's
just because they happened to be added at different times by people who
didn't notice the existing definition.
[v2-0001-Fix-debugging-of-string-match-p-errors.patch (text/plain, inline)]
From 9249fece6255615b63cd6848250003051f21cd1c Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Fri, 5 Aug 2016 22:11:00 -0400
Subject: [PATCH v2] Fix debugging of string-match-p errors
* src/eval.c (call_debugger): Bind inhibit-changing-match-data to nil so
that debugger code that needs to do regexp match won't break
(Bug #23949, Bug #24166, Bug#16294).
---
src/eval.c | 4 ++++
src/search.c | 1 +
2 files changed, 5 insertions(+)
diff --git a/src/eval.c b/src/eval.c
index 33b82f7..bf5bed7 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -300,6 +300,10 @@ call_debugger (Lisp_Object arg)
specbind (Qinhibit_redisplay, Qnil);
specbind (Qinhibit_debugger, Qt);
+ /* If we are debugging an error within a call to `string-match-p',
+ then make sure debugger code can still use match data. */
+ specbind (Qinhibit_changing_match_data, Qnil);
+
#if 0 /* Binding this prevents execution of Lisp code during
redisplay, which necessarily leads to display problems. */
specbind (Qinhibit_eval_during_redisplay, Qt);
diff --git a/src/search.c b/src/search.c
index 5dc4d35..9b8fc58 100644
--- a/src/search.c
+++ b/src/search.c
@@ -3390,6 +3390,7 @@ or other such regexp constructs are not replaced with this.
A value of nil (which is the normal value) means treat spaces literally. */);
Vsearch_spaces_regexp = Qnil;
+ DEFSYM (Qinhibit_changing_match_data, "inhibit-changing-match-data");
DEFVAR_LISP ("inhibit-changing-match-data", Vinhibit_changing_match_data,
doc: /* Internal use only.
If non-nil, the primitive searching and matching functions
--
2.8.0
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24166
; Package
emacs
.
(Sun, 07 Aug 2016 14:13:01 GMT)
Full text and
rfc822 format available.
Message #34 received at 24166 <at> debbugs.gnu.org (full text, mbox):
> From: npostavs <at> users.sourceforge.net
> Cc: 24166 <at> debbugs.gnu.org, clement.pitclaudel <at> live.com
> Date: Sat, 06 Aug 2016 08:25:17 -0400
>
> Here's the new patch.
Thanks. I have one minor comment below.
> Is it correct to put the DEFSYM next to the DEFVAR_LISP?
It isn't incorrect, and even eval.c already does that.
> + /* If we are debugging an error within a call to `string-match-p',
> + then make sure debugger code can still use match data. */
Please mention in the comment that string-match-p binds
inhibit-changing-match-data, and that it is only one example of that.
Otherwise, LGTM, thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24166
; Package
emacs
.
(Sun, 07 Aug 2016 14:28:02 GMT)
Full text and
rfc822 format available.
Message #37 received at 24166 <at> debbugs.gnu.org (full text, mbox):
tags 24166 fixed
close 24166 25.2
quit
Pushed as 7fb75680
Added tag(s) fixed.
Request was from
npostavs <at> users.sourceforge.net
to
control <at> debbugs.gnu.org
.
(Sun, 07 Aug 2016 14:28:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 25.2, send any further explanations to
24166 <at> debbugs.gnu.org and Clément Pit--Claudel <clement.pitclaudel <at> live.com>
Request was from
npostavs <at> users.sourceforge.net
to
control <at> debbugs.gnu.org
.
(Sun, 07 Aug 2016 14:28:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24166
; Package
emacs
.
(Sun, 07 Aug 2016 15:45:01 GMT)
Full text and
rfc822 format available.
Message #44 received at 24166 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 2016-08-07 10:27, npostavs <at> users.sourceforge.net wrote:
> tags 24166 fixed
> close 24166 25.2
> quit
>
> Pushed as 7fb75680
Yay! Thanks everyone :)
[signature.asc (application/pgp-signature, attachment)]
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 07 Sep 2016 11:24:04 GMT)
Full text and
rfc822 format available.
bug unarchived.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sun, 04 Dec 2016 02:50:04 GMT)
Full text and
rfc822 format available.
bug Marked as fixed in versions 26.1.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sun, 04 Dec 2016 02:50:04 GMT)
Full text and
rfc822 format available.
bug No longer marked as fixed in versions 25.2.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sun, 04 Dec 2016 02:50:04 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 01 Jan 2017 12:24:16 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 168 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.