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: Can I disable callbacks?

Five times in the last 48 hours, Terminal.app "quit unexpectedly". The Terminal_datestamp.crash files show

EXC_BAD_ACCESS (SIGSEGV) KERN_INVALID_ADDRESS at 0x0000000000000000

with a call stack that always includes:

com.apple.Terminal 0x000000010530bc94 0x105295000 + 486548 com.apple.Foundation 0x00007fff972ac5df __NSFireTimer + 83 com.apple.CoreFoundation 0x00007fff95837d74 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20 com.apple.CoreFoundation 0x00007fff958379ff __CFRunLoopDoTimer + 1071 com.apple.CoreFoundation 0x00007fff9583755a __CFRunLoopDoTimers + 298 com.apple.CoreFoundation 0x00007fff9582ef81 __CFRunLoopRun + 2065

User impact

I cannot use the system: must find solution, even if the cost is to wipe disk and install previous OS (El Capitan).

The primary question

(q1) Is there some new feature of Sierra that integrates Terminal with other apps that can be turned off, perhaps a setting to disable callbacks?

Secondary questions

  • (q2) Can I potentially run a copy of the Terminal.app from a previous version of Mac OS X? Prior to my new laptop (and Sierra) these crashes never happened.
  • (q3) What additional detail would be useful, and how can I collect it?

    I am familiar with Unix application development, but not for Mac OS X. I am happy to collect additional detail by turning on debug tools, traces, event collectors, etc. but would need pointers to get started. Xcode is available, but I would be a beginner with it.

System summary

  • New MacBook Pro (Retina, 15-inch, Mid 2015).
    • Arrived 6 days ago.
    • (Yes, I intentionally bought a brand-new instance of the previous model.)
    • Surprisingly, it arrived with Sierra. It presently has 10.12.1
    • Xcode installed
    • GCC 6.2.0 available, built locally.
  • Previous history brought in by Migration Assistant
  • Not tried (yet, anyway)
    • I have briefly visited safe mode but have not stayed there. I do not know whether there would be crashes of Terminal.app if I spent all day in safe mode
    • I do not know whether there would be crashes if I created a fresh, different user account.
  • Tentative rule-outs:
    • Malware, adware, etc are reasonably unlikely given the usage pattern for this work system: firewalls in sw and hw, no visiting of dicey websites, primary application used all day long is vim.
    • However, if Terminal is now integrated with the world wide web then I suppose anything is possible.

MacBook Pro with Retina display, macOS Sierra (10.12.1)

Posted on Dec 8, 2016 7:06 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 19, 2017 4:53 AM

Heya!


This problem's been bugging me as well and with the information from this thread I narrowed it down to the following:


Stuart's test case can be simplified to the following:

  1. Open vim an enter three lines of arbitrary text such as this:
    a
    a aaaaaaaaaaaaaaaaa
    a
    - First and third line just have to be present - no idea why.
    - The second line needs to have a space as the second character and wrap exactly one character to the next line.
    User uploaded file
  2. Delete the first character of the second line by pressing x so that now the line starts with a space and the last character of the line moves to the last column of the terminal.
    User uploaded file
  3. Wait about a second and Terminal.app will crash.


This suggests that Terminal.app has for some reason problems with lines that start with a space and end on the last column of the terminal.


It also only seems to relate with redrawing of the screen because I was not able to reproduce it with echo commands from the command line and I have only ever seen it with full-screen terminal applications like vim and screen, running both locally and remotely.


I had a suspicion it was related to the alternate screen which both vim and screen use by default. I was able to rule that out by setting TERM=vt100 to disable use of the alternate screen and still being able to trigger the crash as described above.


The problem seems to have been introduced with Terminal.app 387 of the 10.12.1 update. I extracted version 377 from my recovery partition (also present in the original 10.12.0 installer) which copes fine with above test case.


The obvious difference between both versions when diff'ing output of the strings command on both executables it the additon of Touchbar functionality mostly relating to man page interaction. I was not able to find any knob to disable this functionality to further narrow down the cause.


Thanks everyone for their research, providing a simple and reproducible test case and the workaround of going back to version 377 for now,

Michael

193 replies

Feb 8, 2017 12:43 PM in response to thucydides09

I'm likewise seriously disappointed that Apple can't fix Terminal and several other irritating bugs. (another that has wasted a lot of my time lately is the mirroring of iPhone Messages onto MacOS: sometimes it just stops working)


So bite the bullet and switch to iTerm2.


It is a 100% cure. I resisted for weeks because of the time I'd have to spend just to get even with where I was in Terminal, but it is the only way out. (it took me several hours to get satisfactory syntax coloring everywhere)

Feb 8, 2017 1:30 PM in response to randy_parker

Hi Randy,


I share your disappointment. Part of me wonders if this bug is not specific to Terminal only but rather has something to do with a more deeply buried part of their display rendering code based on the stack backtraces we've seen. It may be that, although we can reliably tickle this bug with Terminal, alteration of the offending code has ramifications for a lot of other software, hence the delay in a fix. (Just trying to give Apple the benefit of the doubt here with this speculation, which may have absolutely no basis in reality.)


I checked out iTerm2 and it certainly looks to have everything I would need, my only reluctance to jump ship has to do with my fear of typing all my super-duper top-sekrit passwords into a piece of unknown software. Terminal may well not be the least bit safer in that regard but at least I know where Apple lives. Plus, if I abandon Terminal I'll have nothing to complain about here.


Thanks to all who've continued to report their problems on this issue!

Feb 8, 2017 7:55 PM in response to john henning

I too have bit the bullet and given up on Terminal. I've move over to iTerm2 and been happy. I really didn't want to as I do not like installing applications I don't find necessary, but since Apple has not fixed this in a reasonable time, I was forced to move on. Perhaps some day soon they will fix the issue, but until then, I'll be happy with iTerm2.

Feb 16, 2017 12:54 PM in response to john henning

I am an Apple Enterprise Support customer; I have filed case# 100135749977 with Apple regarding these crashes. I have also provided them the other case numbers from these discussions.


I have provided the reproducible test cases, as well as EDC (Enterprise Data Capture) images showing the crashes on a freshly-built 10.12.2 Macbook which I then upgraded to 10.12.3 (both crashed).


Hopefully this will be solved soon, but Apple doesn't move very quickly, and it's likely too late to make it into 10.12.4 public release. :-/


-DDV

Feb 26, 2017 6:50 AM in response to DDV

I installed the beta on 2/25/17 and can confirm that the text and commands at the bottom of this post no longer crash vi. What crept in to break vi, or the terminal subsystem so dramatically. Was this bug always there?


/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.p ng

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_va rs_grids_labels_3840_11-8.%04d.png

Don't know how to make these movies: -f 3

To crash Terminal under 10.12.3: edit this file in vim and type: 3jdfo

Feb 27, 2017 9:53 AM in response to caryfromtoronto

Great to hear a solution is coming. I have been running 10.12.3 for weeks and run VIM on a Ubuntu 14.04 box vi a SSH constantly (with multiple Terminal windows) and have had no problems, until this morning and now have had 5 crashes of the Terminal App in about 90 minutes. I can find nothing that has changed so why I'm hitting this now is a bit perplexing.

Feb 27, 2017 12:27 PM in response to John Galloway

iTerm2 is not a certain fix either. It seemed to be doing better, and then got a bus error.


Process: iTerm2 [4063]

Path: /private/var/folders/*/iTerm.app/Contents/MacOS/iTerm2

Identifier: com.googlecode.iterm2

Version: 3.0.14 (3.0.14)

Code Type: X86-64 (Native)

Parent Process: ??? [1]

Responsible: iTerm2 [4063]

User ID: 1602693331



Date/Time: 2017-02-27 12:20:05.549 -0800

OS Version: Mac OS X 10.12.3 (16D32)

Report Version: 12

Anonymous UUID: 0F9EB8AD-C38C-86DB-0E34-C7332DAD979B





Time Awake Since Boot: 14000 seconds



System Integrity Protection: enabled



Crashed Thread: 0 Dispatch queue: com.apple.main-thread



Exception Type: EXC_BAD_ACCESS (SIGBUS)

Exception Codes: 0x000000000000000a, 0x0000000109280757

Exception Note: EXC_CORPSE_NOTIFY



Termination Signal: Bus error: 10

Termination Reason: Namespace SIGNAL, Code 0xa

Terminating Process: exc handler [0]

Mar 7, 2017 12:39 PM in response to john henning

i deleted what i was going to say to be a little "quieter"


I also have vim continually crashing on me SEVERAL TIMES DAILY ... and suspect it's really Terminal.app and not vim


Booting to Safe Mode to use vim is absolutely not an option. The mere suggestion I hope was only for diagnosis. However the problem is already confirmed so that part of diagnosis is immaterial.


I think the excuses here for Apple are 0, ZERO. They flagged, it's an F, they need to pay to have it fix immediately and stop covering it up. They need to skip a trip to the Casino and get it done.

Mar 8, 2017 7:47 PM in response to john henning

More data (I didn't read all 10 pages).


Repeat crash:

1. ssh to remote system

2. screen -ARd

3. ^r <- search history, for long command that wraps line

4. ^e <- jump to end of line

5. <esc> <bs> <- repeat to delete back word at a time

6. Line short enough not to wrap -> CRASH


Repeated same trial without screen -> No crash!


So I do think someone was onto it earlier when they mentioned the use of the alt screen by vim and screen. And clearly related to linewrap terminal codes.


*fingers crossed for a fix in 10.12.4*

Mar 10, 2017 8:36 PM in response to QuietMacFan

Another +1 for this occurring very frequently, as it has for quite some time now.


The problem happens with both the original SysV-based vi as well as the newer vim. The remote OS has been Solaris based, Linux (debian and centos) based distros, and BSD based distros.


This is absolutely a problem with Terminal.app and has been happening for quite some time now.


It is sad that all instances of Terminal.app (IE: all windows) will crash as a result of a bug triggered in one instance.

Terminal.app crashing: Can I disable callbacks?

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