Quantcast

MacOS Sierra (10.12.1) Terminal.app crashes while using Vim

Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

MacOS Sierra (10.12.1) Terminal.app crashes while using Vim

John Henning
I live my life in Vim.

And since getting a new laptop with  Sierra pre-installed, life has had difficulties.  All these happened while I was inside of vim:

$ ls -1 Ter*sh
Terminal_2016-12-06-111816_hostname.crash
Terminal_2016-12-06-123823_hostname.crash
Terminal_2016-12-07-115856_hostname.crash
Terminal_2016-12-07-181545_hostname.crash
Terminal_2016-12-07-181912_hostname.crash
Terminal_2016-12-08-125817_hostname.crash
Terminal_2016-12-08-130034_hostname.crash
Terminal_2016-12-08-130845_hostname.crash
Terminal_2016-12-08-210156_hostname.crash
Terminal_2016-12-08-214326_hostname.crash
Terminal_2016-12-08-215326_hostname.crash
Terminal_2016-12-12-175135_hostname.crash
Terminal_2016-12-14-132746_hostname.crash
Terminal_2016-12-14-170328_hostname.crash
Terminal_2016-12-14-201951_hostname.crash
Terminal_2016-12-15-061513_hostname.crash
Terminal_2016-12-15-064843_hostname.crash
Terminal_2016-12-15-090621_hostname.crash
$

There is a great deal more information, including summaries of the call stacks from the above, at the thread  
   'Terminal.app crashing: Can I disable callbacks?'
at the macOS Sierra apple support community
    https://discussions.apple.com/message/31112173

Up until today, it had not occurred to me that Vim might be at "fault" or even remotely close to being the cause.  I figured it was just the victim.  However, a new complainant has just joined the thread (RogerDavis) who reports that he is also seeing Terminal.app crash while running Vim.  While neither of us can really see how it could be Vim's fault, having worked with Editors for a while, I just posted this bit of

Speculation:

Meanwhile, you ask, how could it possibly be the editor's fault if the Terminal crashes.  Good question.  I can vaguely imagine that perhaps in the interest of performance, there might be code paths in vim+curses+Terminal that optimize screen re-drawing, which are pushed hard by this highly-optimized editor, and which were not pushed by whoever did QA on Terminal.  (Once upon a time, it was very important that Editors know a lot about the underlying device, because you were much better off telling the VT100 to do this rather than that; or much better off sending this series of characters at 2400 baud than that series.)

BINARY

Here are the details about the Vim on MacOS Sierra 10.12.1:

$ which vi
/usr/bin/vi
$ ls -l /usr/bin/vi
lrwxr-xr-x  1 root  wheel  3 Oct 21 06:10 /usr/bin/vi -> vim
$ ls -l /usr/bin/vim
-rwxr-xr-x  1 root  wheel  1745984 Oct 21 05:07 /usr/bin/vim
$ /usr/bin/vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 19 2016 15:09:36)
Included patches: 1-898
Compiled by [hidden email]
Normal version without GUI.  Features included (+) or not (-):
+acl             -farsi           -mouse_netterm   +syntax
-arabic          +file_in_path    -mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           -mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
+builtin_terms   -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         -gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
-clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   -perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    -keymap          +postscript      +virtualedit
+comments        -langmap         +printer         +visual
-conceal         +libcall         -profile         +visualextra
+cryptv          +linebreak       +python/dyn      +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             -rightleft       +windows
+diff            +menu            +ruby/dyn        +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
-emacs_tags      -mouseshape      -sniff           -xsmp
+eval            -mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        -mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: gcc   -L/usr/local/lib -o vim        -lm -lncurses  -liconv          
$

QUESTIONS:

(1) Do you see anything risky about how '[hidden email]' chose to compile?  The above compilation string differs remarkably from the string in the the Vim that came with El Capitan:

$ /Volumes/20161202_BootableJohnMacPro/usr/bin/vi --version | head -2
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 14 2016 16:06:49)
Compiled by [hidden email]
$ /Volumes/20161202_BootableJohnMacPro/usr/bin/vi --version | tail -3
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H -arch i386 -arch x86_64 -g -Os -pipe
Linking: gcc -arch i386 -arch x86_64 -o vim -lncurses
$

Notice that the El Capitan version used '-Os', which is slightly less aggressive than the '-O2' in the Sierra version; and differs in regards to FORTIFY_SOURCE and the presence of libiconv

(2) If I turn on keystroke tracing (vim -w keys.out) is that likely to be useful?  That is, will it be 'current' at the time of the crash?  (I'm guessing not, unless vim gets a chance to flush its buffer when Terminal goes away.)

(3) Any suggestions?

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacOS Sierra (10.12.1) Terminal.app crashes while using Vim

Bob Stodola
On Monday, December 19, 2016 at 7:57:49 AM UTC-5, John Henning wrote:
> I live my life in Vim.
...

Me too.  Having the same problem - doubly annoying as most of the files I edit are readonly, so I have to +w them to do a recover.

> (3) Any suggestions?

Not really, but, if its any help, pretty sure my problems started after I installed the 10.12.3 update.  Digging into the security update info:

"Vim
Available for: macOS Sierra 10.12.2
Impact: Opening a maliciously crafted file may lead to unexpected application termination or arbitrary code execution
Description: An input validation issue existed in modelines. This was addressed through improved input validation.
CVE-2016-1248: Florian Larysch
"
Maybe too much input validation:-)

Anyway, I am going to try to pull back vim from El Capitan and see if I can get that to work while Apple figures this out.  Surely someone in Apple uses vim...

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacOS Sierra (10.12.1) Terminal.app crashes while using Vim

Nicolas Hammond
In reply to this post by John Henning
Same problems. vim on Sierra. 20+ crashes this month.

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

    __TEXT                 0000000102f10000-0000000102fe0000 [  832K] r-x/rwx SM=COW  /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_platform.dylib        0x00007fffb5d970ba _platform_memmove$VARIANT$Nehalem + 90
1   com.apple.Terminal              0x0000000102f48fc5 0x102f10000 + 233413
2   com.apple.Terminal              0x0000000102fa6cc8 0x102f10000 + 617672

Each time I have to rebuilt all of my Terminal sessions, many of which are remote logins.

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacOS Sierra (10.12.1) Terminal.app crashes while using Vim

Peter Shenkin
Could somebody please say what they have to do to trigger this crash? (I'm on Sierra 10.12.3 now, but never saw it earlier in 10.12.1.) Having said that, I usually just run "mvim <fname>", which brings MacVim up in its own window; but occasionally I do "vi" a file in a terminal window, but have never see this problem.

-P.

On Mon, Jan 30, 2017 at 6:44 AM, Nicolas Hammond <[hidden email]> wrote:
Same problems. vim on Sierra. 20+ crashes this month.

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

    __TEXT                 0000000102f10000-0000000102fe0000 [  832K] r-x/rwx SM=COW  /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_platform.dylib        0x00007fffb5d970ba _platform_memmove$VARIANT$Nehalem + 90
1   com.apple.Terminal              0x0000000102f48fc5 0x102f10000 + 233413
2   com.apple.Terminal              0x0000000102fa6cc8 0x102f10000 + 617672

Each time I have to rebuilt all of my Terminal sessions, many of which are remote logins.

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacOS Sierra (10.12.1) Terminal.app crashes while using Vim

Bob Stodola
On Tuesday, January 31, 2017 at 5:28:17 PM UTC-5, Peter Shenkin wrote:
> Could somebody please say what they have to do to trigger this crash? (I'm on Sierra 10.12.3 now, but never saw it earlier in 10.12.1.) Having said that, I usually just run "mvim <fname>", which brings MacVim up in its own window; but occasionally I do "vi" a file in a terminal window, but have never see this problem.
>
>
> -P.

Hi, Peter.  After some reflection, I think the problem is terminal, rather than simply vim.  I rarely edit files on my Mac, but rather have about 7-8 terminal sessions using ssh to access other (mostly Centos) linux systems, where I am constantly editing files using vim (on the remote systems).  It ALWAYS crashes in conjunction with a keystroke on standard vim on the other systems.  I've never had it crash just typing keystrokes on the command line, etc., nor when idle.  So I would conclude that the problem is in terminal, but the trigger is in vim (probably, based on other comments, the Mac version of vim as well).

Regards, Bob

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacOS Sierra (10.12.1) Terminal.app crashes while using Vim

Stuart Levy
In reply to this post by Peter Shenkin
On Tuesday, January 31, 2017 at 4:28:17 PM UTC-6, Peter Shenkin wrote:
> Could somebody please say what they have to do to trigger this crash? (I'm on Sierra 10.12.3 now, but never saw it earlier in 10.12.1.) Having said that, I usually just run "mvim <fname>", which brings MacVim up in its own window; but occasionally I do "vi" a file in a terminal window, but have never see this problem.
>
>
> -P.

I found a small example which reliably crashes Terminal when running vim.

Repeatable crash in Terminal while typing in vim.   (Happens whether using macos-supplied vim, or a linux copy of vim run remotely via ssh.)

Repeat-by:

Make a Terminal window that’s not too wide, e.g. 120 columns.   (Doesn’t crash in a 150-column-wide terminal, but does crash with some variety of smaller widths.)

Run vim on the following plain ASCII text file (bracketed by ====’s, which should be removed i.e. they’re not part of the text file, which has exactly 5 lines).  The file is also attached to this forum message:
====
/goldbaum2-7.bmv already exists; use -y to recreate
/des_surveyBuildup_11-7.bmv already exists; use -y to recreate
/lsst_telescope12-22.bmv 1-2660 /fe0/deslsst/telescope/comps/lsst_obj_12-22_comp4k/lsst_obj_12-22_comp4k.%04d.png
img2bmv -f 30 -p 3 -N 6 -L 42  -t 512x360 -w 4096x2160  -w 3840x2160 -t 480x540  -o /fraid0/movies/ren400My_vars_grids_labels_11-8.bmv 1-2881 /fe0/deslsst/renaissance/comps/ren400My_vars_grids_labels_3840_11-8/ren400My_vars_grids_labels_3840_11-8.%04d.png
Don't know how to make these movies:  -f 3
====

In vim, type:
   3jdfo
i.e., go down to the 4th line, then delete from start-of-line to the first “o”.
Terminal crashes reliably!  I'm running 10.12.3 also.

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

w (533 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacOS Sierra (10.12.1) Terminal.app crashes while using Vim

Lifepillar
On 14/02/2017 16:09, Stuart Levy wrote:

> On Tuesday, January 31, 2017 at 4:28:17 PM UTC-6, Peter Shenkin wrote:
>> Could somebody please say what they have to do to trigger this crash? (I'm on Sierra 10.12.3 now, but never saw it earlier in 10.12.1.) Having said that, I usually just run "mvim <fname>", which brings MacVim up in its own window; but occasionally I do "vi" a file in a terminal window, but have never see this problem.
>>
>>
>> -P.
>
> I found a small example which reliably crashes Terminal when running vim.
>
> Repeatable crash in Terminal while typing in vim.   (Happens whether using macos-supplied vim, or a linux copy of vim run remotely via ssh.)
>
> Repeat-by:
>
> Make a Terminal window that’s not too wide, e.g. 120 columns.   (Doesn’t crash in a 150-column-wide terminal, but does crash with some variety of smaller widths.)
>
> Run vim on the following plain ASCII text file (bracketed by ====’s, which should be removed i.e. they’re not part of the text file, which has exactly 5 lines).  The file is also attached to this forum message:
> ====
> /goldbaum2-7.bmv already exists; use -y to recreate
> /des_surveyBuildup_11-7.bmv already exists; use -y to recreate
> /lsst_telescope12-22.bmv 1-2660 /fe0/deslsst/telescope/comps/lsst_obj_12-22_comp4k/lsst_obj_12-22_comp4k.%04d.png
> img2bmv -f 30 -p 3 -N 6 -L 42  -t 512x360 -w 4096x2160  -w 3840x2160 -t 480x540  -o /fraid0/movies/ren400My_vars_grids_labels_11-8.bmv 1-2881 /fe0/deslsst/renaissance/comps/ren400My_vars_grids_labels_3840_11-8/ren400My_vars_grids_labels_3840_11-8.%04d.png
> Don't know how to make these movies:  -f 3
> ====
>
> In vim, type:
>    3jdfo
> i.e., go down to the 4th line, then delete from start-of-line to the first “o”.
> Terminal crashes reliably!  I'm running 10.12.3 also.

I can reproduce this in Terminal.app (also running macOS 10.12.3), with
both macOS's pre-built Vim and Vim 8.0.237 (from Homebrew). More
specifically, I can reproduce the crash if I run any of these:

     vim -u NONE
     vim -u NONE -N
     /usr/bin/vi -u NONE
     /usr/bin/vi -u NONE -N

but I *cannot* reproduce it if I run vim with my own .vimrc. I am still
trying to figure out which setting is the culprit.

The problem looks like a bug in Terminal.app to me. I cannot crash
MacVim or iTerm2, for example.

Life.

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacOS Sierra (10.12.1) Terminal.app crashes while using Vim

Lifepillar
On 15/02/2017 09:13, Lifepillar wrote:

> On 14/02/2017 16:09, Stuart Levy wrote:
>> On Tuesday, January 31, 2017 at 4:28:17 PM UTC-6, Peter Shenkin wrote:
>>> Could somebody please say what they have to do to trigger this crash?
>>> (I'm on Sierra 10.12.3 now, but never saw it earlier in 10.12.1.)
>>> Having said that, I usually just run "mvim <fname>", which brings
>>> MacVim up in its own window; but occasionally I do "vi" a file in a
>>> terminal window, but have never see this problem.
>>>
>>>
>>> -P.
>>
>> I found a small example which reliably crashes Terminal when running vim.
>>
>> Repeatable crash in Terminal while typing in vim.   (Happens whether
>> using macos-supplied vim, or a linux copy of vim run remotely via ssh.)
>>
>> Repeat-by:
>>
>> Make a Terminal window that’s not too wide, e.g. 120 columns.
>> (Doesn’t crash in a 150-column-wide terminal, but does crash with some
>> variety of smaller widths.)
>>
>> Run vim on the following plain ASCII text file (bracketed by ====’s,
>> which should be removed i.e. they’re not part of the text file, which
>> has exactly 5 lines).  The file is also attached to this forum message:
>> ====
>> /goldbaum2-7.bmv already exists; use -y to recreate
>> /des_surveyBuildup_11-7.bmv already exists; use -y to recreate
>> /lsst_telescope12-22.bmv 1-2660
>> /fe0/deslsst/telescope/comps/lsst_obj_12-22_comp4k/lsst_obj_12-22_comp4k.%04d.png
>>
>> img2bmv -f 30 -p 3 -N 6 -L 42  -t 512x360 -w 4096x2160  -w 3840x2160
>> -t 480x540  -o /fraid0/movies/ren400My_vars_grids_labels_11-8.bmv
>> 1-2881
>> /fe0/deslsst/renaissance/comps/ren400My_vars_grids_labels_3840_11-8/ren400My_vars_grids_labels_3840_11-8.%04d.png
>>
>> Don't know how to make these movies:  -f 3
>> ====
>>
>> In vim, type:
>>    3jdfo
>> i.e., go down to the 4th line, then delete from start-of-line to the
>> first “o”.
>> Terminal crashes reliably!  I'm running 10.12.3 also.
>
> I can reproduce this in Terminal.app (also running macOS 10.12.3), with
> both macOS's pre-built Vim and Vim 8.0.237 (from Homebrew). More
> specifically, I can reproduce the crash if I run any of these:
>
>     vim -u NONE
>     vim -u NONE -N
>     /usr/bin/vi -u NONE
>     /usr/bin/vi -u NONE -N
>
> but I *cannot* reproduce it if I run vim with my own .vimrc. I am still
> trying to figure out which setting is the culprit.

It's `set number`. If you have `set number` in your vimrc, Vim won't
crash.

Life.


--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacOS Sierra (10.12.1) Terminal.app crashes while using Vim

Lifepillar
On 15/02/2017 09:26, Lifepillar wrote:

> It's `set number`. If you have `set number` in your vimrc, Vim won't
> crash.

...won't crash Terminal.app, that is.

Also, you need `set wrap`.

Life.


--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacOS Sierra (10.12.1) Terminal.app crashes while using Vim

Bob Stodola
On Wednesday, February 15, 2017 at 3:32:40 AM UTC-5, Lifepillar wrote:

> On 15/02/2017 09:26, Lifepillar wrote:
>
> > It's `set number`. If you have `set number` in your vimrc, Vim won't
> > crash.
>
> ...won't crash Terminal.app, that is.
>
> Also, you need `set wrap`.
>
> Life.
Nice work Stuart and Life.  In hopes it would be enough, I tried just setting wrap - well, more specifically:

:set wrap
:set linebreak
:set nolist  " list disables linebreak
:set textwidth=0
:set wrapmargin=0

It wasn't.  A couple of hours in - ctrl-U in mid-line, and poof - gone!  I tried adding in set line, but just couldn't cope with that much change...

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...