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 Best 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

Dec 28, 2016 1:05 PM in response to john henning

Hi John,


Still no crashes for me using secure text entry, but I have been using vi only lightly for the past week and due to the holidays have not even been in front of my office desktop that much. Given what Sakuro has reported, however, I consider this cake pretty well baked (or rather, burnt). I will be back in the office and using vi more heavily next week and will continue testing secure text entry for the **** of it, but I think Sakuro has already put this grasped straw to bed. I believe Sakuro's test involves tail'ing an active log file from a running nginx web server into Terminal, so I can't see any way to duplicate that activity myself or I would gladly try -- Sakuro, if I have misunderstood and there is some static file you can send me which will reproduce the problem on my system I am certainly willing to attempt that.


Not surprising to me that an ElCap Terminal.app may fix the problem given that all evidence so far points to the bug clearly being resident within the Sierra Terminal.app. I suppose it is still possible, however, that the bug is in some shared lib accessed by Sierra's Terminal which is NOT accessed by ElCap's.


I would again exhort everyone who is following this thread to send every single crash dump they get to Apple -- the sooner their in-box fills up the quicker we will get some attention.


Thanks to all (and to John in particular) for their continuing efforts to follow up on this annoyance!


Roger

Dec 29, 2016 10:03 AM in response to RogerDavis

More idle speculation on my part ...


I think Sakuro's crashes may be the first example we have seen where there has been no actual input keystroke processing by Terminal anywhere close to the time of the crash (i.e., it appears that nothing has been typed for several seconds to several minutes after the command 'tail -f ....' is entered). The crash seems to be triggered purely by output from a running child process which is causing Terminal to redraw. So, as Sakuro has suggested, the problem may indeed be triggered by the curses library embedded within vi/tmux/whatever. Let's keep in mind, however, that it's Terminal that is crashing so it seems that the actual bug may be Terminal's inability to graciously handle or refuse whatever (possibly strange) redraw request is being made by its children.

Dec 29, 2016 11:11 AM in response to john henning

Hi folks, just chiming in to say that I upgraded to 10.12.2 the other day & am now being hit by this problem repeatedly. As it happens, I'm ssh'ed in to a remote box & running vim on that box. Seems to happen to me most frequently when I'm doing a lot of arrowing around (i.e. sending a lot of keystrokes fairly quickly).


I don't have a machine with El Cap & thus don't have a copy of an older Terminal.app handy. It makes no difference on my machine whether I have "Secure Keyboard Entry" enabled or disabled.

Dec 29, 2016 3:37 PM in response to john henning

I have the same problem after upgrading to Sierra 10.2.2: Terminal.app crashes every few minutes while running /usr/bin/vim. This may be anecdotal: seems to happen right after a copy-paste from another Terminal window, where the copied text is usually plain-jane (7-bit) ascii and less than 80 characters long (although there are other crash-capable cases with unicode characters and/or strings up to 150 characters). I am unable to find the El Capitan version of Terminal.app so I am going to try using the XQuartz 'term' program (clunky, but it does the job and doesn't crash).

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 ID.