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

E874: (NFA) Could not pop the stack ! #156

Closed
sivakov512 opened this issue Dec 4, 2017 · 14 comments
Closed

E874: (NFA) Could not pop the stack ! #156

sivakov512 opened this issue Dec 4, 2017 · 14 comments

Comments

@sivakov512
Copy link

Short description of the problem

Can not stage hunk

Steps to reproduce

  • Make some changes
  • Add one hunk
  • Commit
  • Try stage another hunk

Environment

  • vim or nvim version
    NVIM v0.2.2

  • git version
    git version 2.15.1

  • current vimagit version or (or SHA1)
    latest

  • OS
    Void Linux

  • terminal or gvim
    xfce4-terminal

Screenshot with problem

image

@jreybert
Copy link
Owner

jreybert commented Dec 5, 2017

I can see that you have magit#stage_vselect in your backtrace: do you try to stage a visual selection?

Could you provide the key typed at each step?

Thanks

@jreybert
Copy link
Owner

jreybert commented Feb 5, 2018

ping @cryptomaniac512

@sivakov512
Copy link
Author

Oh, sorry
as far as I understand, git does not allow me to stage any hunks. I observe a similar one in magit, but magit stage all hunk instead of error

@jreybert
Copy link
Owner

jreybert commented Mar 7, 2018

Did finally succeeded to stage some hunks with vimagit?

You say you can't stage by hunk with magit too, do you think the problem is not in vimagit but in your environment? In that case, I am interested to understand your environment to maybe handle it wisely in vimagit.

@sivakov512
Copy link
Author

I don't use vim now (because I can't live without all magit features), but I will try to reproduce it in the coming days.

@sivakov512
Copy link
Author

I still have not found the time to check it out and I'm not sure I'll find it. Sorry :(

@wilt00
Copy link

wilt00 commented Sep 4, 2018

I think I have a repro for this bug:

  • Initialize a git repository
  • Paste the following text into a file:
set directory=~/.config/nvim/backups,~/.vim/tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set wildignore+=*/.git/*,*/tmp/*,*.swp,*.o,*/.hg/*,*/.svn/*,*/.DS_Store,*~,*.pyc

set backspace=eol,start,indent  " indent:   allow backspacing over autoindent
                                " eol:      allow backspacing over linebreaks
                                " start:    allow backspacing over start of
                                "            insert
set noerrorbells

" }}}
  • Commit this file to the repository
  • Modify the file so it looks like this:
set directory=~/.config/nvim/backups,~/.vim/tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set wildignore+=*/.git/*,*/tmp/*,*.swp,*.o,*/.hg/*,*/.svn/*,*/.DS_Store,*~,*.pyc

set backspace=eol,start,indent  " indent:   allow backspacing over autoindent
" eol:      allow backspacing over linebreaks
" start:    allow backspacing over start of
"            insert
set noerrorbells

" }}}
  • Attempt to stage change in Magit. I get this error:
Error detected while processing function <SNR>100_nmapping_wrapper[2]..magit#stage_hunk[32]..magit#stage_block:
line    9:
E874: (NFA) Could not pop the stack !
Press ENTER or type command to continue

nvim v0.3.2-dev
vimagit 1.7.2 (according to the changelog file)
git 2.18.0
Bash on Ubuntu on Windows
Terminal (Mintty 2.7.9 x86_64-pc-cygwin, wsltty 1.7.9)

@jreybert
Copy link
Owner

jreybert commented Sep 4, 2018

Thanks @wilt00 for your effort trying to setup a simple to reproduce this error.
This is sad, but I can't reproduce following your steps. I match your configuration for nvim, vimagit and git versions.
I doubt it could come from Ubuntu or the terminal, but at this point, who knows...

The only way I see to continue this investigation would be for you to let me try with a remote access on your machine (ssh, or anything else).

@akrejczinger
Copy link

I also had the same issue.
I managed to reproduce the issue in a Docker container: docker run --rm -it hoborg/vimagit_bug_156
Then follow the instructions by @wilt00
I hope it helps fix the problem.

@jreybert
Copy link
Owner

@akrejczinger thanks a lot for the docker image.

I never used docker, how am I supposed to get your docker image hoborg/vimagit_bug_156 ?

@jreybert jreybert reopened this Sep 28, 2018
@akrejczinger
Copy link

@jreybert

  • install docker: instructions here for ubuntu
  • run the command docker run --rm -it hoborg/vimagit_bug_156. It will download the image from Docker Hub automatically if it's not found on your machine already.

Docker hub link: https://hub.docker.com/r/hoborg/vimagit_bug_156/
The dockerfile is available in my repository: https://github.com/akrejczinger/vimagit_bug_156

@jreybert
Copy link
Owner

jreybert commented Oct 3, 2018

I can finnaly reproduce your issue! Thanks a lot @akrejczinger for your docker image.

jreybert added a commit that referenced this issue Oct 3, 2018
vimagit may want to search hunk position, based on hunk title.
When a hunk title has a '~' in it, the character make the search crash.
It must be escaped.

Finnally, after almost one year of open issue and several issue
contributors, I got it, thanks to akrejczinger and its docker image.

The reason I was unable to reproduce this issue is maybe that all the
vim and nvim version I used were built with another regex engine.
@jreybert
Copy link
Owner

jreybert commented Oct 3, 2018

Finally, I got it! Thanks @akrejczinger for the docker, thanks @wilt00 for the step by step, and thanks @sivakov512 for opening this issue.

It was actually very fast to fix, but a little bit harder to introduce this case in the test suite!

Would you mind test the branch next so I can cherry pick this into master?

@wilt00
Copy link

wilt00 commented Oct 3, 2018

Looks fixed! Thanks for all your work on this @jreybert !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants