Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

etags-tags-completion-table: Stack overflow in regexp matcher #557

Closed
chalmagean opened this issue Nov 27, 2014 · 12 comments
Closed

etags-tags-completion-table: Stack overflow in regexp matcher #557

chalmagean opened this issue Nov 27, 2014 · 12 comments

Comments

@chalmagean
Copy link
Contributor

I've ran regenerate tags file and then C-c p j and I'm getting this:

Debugger entered--Lisp error: (error "Stack overflow in regexp matcher")
  re-search-forward("^\\(\\([^�]+[^-a-zA-Z0-9_+*$:�]+\\)?\\([-a-zA-Z0-9_+*$?:]+\\)[^-a-zA-Z0-9_+*$?:�]*\\)�\\(\\([^\n�]+\\)�\\)?\\([0-9]+\\)?,\\([0-9]+\\)?\n" nil t)
  etags-tags-completion-table()
  #[0 "\303\211C\304\305�\"\210\212\306�\242\205��\307!\2038�    \262�\211\242\2031�\310\311\312\313\314\315��!\316\"\317\320%�\"\210\202   �\211�\240\210\202  �)\304\321�\"\210\211\242\211�\207" [buffer-file-name tags-completion-table-function tags-completion-table nil message "Making tags completion table for %s..." visit-tags-table-buffer t mapatoms make-byte-code 257 "\301\302�!\300\242\"\207" vconcat vector [intern symbol-name] 4 "\n\n(fn SYM)" "Making tags completion table for %s...done"] 9 "\n\n(fn)"]()
  funcall(#[0 "\303\211C\304\305�\"\210\212\306�\242\205��\307!\2038�    \262�\211\242\2031�\310\311\312\313\314\315��!\316\"\317\320%�\"\210\202   �\211�\240\210\202  �)\304\321�\"\210\211\242\211�\207" [buffer-file-name tags-completion-table-function tags-completion-table nil message "Making tags completion table for %s..." visit-tags-table-buffer t mapatoms make-byte-code 257 "\301\302�!\300\242\"\207" vconcat vector [intern symbol-name] 4 "\n\n(fn SYM)" "Making tags completion table for %s...done"] 9 "\n\n(fn)"])
  tags-completion-table()
  projectile-find-tag()
  funcall-interactively(projectile-find-tag)
  call-interactively(projectile-find-tag nil nil)
  command-execute(projectile-find-tag)

GNU Emacs 24.4.50.1 (x86_64-apple-darwin13.3.0, NS appkit-1265.21 Version 10.9.4 (Build 13E28)) of 2014-09-15

@ghost
Copy link

ghost commented Dec 17, 2014

@chalmagean are you sure this error only happens in projectile? I'm working on relatively big project and this has occurred to me but I though this error is because of Emacs limitation on parsing but TAG file

@chalmagean
Copy link
Contributor Author

@k1-hedayati mmm not really no, I don't think it's projectile specific. Using projectile is how I've discovered it. I haven't spent enough time debugging it so I can see where it comes from.

@ghost
Copy link

ghost commented Dec 17, 2014

What's size of your TAGS file? you can try find-tag command which is inside emacs itself and see if you end up with Stack overflow or not

@chalmagean
Copy link
Contributor Author

@k1-hedayati ok, so I can confirm that projectile-find-tag fails while find-tag doesn't. My TAGS file is 2.3MB.

@littlemove
Copy link

The same is happening to me: projectile-find-tag fails with the error reported by @chalmagean but find-tag seems to work.

@ghost
Copy link

ghost commented Dec 22, 2014

My TAGS file size is 9.8M and find-tag command doesn't work and I get this error
etags-tags-completion-table: Stack overflow in regexp matcher
But find-tag-regex runs without problem
I've traced projectile method and it seems (tags-completion-table) method causes stack overflow since it's inside Emacs itself I don't know what to do.
But after some googleing I saw this issue in helm repo emacs-helm/helm#77, it seems helm guys had this problem before and they've fixed it somehow. Then I tried helm-etags-select command and it was great, I suggest until @bbatsov gets some time to fix this issue you use helm version

@ghost
Copy link

ghost commented Dec 22, 2014

Forgot to say that if you've enable helm-projectile it's already binded to M-.

@marcinant
Copy link
Contributor

👍

@fommil
Copy link
Contributor

fommil commented Jan 13, 2016

I'm still getting this. So the the external etags-select is not taking over tab completion of the tags table. Damn. it's not any projectile code doing this, its happening in the etags code too for TAB completion.

@fommil
Copy link
Contributor

fommil commented Jan 13, 2016

indeed, this is upstream bug https://debbugs.gnu.org/db/20/20703.html

@fommil
Copy link
Contributor

fommil commented Jan 14, 2016

I have a workaround for this, via the google group. Simply redefine the buggy functions https://groups.google.com/d/msg/gnu.emacs.help/Ew0sTxk0C-g/vDRDdSagBAAJ

Which is effectively a backport of emacs 25's versions to emacs 24.

Since a lot of people seem to be hitting this bug, it might be a good idea to add this to projectile itself in an eval-after-load of etags, if something like projectile-etags-completion-table-hack is t, which could be defined as (< emacs-major-version 25) by default.

I'll raise a PR.

@fommil
Copy link
Contributor

fommil commented Jan 24, 2016

please close

@bbatsov bbatsov closed this as completed Jan 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants