alphapapa/magit-todos

error in process sentinel: magit-todos--line-item: Stack overflow in regexp matcher

lbolla opened this issue · 12 comments

I am getting this error when enabling magit-todos in one of my repos:
error in process sentinel: magit-todos--line-item: Stack overflow in regexp matcher

I can't find the offending line/regex. magit-todos-keyword-suffix is configured to be just ":" (column).

Any idea how I can debug this more?

Please try to reproduce in the same repo using emacs -q, to confirm that it's not a configuration issue. Thanks.

Same results. I did emacs -q. Then loaded magit and magit-todos (with (require ...)) and then did magit on my repo (and magit-todos-list).

Same error.

Please provide some basic info like: Emacs version, Magit version, magit-todos version, which scanner you're using and which version.

Also, you said it happens in one of your repos. Do you mean that it only happens in that repo, and not in any others? If so, it will probably be necessary to look at the to-do items in the repo.

The most direct way to see what the problem is would be to edebug-defun on the magit-todos--line-item function, and then, when edebug activates, get the contents of the scanner output buffer by pressing e and eval'ing (setq scanner-output (buffer-string)), then you should be able to insert the scanner-output variable into another buffer and examine it.

It turns out the problem is that in my repo there are some files which have enormously long lines (they are mechanically concatenated and uglified JS files). Emacs regex parser chokes on them. I've excluded them using magit-todos-exclude-globs.

@lbolla Thanks. If you encounter this in any more of your repos, let me know, and maybe I can figure out a way to give a more helpful error message.

I just ran into this error and was about to report it but found this issue already did. It'd be nice to not have such a esoteric error :-D

I'll see if I can make the error useful and continue scanning other files.

I do too get this error. Not sure what is going on:

error in process sentinel: magit-todos--line-item: Stack overflow in regexp matcher
error in process sentinel: Stack overflow in regexp matcher

@nedijahij See lbolla's comment.

You can set max columns if you use rg:

(setq magit-todos-rg-extra-args '("-M 120"))
-M, --max-columns <NUM> 

@BlindingDark i used ag actually.

@nedijahij try -W/--width

(setq magit-todos-ag-extra-args '("-W 120"))