macvim-dev / macvim

Vim - the text editor - for macOS
https://macvim.org
Vim License
7.5k stars 681 forks source link

Crash when sourcing $VIMRC with some additional conditions #1221

Closed 097115 closed 2 years ago

097115 commented 2 years ago

Steps to reproduce

Consider this $VIMRC:

colorscheme default
nnoremap <F2> :w<CR>
autocmd! BufWritePost vimrc_test
            \ so % |
            \ if has('gui_running') |
                \ call system('ls') |
            \ else |
                \ call system('ls') |
            \ endif

Now, if I open it with MacVim 8.2.539 (153), like this:

/Applications/MacVim.8.2.539.app/Contents/MacOS/Vim -g -Nu ~/vimrc_test ~/vimrc_test

and will keep pressing this mapped F2 button, everything will be fine. However, if I open it with 8.2.1456 (165) or any newer build in the same manner:

/Applications/MacVim.8.2.1456.app/Contents/MacOS/Vim -g -Nu ~/vimrc_test ~/vimrc_test

it will crash on some second-third reload / F2 key press.

The TUI version, (i.e., the same path but without the -g switch) seems not to be affected.

Also a few words on those additional conditions:

But if these (and may be other corner cases) are met, the crash of newer builds is 100% reproducible for me.

Expected behaviour

Should just :write, :source and then preform the requested system() calls without crashing.

Operating system

macOS 10.11 (El Capitan)

Version of Vim

See above.

Logs and stack traces

No response

eirnym commented 2 years ago

Hi @097115 Thank you for an issue. I can't reproduce this issue with 8.2.3455 (172) on macOS Catalina. I haven't tested older macOS versions

097115 commented 2 years ago

Thanks for testing, @eirnym. Indeed, I suspected it may somehow be related to the OS itself :)

Well, unfortunately can't add more information at the moment...

eirnym commented 2 years ago

You're welcome

There's a few issues with MacVim support for old macOS versions, so it could be one of these issues.

ychin commented 2 years ago

El Capitan is supported per the release notes (https://github.com/macvim-dev/macvim/releases). Have you tried the latest release (172) @097115 ?

097115 commented 2 years ago

@ychin, yep, I tried every release from 172 back to 153 :)

097115 commented 2 years ago

Well, amazingly I can't reproduce it today (even though yesterday I not only restarted my computer before submitting but even shut it down :))

Probably, that was just a bad day, those things happen :) Sorry for the mess.

eirnym commented 2 years ago

I glad you sorted your issue out