You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Terminal app crashing repeatedly on Sierra

I use Terminal heavily, usually with multiple shells open and a text editor (vi) running in at least one. Terminal crashes without warning, all windows disappearing simultaneously. This is happening to me at least once per day, and usually more often. AFAIK it happens only when I am actively typing into one window, and not while using the menubar, etc. I have my defaults set to focus-follows-mouse, not the normal click-to-type:


% defaults write com.apple.Terminal FocusFollowsMouse -string YES


Although Terminal may have very occasionally crashed on me pre-Sierra, it certainly never did it this often. (And yes, I have ALWAYS used focus-follows-mouse.)


This is hugely annoying -- any ideas?


Thanks!

Posted on Dec 15, 2016 11:32 AM

Reply
Question marked as Top-ranking reply

Posted on Jan 2, 2017 10:41 AM

Hi Ron,


Thanks for the report!


There was an earlier thread on this topic which I overlooked when starting this thread. Please repost your info there and continue following that thread rather than mine, as it has a lot more useful information. The thread is


Terminal.app crashing: Can I disable callbacks?


I have suggested to the Apple discussion moderators that my thread here be closed for the above reason, but that hasn't happened so I will try to do it myself. Unfortunately it seems the only way I can do that is to click on the button that says a post has solved my problem, which clearly is not the case. I hope everyone affected by this will click the little button that sends your crash dumps to Apple every single time this happens to you, as we seem to be having trouble getting their attention. It sure would be nice if someone who claims to be a Unix vendor could distribute a terminal command-line interface that's actually functional, but it doesn't appear to be high on Apple's to-do list.

22 replies
Question marked as Top-ranking reply

Jan 2, 2017 10:41 AM in response to Ron Frederick

Hi Ron,


Thanks for the report!


There was an earlier thread on this topic which I overlooked when starting this thread. Please repost your info there and continue following that thread rather than mine, as it has a lot more useful information. The thread is


Terminal.app crashing: Can I disable callbacks?


I have suggested to the Apple discussion moderators that my thread here be closed for the above reason, but that hasn't happened so I will try to do it myself. Unfortunately it seems the only way I can do that is to click on the button that says a post has solved my problem, which clearly is not the case. I hope everyone affected by this will click the little button that sends your crash dumps to Apple every single time this happens to you, as we seem to be having trouble getting their attention. It sure would be nice if someone who claims to be a Unix vendor could distribute a terminal command-line interface that's actually functional, but it doesn't appear to be high on Apple's to-do list.

Jan 2, 2017 10:22 AM in response to RogerDavis

I can reliably provoke this problem with a fairly simple routine.


Start by running a screen session on your server, and irssi inside screen. SSH in, then let your laptop go to sleep. Wait long enough, and SSH will disconnect on resume, which leaves the terminal in a broken state where only the last line updates.


Ctrl-L fixes it, but traditionally I've just pressed up-return to resume my ssh session; something irssi does then will also fix the terminal. However, with this bug, doing so will instead crash Terminal.app. Press ctrl-L first, and it won't crash.

Jan 1, 2017 12:42 PM in response to RogerDavis

Just wanted to chime in and say that I've recently started experiencing this as well on both a late 2015 iMac 5K Retina and a mid 2015 MacBook Pro Retina. Both systems are running MacOS Sierra 10.12.2. This issue has only appeared recently for me, though, and I've been running Sierra for months. I'm wondering if it might be new to 10.12.2, or at least much more frequent in 10.12.2. I've been a HEAVY user of Terminal.app for many years, and prior to this crashes of Terminal.app were almost non-existent for me (a few times a year, at most, usually when there was some other system problem that was unrelated to Terminal).


I'm seeing the issue with focus follows mouse enabled and one with it disabled, so that doesn't seem to be a factor.


In terms of applications, I'm mostly running "screen", "vi", "python", and "ssh".

Jan 2, 2017 10:29 AM in response to Baughn

Hi Baughn,


Thank you very much for posting this reproducible triggering sequence!


There was an earlier thread on this topic which I overlooked when starting this thread. Please repost your info there and continue following that thread rather than mine, as it has a lot more useful information. The thread is


Terminal.app crashing: Can I disable callbacks?



Jan 10, 2017 8:33 AM in response to RogerDavis

Found this post because experiencing same issue, on Sierra 10.12.2 (16C67). It happens to me when using ssh to 12.04 and screen version 4.00.03jw4 and then accidentally swiping the scroll wheel to go up commands.

Report 1:

Process: Terminal [19230] Path: /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal Identifier: com.apple.Terminal Version: 2.7.1 (388) Build Info: Terminal-388000000000000~2 Code Type: X86-64 (Native) Parent Process: ??? [1] Responsible: Terminal [19230] User ID: 504 Date/Time: 2017-01-10 01:09:59.692 +0000 OS Version: Mac OS X 10.12.2 (16C67) Report Version: 12 Anonymous UUID: 59B7634D-13EF-1536-F9BD-27644F25A641 Sleep/Wake UUID: 4E656B99-861B-458B-9973-CB92719A80E1 Time Awake Since Boot: 1300000 seconds Time Since Wake: 44000 seconds System Integrity Protection: disabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler [0] VM Regions Near 0: --> __TEXT 000000010b7fb000-000000010b8cb000 [ 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 0x00007fffcd7e2f56 _platform_memmove$VARIANT$Haswell + 182 1 com.apple.Terminal 0x000000010b833c4d 0x10b7fb000 + 232525 2 com.apple.Terminal 0x000000010b891bb8 0x10b7fb000 + 617400 3 com.apple.UIFoundation 0x00007fffcabecab3 -[NSAttributedString(NSAttributedStringUIFoundationAdditions) doubleClickAtIndex:inRange:] + 133 4 com.apple.AppKit 0x00007fffb617690e -[NSAttributedString(NSAttributedStringDeprecatedKitAdditions) URLAtIndex:effectiveRange:] + 607 5 com.apple.Terminal 0x000000010b89f625 0x10b7fb000 + 673317 6 com.apple.Terminal 0x000000010b86af81 0x10b7fb000 + 458625 7 com.apple.Terminal 0x000000010b86b1e9 0x10b7fb000 + 459241 8 com.apple.Terminal 0x000000010b871c1c 0x10b7fb000 + 486428 9 com.apple.Foundation 0x00007fffb9b0ef7f __NSFireTimer + 83 10 com.apple.CoreFoundation 0x00007fffb8083244 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20 11 com.apple.CoreFoundation 0x00007fffb8082ecf __CFRunLoopDoTimer + 1071 12 com.apple.CoreFoundation 0x00007fffb8082a2a __CFRunLoopDoTimers + 298 13 com.apple.CoreFoundation 0x00007fffb807a3e1 __CFRunLoopRun + 2065 14 com.apple.CoreFoundation 0x00007fffb8079974 CFRunLoopRunSpecific + 420 15 com.apple.HIToolbox 0x00007fffb7605acc RunCurrentEventLoopInMode + 240 16 com.apple.HIToolbox 0x00007fffb7605901 ReceiveNextEventCommon + 432 17 com.apple.HIToolbox 0x00007fffb7605736 _BlockUntilNextEventMatchingListInModeWithFilter + 71 18 com.apple.AppKit 0x00007fffb5babae4 _DPSNextEvent + 1120 19 com.apple.AppKit 0x00007fffb632621f -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2789 20 com.apple.AppKit 0x00007fffb5ba0465 -[NSApplication run] + 926 21 com.apple.AppKit 0x00007fffb5b6ad80 NSApplicationMain + 1237 22 libdyld.dylib 0x00007fffcd5d2255 start + 1


Report 2:

Process: Terminal [2833] Path: /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal Identifier: com.apple.Terminal Version: 2.7.1 (388) Build Info: Terminal-388000000000000~2 Code Type: X86-64 (Native) Parent Process: ??? [1] Responsible: Terminal [2833] User ID: 504 Date/Time: 2017-01-10 16:22:16.113 +0000 OS Version: Mac OS X 10.12.2 (16C67) Report Version: 12 Anonymous UUID: 59B7634D-13EF-1536-F9BD-27644F25A641 Time Awake Since Boot: 16000 seconds System Integrity Protection: disabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000018 Exception Note: EXC_CORPSE_NOTIFY Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler [0] VM Regions Near 0x18: --> __TEXT 00000001089dc000-0000000108aac000 [ 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 0x00007fffea6c1eed _platform_memmove$VARIANT$Haswell + 77 1 com.apple.Terminal 0x0000000108a14c4d 0x1089dc000 + 232525 2 com.apple.CoreFoundation 0x00007fffd4f30444 CFStringFindCharacterFromSet + 788 3 com.apple.Foundation 0x00007fffd696d475 -[NSString rangeOfCharacterFromSet:options:range:] + 350 4 com.apple.AppKit 0x00007fffd30559a9 -[NSAttributedString(NSAttributedStringDeprecatedKitAdditions) URLAtIndex:effectiveRange:] + 762 5 com.apple.Terminal 0x0000000108a80625 0x1089dc000 + 673317 6 com.apple.Terminal 0x0000000108a4c00e 0x1089dc000 + 458766 7 com.apple.Terminal 0x0000000108a4c1e9 0x1089dc000 + 459241 8 com.apple.Terminal 0x0000000108a52c1c 0x1089dc000 + 486428 9 com.apple.Foundation 0x00007fffd69edf7f __NSFireTimer + 83 10 com.apple.CoreFoundation 0x00007fffd4f62244 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20 11 com.apple.CoreFoundation 0x00007fffd4f61ecf __CFRunLoopDoTimer + 1071 12 com.apple.CoreFoundation 0x00007fffd4f61a2a __CFRunLoopDoTimers + 298 13 com.apple.CoreFoundation 0x00007fffd4f593e1 __CFRunLoopRun + 2065 14 com.apple.CoreFoundation 0x00007fffd4f58974 CFRunLoopRunSpecific + 420 15 com.apple.HIToolbox 0x00007fffd44e4acc RunCurrentEventLoopInMode + 240 16 com.apple.HIToolbox 0x00007fffd44e4901 ReceiveNextEventCommon + 432 17 com.apple.HIToolbox 0x00007fffd44e4736 _BlockUntilNextEventMatchingListInModeWithFilter + 71 18 com.apple.AppKit 0x00007fffd2a8aae4 _DPSNextEvent + 1120 19 com.apple.AppKit 0x00007fffd320521f -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2789 20 com.apple.AppKit 0x00007fffd2a7f465 -[NSApplication run] + 926 21 com.apple.AppKit 0x00007fffd2a49d80 NSApplicationMain + 1237 22 libdyld.dylib 0x00007fffea4b1255 start + 1

Looks like a bug in attributed string. As a work around I'm going to try to disable mouse wheel sends up arrow if that's possible. If not then I guess need to use a different terminal in the mean time because can't afford to be losing many open terminal tabs all the time.

Jan 11, 2017 9:42 AM in response to youknowjackh

Thanks all for your continuing interest in this issue. I recommend that you make all further comments on this topic in the thread


Terminal.app crashing: Can I disable callbacks?

which pre-dated this one (sorry I didn't find it when I searched myself before originating this thread). That thread has considerably more content, includes a reliable method for reproducing the bug on demand, and includes the latest feedback from Apple on the bug report cases which have been filed. To summarize:


(1) Two linked cases have been opened on this issue, and we have been told that it is being worked on by Apple but there is no expected patch release date as of yet.


(2) You may be able to work around the problem in the meantime by installing an ElCap Terminal.app on your system, or using an alternate terminal application (e.g., xterm, iTerm2, etc.) You can also use a restorable terminal session application, e.g., tmux or screen, within the Sierra Terminal to preserve editing session content and/or speed your recovery after each crash.


Since the bug is now reproducable on demand (see the recipe in the other thread, which involves a very small text file and 5 seconds worth of vi activity OR execution of a piece of AppleScript), I highly encourage anyone suffering from the problem to spend a few minutes reproducing the bug on your system repeatedly and immediately sending each crash dump to Apple via the popup dialog that appears after each crash. If you have tech support (i.e., AppleCare), use it to file your own bug report which you should cross-reference to the existing reports 100085116387 and 100106033554.


Thanks for your continuing attention! (And please make all further comments in the other thread so we can keep the discussion in one place.)


Roger

May 16, 2017 12:09 PM in response to RogerDavis

I have this problem too. It occurs when I am using screen in the Terminal.app. It crashes at least once every few days. I'm on 10.12.4 and the problem started when I upgraded to Sierra a few days ago. This makes my machine incredibly frustrating to use for its primary purpose which is software development.


I have not yet submitted a crash dump because I am always in an urgent hurry to relaunch the terminal and get back to work. I will on the next crash.


It's shocking to me that such a regression would be allowed to persist for 6 months! Lousy delayed MBP upgrades and now lousy software too. 😟

Dec 10, 2017 2:22 PM in response to RogerDavis

I have the same problem with vi and also with a bash script that I wrote that uses ANSI escapes. I was able to reproduce the problem with a simplified bash script when you press a key or when the window focus changes from/to the Terminal window that runs this script:


#!/bin/bash while true; do clear -x echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo printf "Press a key, ^C to exit" echo printf "\x1b[0m\x1b[44m$(date '+%H:%M') \x1b[4mp\x1b[24mrev \x1b[4mn\x1b[24mext \x1b[4mh\x1b[24mome \x1b[4mg\x1b[24moto \x1b[4mb\x1b[24mack \x1b[4md\x1b[24memo \x1b[4ms\x1b[24mhell \x1b[4mo\x1b[24mptions \x1b[4mq\x1b[24muit ?\x1b[0m" read -rsn1 key < /dev/tty printf "This can crash Terminal when set to 80 columns wide when the focus changes\n" read -rsn1 key < /dev/tty done


Once Terminal crashes on this script it continuous to crash every time on this script. However, I have to add that this problem is still intermittent when spaced out over days. I had no problem for a few days until the Terminal started crashing again.


I hope Apple fixed this problem soon. It has been an issue for over a year now.

Dec 16, 2016 6:21 PM in response to RogerDavis

Hi RogerDavis,

I understand that since upgrading to macOS Sierra, Terminal crashes relatively regularly when typing in it. I know it's important to have terminal access on your computer, so I'm happy to help.

Check out the troubleshooting provided in these articles to further isolate the issue. Note that each one has steps to perform if the issue persists or not throughout the process:

Try safe mode if your Mac doesn't finish starting up - Apple Support
How to test an issue in another user account on your Mac - Apple Support

Thanks for using the Apple Support Communities. Cheers!

Dec 17, 2016 8:40 AM in response to sterling r

Hi Sterling,


Thanks for responding! A few hours after making my original post on this topic I discovered the following thread in this same discussion group which was initiated about ten days ago:


Terminal.app crashing: Can I disable callbacks?


The original poster John Henning is describing the exact same problem I am having (Terminal crash, always while using vi in at least one of the Terminal windows) and there has been an ongoing discussion there which I have joined. If you are interested in following this problem, which is still nowhere near a solution, I would encourage you to read that topic.


John has already reproduced the problem both in safe mode and while using a different user account. I should probably also clarify that while I experience these crashes usually at least once per day, I would not describe them as regularly occurring. Terminal usually crashes on me at least once a day, sometimes multiple times, but I can also work for hours without experiencing the problem and cannot duplicate it on demand. That makes testing workarounds, etc., problematic as there is no guarantee that anything that does not crash within a few hours (or probably even within a few days) has in fact achieved any improvement at all.


It seems pretty obvious to me at this point that this is an Apple-created Terminal bug and will not be fixed by anyone other than Apple engineering. They have not yet contacted me in response to any of the several crash dumps I have sent. I am happy, of course, to continue to do a certain amount of testing to see if there are particular aspects of my working environment or habits that tend to force the bug to appear, so please advise if you have any further ideas.


Thanks!

Dec 17, 2016 11:44 AM in response to RogerDavis

RogerDavis,

Thanks for following up with the additional details. We understand that you have now seen others with the same issue and there doesn't seem to be much of a solution for it yet. We're happy to continue to provide some advice for this in the meantime.

Do you ever have this issue when using anything in terminal other than vi? If so, we'd be interested to know if this same thing happens when using terminal in recovery mode. Understanding that it may take some time to replicate, but it could be worth testing:

About macOS Recovery - Apple Support

Otherwise, we'd recommend reinstalling macOS:

How to reinstall macOS - Apple Support

Cheers!

Dec 17, 2016 12:21 PM in response to chuck_3rd

Hi Alex,


Thanks for responding!


AFAIK all crashes have happened while actively using vi, although I admit to being a little foggy on the circumstances of the first one or two incidents which happened maybe two weeks or so ago and took me completely by surprise. Since I started paying greater attention there has been no crash unrelated to vi.


Your suggestion about trying Terminal in recovery mode is a useful one, I can probably spend a certain amount of time doing that at some point this coming week. As noted, however, I could use it successfully for a solid day and more and that would prove absolutely nothing IMO, since my crashes are occurring roughly once a day at unpredictable times. If it did crash that might be a useful data point in the other direction, however, so that test could be useful.


I cannot justify the time involved with a full Sierra re-install, however. I have a lot of add-on software, local network configuration, etc., that would take me a minimum of a full day to restore. (But note that all of these mods pre-dated my upgrade from ElCap to Sierra and Terminal worked just fine under ElCap.) Furthermore, given that another user has already verified this problem on a separate, brand-new system, I see the chances of this solving my problem as being essentially zero. I'm a software engineer myself, and a SIGSEGV crash is virtually never due to anything other than buggy software -- it's fine to write an error message and consciously abort when a perverted operational environment is encountered, but a segfault is an outright bug and Apple needs to fix it.


If you haven't read the material in the other thread I mentioned to Sterling above and you are interested in following up on this issue, you might want to do that. John Henning, the other affected user, has been trying all kinds of stuff for ten days now to no effect, all of which is documented in that thread. If you are a moderator of this group you are more than welcome to fold my topic into his if that would simplify future communications.


Thanks for your help and please let me know if you have any other ideas! I will try the recovery mode test next week and report back, and am more than willing to continue to experiment to a reasonable degree to better define the circumstances under which the bug is triggered.


Roger

Dec 17, 2016 12:57 PM in response to RogerDavis

RogerDavis,

Thanks again for the detailed information. We've reviewed the previously mentioned thread, and believe that between you and John, most of the appropriate troubleshooting for this issue has been covered already.

We've noticed that you've said you have not yet heard back from engineering about the logs you've sent over. How did you contact them to send those logs? If you haven't already, we'd recommend reaching out to Apple Support directly in order to ensure your logs are going to the right place to investigate this:

Contact Apple Support

Cheers!

Dec 18, 2016 6:48 PM in response to chris_g1

Hi Chris_g1


I raised case 100085116387 on 8-Dec, which was submitted to engineering by a senior specialist (whose contact info I have, but will not be so rude as to post here; he warned that it would likely not receive immediate action).


My Unix instincts to go invade with truss and dtrace seem to have met barriers, but I would be delighted to run an 'instrumented' copy of Terminal.app if Apple will provide one.


A couple highlights from the other thread (which you said you reviewed, thanks, but just to summarize), crashes are seen with all of these:

  • Sierra 10.12.1 (me) and 10.12.2 (user 'mattj_io')
  • New laptop (year 2015 MacBook Pro) with sierra 10.12.1 + migrated apps
    • Also seen on same laptop with safe mode
    • Also seen on same laptop with a new user account
  • Older laptop (year 2012 MacBook Pro Retina) with completely wiped disk, install sierra 10.12.1, and approximately nothing else.
  • Application which is running inside Terminal at the time of the crash:
    • Vim 7.4 (as shipped with Sierra)
    • Vim 7.3 (as shipped with El Capitan)
    • And, brand-new this weekend: a user who appears to be using only *remote* apps (just doing ssh out)


-john

Dec 19, 2016 11:14 AM in response to chris_g1

Thanks, Chris.


I'm not exactly sure how to proceed with Apple support. It seems that virtually every useful means of direct contact requires an active service support agreement and my problematic system is no longer covered. I do have another system at home which *is* still covered (under 3-year extended AppleCare, I believe). Can I file the support request under that system? I have not yet spent any time trying to reproduce the bug there and would prefer not to waste the better part of a day trying. Crash dumps appear to contain system ID info (Anonymous UUID), and I would not want dumps mailed from my problem system to be rejected or whatever because the support request was filed under a different system.


By the way, I noticed that the tag line on your and Sterling's responses state that you are Community Specialists. Does that mean that you are Apple employees? Knowing that would make my communications with you more effective.

Terminal app crashing repeatedly on Sierra

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.