help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: stack overflow in regexp matcher with gdb


From: Maury, Olivier
Subject: RE: stack overflow in regexp matcher with gdb
Date: Thu, 14 Nov 2013 12:10:36 +0000

Hello,

Thanks for the tips.

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... 
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... it's like if I was using gdb in a 
terminal. And if I use gdb --annotate=3 it's not better.

Here is what I got with the 23.4 version of emacs:
Debugger entered--Lisp error: (error "Stack overflow in regexp matcher")
  looking-at(",value=\\(\".*\"\\).*?}")
  gdb-stack-list-locals-handler()
  gdb-prompt("")
  
gud-gdba-marker-filter("e=\"double\",value=\"0\"},{name=\"sD2901\",type=\"double\",value=\"0\"},{name=\"sD2902\",type=\"double\",value=\"0\"},{name=\"sD2903\",type=\"double\",value=\"0\"},{name=\"sD2904\",type=\"double\",value=\"0\"},{name=\"sD2905\",type=\"double\",value=\"0\"},{name=\"sD2906\",type=\"double\",value=\"0\"},{name=\"sD2907\",type=\"double\",value=\"0\"},{name=\"sD2908\",type=\"double\",value=\"0\"},{name=\"sD2909\",type=\"double\",value=\"0\"},{name=\"sD2910\",type=\"double\",value=\"0\"},{name=\"sD2911\",type=\"double\",value=\"0\"},{name=\"sD2912\",type=\"double\",value=\"0\"},{name=\"sD2913\",type=\"double\",value=\"0\"},{name=\"sD2914\",type=\"double\",value=\"0\"},{name=\"sD2915\",type=\"double\",value=\"0\"},{name=\"sD2916\",type=\"double\",value=\"0\"},{name=\"sD2917\",type=\"double\",value=\"0\"},{name=\"sD2918\",type=\"double\",value=\"0\"},{name=\"sD2919\",type=\"double\",value=\"0\"},{name=\"sD2920\",type=\"double\",value=\"0\"},{name=\"sD2921\",type=\"double\",value=\"0\"},{name=\"sD2922\",type=\"double\",value=\"0\"},{name=\"sD2923\",type=\"double\",value=\"0\"},{name=\"sD2924\",type=\"double\",value=\"0\"},{name=\"sD2953\",type=\"double\",value=\"0\"},{name=\"sD2954\",type=\"double\",value=\"0\"},{name=\"sD2955\",type=\"double\",value=\"0\"},{name=\"sD2956\",type=\"double\",value=\"0\"},{name=\"sD2957\",type=\"double\",value=\"0\"},{name=\"sD2958\",type=\"double\",value=\"0\"},{name=\"sD2959\",type=\"double\",value=\"0\"},{name=\"sD2960\",type=\"double\",value=\"0\"},{name=\"sD2961\",type=\"double\",value=\"0\"},{name=\"sD2962\",type=\"double\",value=\"0\"},{name=\"sD2963\",type=\"double\",value=\"0\"},{name=\"sD2964\",type=\"double\",value=\"0\"},{name=\"sD2965\",type=\"double\",value=\"0\"},{name=\"sD2966\",type=\"double\",value=\"0\"},{name=\"sD2967\",type=\"double\",value=\"0\"},{name=\"sD2968\",type=\"double\",value=\"0\"},{name=\"sD2969\",type=\"double\",value=\"0\"},{name=\"sD2970\",type=\"double\",value=\"0\"},{name=\"sD2971\",type=\"double\",value=\"0\"},{name=\"sD2972\",type=\"double\",value=\"0\"},{name=\"sD2973\",type=\"double\",value=\"0\"},{name=\"sD2974\",type=\"double\",value=\"0\"},{name=\"sD2975\",type=\"double\",value=\"0\"},{name=\"sD2976\",type=\"double\",value=\"0\"},{name=\"sD2977\",type=\"double\",value=\"0\"},{name=\"sD2978\",type=\"double\",value=\"0\"},{name=\"sD2979\",type=\"double\",value=\"0\"},{name=\"sD2980\",type=\"double\",value=\"0\"},{name=\"sD2981\",type=\"double\",value=\"0\"},{name=\"sD2982\",type=\"double\",value=\"0\"},{name=\"sD2983\",type=\"double\",value=\"0\"},{name=\"sD2984\",type=\"double\",value=\"0\"},{name=\"sD2985\",type=\"double\",value=\"0\"},{name=\"sD2986\",type=\"double\",value=\"0\"},{name=\"sD2987\",type=\"double\",value=\"0\"},{name=\"sD2988\",type=\"double\",value=\"0\"},{name=\"sD2989\",type=\"double\",value=\"0\"},{name=\"sD2990\",type=\"double\",value=\"0\"}]\n\npre-prompt\n(gdb)
 \nprompt\n")
  apply(gud-gdba-marker-filter 
"e=\"double\",value=\"0\"},{name=\"sD2901\",type=\"double\",value=\"0\"},{name=\"sD2902\",type=\"double\",value=\"0\"},{name=\"sD2903\",type=\"double\",value=\"0\"},{name=\"sD2904\",type=\"double\",value=\"0\"},{name=\"sD2905\",type=\"double\",value=\"0\"},{name=\"sD2906\",type=\"double\",value=\"0\"},{name=\"sD2907\",type=\"double\",value=\"0\"},{name=\"sD2908\",type=\"double\",value=\"0\"},{name=\"sD2909\",type=\"double\",value=\"0\"},{name=\"sD2910\",type=\"double\",value=\"0\"},{name=\"sD2911\",type=\"double\",value=\"0\"},{name=\"sD2912\",type=\"double\",value=\"0\"},{name=\"sD2913\",type=\"double\",value=\"0\"},{name=\"sD2914\",type=\"double\",value=\"0\"},{name=\"sD2915\",type=\"double\",value=\"0\"},{name=\"sD2916\",type=\"double\",value=\"0\"},{name=\"sD2917\",type=\"double\",value=\"0\"},{name=\"sD2918\",type=\"double\",value=\"0\"},{name=\"sD2919\",type=\"double\",value=\"0\"},{name=\"sD2920\",type=\"double\",value=\"0\"},{name=\"sD2921\",type=\"double\",value=\"0\"},{name=\"sD2922\",type=\"double\",value=\"0\"},{name=\"sD2923\",type=\"double\",value=\"0\"},{name=\"sD2924\",type=\"double\",value=\"0\"},{name=\"sD2953\",type=\"double\",value=\"0\"},{name=\"sD2954\",type=\"double\",value=\"0\"},{name=\"sD2955\",type=\"double\",value=\"0\"},{name=\"sD2956\",type=\"double\",value=\"0\"},{name=\"sD2957\",type=\"double\",value=\"0\"},{name=\"sD2958\",type=\"double\",value=\"0\"},{name=\"sD2959\",type=\"double\",value=\"0\"},{name=\"sD2960\",type=\"double\",value=\"0\"},{name=\"sD2961\",type=\"double\",value=\"0\"},{name=\"sD2962\",type=\"double\",value=\"0\"},{name=\"sD2963\",type=\"double\",value=\"0\"},{name=\"sD2964\",type=\"double\",value=\"0\"},{name=\"sD2965\",type=\"double\",value=\"0\"},{name=\"sD2966\",type=\"double\",value=\"0\"},{name=\"sD2967\",type=\"double\",value=\"0\"},{name=\"sD2968\",type=\"double\",value=\"0\"},{name=\"sD2969\",type=\"double\",value=\"0\"},{name=\"sD2970\",type=\"double\",value=\"0\"},{name=\"sD2971\",type=\"double\",value=\"0\"},{name=\"sD2972\",type=\"double\",value=\"0\"},{name=\"sD2973\",type=\"double\",value=\"0\"},{name=\"sD2974\",type=\"double\",value=\"0\"},{name=\"sD2975\",type=\"double\",value=\"0\"},{name=\"sD2976\",type=\"double\",value=\"0\"},{name=\"sD2977\",type=\"double\",value=\"0\"},{name=\"sD2978\",type=\"double\",value=\"0\"},{name=\"sD2979\",type=\"double\",value=\"0\"},{name=\"sD2980\",type=\"double\",value=\"0\"},{name=\"sD2981\",type=\"double\",value=\"0\"},{name=\"sD2982\",type=\"double\",value=\"0\"},{name=\"sD2983\",type=\"double\",value=\"0\"},{name=\"sD2984\",type=\"double\",value=\"0\"},{name=\"sD2985\",type=\"double\",value=\"0\"},{name=\"sD2986\",type=\"double\",value=\"0\"},{name=\"sD2987\",type=\"double\",value=\"0\"},{name=\"sD2988\",type=\"double\",value=\"0\"},{name=\"sD2989\",type=\"double\",value=\"0\"},{name=\"sD2990\",type=\"double\",value=\"0\"}]\n\npre-prompt\n(gdb)
 \nprompt\n")
  
gud-marker-filter("e=\"double\",value=\"0\"},{name=\"sD2901\",type=\"double\",value=\"0\"},{name=\"sD2902\",type=\"double\",value=\"0\"},{name=\"sD2903\",type=\"double\",value=\"0\"},{name=\"sD2904\",type=\"double\",value=\"0\"},{name=\"sD2905\",type=\"double\",value=\"0\"},{name=\"sD2906\",type=\"double\",value=\"0\"},{name=\"sD2907\",type=\"double\",value=\"0\"},{name=\"sD2908\",type=\"double\",value=\"0\"},{name=\"sD2909\",type=\"double\",value=\"0\"},{name=\"sD2910\",type=\"double\",value=\"0\"},{name=\"sD2911\",type=\"double\",value=\"0\"},{name=\"sD2912\",type=\"double\",value=\"0\"},{name=\"sD2913\",type=\"double\",value=\"0\"},{name=\"sD2914\",type=\"double\",value=\"0\"},{name=\"sD2915\",type=\"double\",value=\"0\"},{name=\"sD2916\",type=\"double\",value=\"0\"},{name=\"sD2917\",type=\"double\",value=\"0\"},{name=\"sD2918\",type=\"double\",value=\"0\"},{name=\"sD2919\",type=\"double\",value=\"0\"},{name=\"sD2920\",type=\"double\",value=\"0\"},{name=\"sD2921\",type=\"double\",value=\"0\"},{name=\"sD2922\",type=\"double\",value=\"0\"},{name=\"sD2923\",type=\"double\",value=\"0\"},{name=\"sD2924\",type=\"double\",value=\"0\"},{name=\"sD2953\",type=\"double\",value=\"0\"},{name=\"sD2954\",type=\"double\",value=\"0\"},{name=\"sD2955\",type=\"double\",value=\"0\"},{name=\"sD2956\",type=\"double\",value=\"0\"},{name=\"sD2957\",type=\"double\",value=\"0\"},{name=\"sD2958\",type=\"double\",value=\"0\"},{name=\"sD2959\",type=\"double\",value=\"0\"},{name=\"sD2960\",type=\"double\",value=\"0\"},{name=\"sD2961\",type=\"double\",value=\"0\"},{name=\"sD2962\",type=\"double\",value=\"0\"},{name=\"sD2963\",type=\"double\",value=\"0\"},{name=\"sD2964\",type=\"double\",value=\"0\"},{name=\"sD2965\",type=\"double\",value=\"0\"},{name=\"sD2966\",type=\"double\",value=\"0\"},{name=\"sD2967\",type=\"double\",value=\"0\"},{name=\"sD2968\",type=\"double\",value=\"0\"},{name=\"sD2969\",type=\"double\",value=\"0\"},{name=\"sD2970\",type=\"double\",value=\"0\"},{name=\"sD2971\",type=\"double\",value=\"0\"},{name=\"sD2972\",type=\"double\",value=\"0\"},{name=\"sD2973\",type=\"double\",value=\"0\"},{name=\"sD2974\",type=\"double\",value=\"0\"},{name=\"sD2975\",type=\"double\",value=\"0\"},{name=\"sD2976\",type=\"double\",value=\"0\"},{name=\"sD2977\",type=\"double\",value=\"0\"},{name=\"sD2978\",type=\"double\",value=\"0\"},{name=\"sD2979\",type=\"double\",value=\"0\"},{name=\"sD2980\",type=\"double\",value=\"0\"},{name=\"sD2981\",type=\"double\",value=\"0\"},{name=\"sD2982\",type=\"double\",value=\"0\"},{name=\"sD2983\",type=\"double\",value=\"0\"},{name=\"sD2984\",type=\"double\",value=\"0\"},{name=\"sD2985\",type=\"double\",value=\"0\"},{name=\"sD2986\",type=\"double\",value=\"0\"},{name=\"sD2987\",type=\"double\",value=\"0\"},{name=\"sD2988\",type=\"double\",value=\"0\"},{name=\"sD2989\",type=\"double\",value=\"0\"},{name=\"sD2990\",type=\"double\",value=\"0\"}]\n\npre-prompt\n(gdb)
 \nprompt\n")
  gud-filter(#<process gud-my_exe_64.exe> 
"e=\"double\",value=\"0\"},{name=\"sD2901\",type=\"double\",value=\"0\"},{name=\"sD2902\",type=\"double\",value=\"0\"},{name=\"sD2903\",type=\"double\",value=\"0\"},{name=\"sD2904\",type=\"double\",value=\"0\"},{name=\"sD2905\",type=\"double\",value=\"0\"},{name=\"sD2906\",type=\"double\",value=\"0\"},{name=\"sD2907\",type=\"double\",value=\"0\"},{name=\"sD2908\",type=\"double\",value=\"0\"},{name=\"sD2909\",type=\"double\",value=\"0\"},{name=\"sD2910\",type=\"double\",value=\"0\"},{name=\"sD2911\",type=\"double\",value=\"0\"},{name=\"sD2912\",type=\"double\",value=\"0\"},{name=\"sD2913\",type=\"double\",value=\"0\"},{name=\"sD2914\",type=\"double\",value=\"0\"},{name=\"sD2915\",type=\"double\",value=\"0\"},{name=\"sD2916\",type=\"double\",value=\"0\"},{name=\"sD2917\",type=\"double\",value=\"0\"},{name=\"sD2918\",type=\"double\",value=\"0\"},{name=\"sD2919\",type=\"double\",value=\"0\"},{name=\"sD2920\",type=\"double\",value=\"0\"},{name=\"sD2921\",type=\"double\",value=\"0\"},{name=\"sD2922\",type=\"double\",value=\"0\"},{name=\"sD2923\",type=\"double\",value=\"0\"},{name=\"sD2924\",type=\"double\",value=\"0\"},{name=\"sD2953\",type=\"double\",value=\"0\"},{name=\"sD2954\",type=\"double\",value=\"0\"},{name=\"sD2955\",type=\"double\",value=\"0\"},{name=\"sD2956\",type=\"double\",value=\"0\"},{name=\"sD2957\",type=\"double\",value=\"0\"},{name=\"sD2958\",type=\"double\",value=\"0\"},{name=\"sD2959\",type=\"double\",value=\"0\"},{name=\"sD2960\",type=\"double\",value=\"0\"},{name=\"sD2961\",type=\"double\",value=\"0\"},{name=\"sD2962\",type=\"double\",value=\"0\"},{name=\"sD2963\",type=\"double\",value=\"0\"},{name=\"sD2964\",type=\"double\",value=\"0\"},{name=\"sD2965\",type=\"double\",value=\"0\"},{name=\"sD2966\",type=\"double\",value=\"0\"},{name=\"sD2967\",type=\"double\",value=\"0\"},{name=\"sD2968\",type=\"double\",value=\"0\"},{name=\"sD2969\",type=\"double\",value=\"0\"},{name=\"sD2970\",type=\"double\",value=\"0\"},{name=\"sD2971\",type=\"double\",value=\"0\"},{name=\"sD2972\",type=\"double\",value=\"0\"},{name=\"sD2973\",type=\"double\",value=\"0\"},{name=\"sD2974\",type=\"double\",value=\"0\"},{name=\"sD2975\",type=\"double\",value=\"0\"},{name=\"sD2976\",type=\"double\",value=\"0\"},{name=\"sD2977\",type=\"double\",value=\"0\"},{name=\"sD2978\",type=\"double\",value=\"0\"},{name=\"sD2979\",type=\"double\",value=\"0\"},{name=\"sD2980\",type=\"double\",value=\"0\"},{name=\"sD2981\",type=\"double\",value=\"0\"},{name=\"sD2982\",type=\"double\",value=\"0\"},{name=\"sD2983\",type=\"double\",value=\"0\"},{name=\"sD2984\",type=\"double\",value=\"0\"},{name=\"sD2985\",type=\"double\",value=\"0\"},{name=\"sD2986\",type=\"double\",value=\"0\"},{name=\"sD2987\",type=\"double\",value=\"0\"},{name=\"sD2988\",type=\"double\",value=\"0\"},{name=\"sD2989\",type=\"double\",value=\"0\"},{name=\"sD2990\",type=\"double\",value=\"0\"}]\n\npre-prompt\n(gdb)
 \nprompt\n")

Olivier

-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Stefan Monnier
Sent: Wednesday, November 13, 2013 20:06
To: address@hidden
Subject: Re: stack overflow in regexp matcher with gdb

> error in process filter: gdb-stack-list-locals-handler: Stack overflow 
> in regexp matcher error in process filter: Stack overflow in regexp 
> matcher

Please try to enable "Options => Enter Debugger on Error", and if that fails to 
give you a backtrace, then try M-: (setq debug-on-signal t) RET [ But note that 
this latter option will make your Emacs session
  "inconvenient" because the debugger will be triggered too often.  ]

That should hopefully give you a backtrace which can help fix the problem.
Of course, M-x report-emacs-bug is also a good idea.
In any case, you'll probably want to try Emacs-24.3 first, to see if this bug 
hasn't been fixed already.

> I don't know where it comes from, I've been searching on the web and 
> found a bug report was entered some years ago but it seems it ended here.

It means that the backtracking-based regexp-matcher recursed too deep (probably 
because some "*" repetition matched many more times than normally expected).  
The best fix usually is to change the regexp so it backtracks less (i.e. uses 
less stack space) or so the match fails much earlier.

> Is there any way to turn that thing off (whatever it is doing) so I 
> can at least continue debugging in a normal way ?

Not sure:  using M-x gud-gdb RET instead of M-x gdb would be a way, but that 
requires re-starting the GDB session (and it gives you a much more barebones 
UI, tho that's what I use personally).


        Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]