all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Maury, Olivier" <Olivier_Maury@mentor.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: RE: stack overflow in regexp matcher with gdb
Date: Fri, 15 Nov 2013 13:19:56 +0000	[thread overview]
Message-ID: <F1072D027E48DD4F93B3FDC2992B4961AE27577A@EU-MBX-01.mgc.mentorg.com> (raw)
In-Reply-To: <jwveh6i7pkf.fsf-monnier+emacs@gnu.org>

Well I'm not fluent in Lisp so it's difficult for me to really understand what it's doing. But, based on the trace I got and what I can guess from the gdb-ui.el file, I suppose that function is here to get the value of each local parameter of the function and to print that into the "Locals" frame buffer. 
So when, as it is the case here, you have a very very large number of local variables (something around 2500 variables with some of them that are double arrays on the stack and with significantly long names)... it seems it fails.
I wish I knew more about Lisp in order to propose a fix... Assuming my guess is correct, if we could, for example, parameterize the number of variables that we can monitor in the "Locals" buffer then we could just process only a part of that huge list and maybe it wouldn't fail or take ages to refresh ?

Olivier

-----Original Message-----
From: Stefan Monnier [mailto:monnier@iro.umontreal.ca] 
Sent: Thursday, November 14, 2013 20:31
To: Maury, Olivier
Cc: help-gnu-emacs@gnu.org
Subject: Re: stack overflow in regexp matcher with gdb

> I tried with the 24.3 version of emacs and the gdb -i=mi interface. It 
> seems it works a little bit better (doesn't fail with that kind of 
> error). However when I do a "next" the first one is ok but the second 
> "next" is very slow and then it's ok again and then it's very slow 
> again, etc... and from time to time the gdb prompt is no longer 
> printed even though I can still enter gdb commands...

Hmm... performance bugs can be even worse to track down :-(

> Using gud-gdb with the 24.3 version of emacs seems even more weird as 
> it doesn't show the source files I've stop in...

That's odd as well: for me it does jump to the source.  `gud-gdb' should be the "safe fallback", so please report a bug about this, providing as much details as you can.

>   looking-at(",value=\\(\".*\"\\).*?}")

Indeed, this regexp is problematic.  Do you have some idea what the text can be between the quotes?
IOW can we use (looking-at ",value=\\(\"[^\"]*\"\\).*?}") instead (which would eliminate the backtracking), or is the a risk of the value containing a " somewhere (and if so, how is it quoted?)?

The 24.3 code is pretty different, but I see the same kind of regexp, so the same problem is probably present as well.


        Stefan



  reply	other threads:[~2013-11-15 13:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 11:13 stack overflow in regexp matcher with gdb Maury, Olivier
2013-11-13 19:06 ` Stefan Monnier
2013-11-14 12:10   ` Maury, Olivier
2013-11-14 19:31     ` Stefan Monnier
2013-11-15 13:19       ` Maury, Olivier [this message]
2013-11-15 14:18         ` Stefan Monnier
2013-11-15 14:48           ` Eli Zaretskii
2013-11-17 22:50             ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F1072D027E48DD4F93B3FDC2992B4961AE27577A@EU-MBX-01.mgc.mentorg.com \
    --to=olivier_maury@mentor.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.