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

Dec 16, 2016 11:32 PM in response to RogerDavis

New topics:

  • Sierra 10.12.2: Has it been offered to you Roger? Software update keeps offering me only 10.12.1. Perhaps they are prioritizing distribution of the update to those who have the newest model laptop.
  • Vim Forum: I posted a summary to https://groups.google.com/forum/#!forum/vim_mac but the post has not yet been approved for publication.

Updates to previous topics:

  • Crash stack: Roger, I think that your stack looks similar (identical in all but the final leaf?) to what I called 'signature 2' in the summaries that I posted (upthread from Dec 8, 2016 3:21 PM)
  • System Integrity Protection: I have NOT changed system integrity protection from its default; though I considered it because dtrace (upthread Dec 9, 2016 6:19 AM)
  • Workaround candidates: as you point out, we lack a clear reproducer, and just need to put time into workarounds and hope that one removes the random-seeming crashes.
    • Secure text entry: thank you for testing this potential workaround; let us know how it goes. (Drew suggested this Dec 16, 2016 10:05 AM)
    • Vim 7.3: I will continue testing that one. (Recipe at entry from Dec 16, 2016 10:40 AM)

Dec 17, 2016 7:59 AM in response to john henning

Hi John,


I believe I'm running the latest Sierra, at least I have installed every update that's been offered and there was an update just a few days ago, I think. Not sure if I will be in the office this weekend but I will confirm the release version the next time I go in. If you know how to do it remotely from an ssh terminal let me know, but the best I know how to do without running 'About This Mac' from the desktop menubar is


> uname -a

Darwin planet10.soest.hawaii.edu 16.3.0 Darwin Kernel Version 16.3.0: Thu Nov 17 20:23:58 PST 2016; root:xnu-3789.31.2~1/RELEASE_X86_64 x86_64


which doesn't show the Sierra release version.

Dec 17, 2016 8:59 AM in response to RogerDavis

Sierra 10.12.latest

Roger: Darwin Kernel Version 16.3.0: Thu Nov 17 20:23:58 PST 2016; root:xnu-3789.31.2~1

Mine: Darwin Kernel Version 16.1.0: Wed Oct 19 20:31:56 PDT 2016; root:xnu-3789.21.4~4

Yours is newer.
Well, there goes my hope that there will be a bugfix whenever it gets around to offering me 10.12.2.


Sidebar: is mine 'stuck' at 10.12.1?

It has offered me lots of updates, and I have installed all of them. I don't know why it won't offer 10.12.2

The screen at App Store won't let me cut/paste, so forgive typos. It says:

No updates available.


Updates installed in the last 30 days:

  • Xcode
    • version 8.2 installed dec 16, 2016
    • Xcode 8.2 includes swift 3 and sdks for ios 10.1, watch os 3.1, tvOS 10.1, and macOS Sierra 10.12.2
  • Command line tools (mac os sierra 10.12) for Xcode

    version 8.2 installed dec 15 2016

  • itunes

    version 12.5.4 installed dec 15 2016

  • imovie

    apple version 10.1.4 installed dec 1, 2016

I don't know how it managed to install iMovie while it was on the truck :-)

From: B&H Photo

Date: December 1, 2016 at 1:35 PM

Subject: B&H Photo Order Shipped

We are pleased to inform you that the following order has been shipped.

Shipping Method: 1 DAY DELIVERY

Scheduled Arrival Date: 12/02/16

But that is what it says.

Here are the records from 'last'.

I took it out of the UPS packaging and the shrinkwrap on Friday the 2nd.

November 24th, I suppose, was at manufacturing.

$ last | tail -14 jhenning console Fri Dec 2 14:46 - crash (21:41) _mbsetupuser console Fri Dec 2 14:43 - crash (21:44) root console Fri Dec 2 14:43 - 14:43 (00:00) reboot ~ Fri Dec 2 14:43 _mbsetupuser console Fri Dec 2 10:01 - crash (04:41) admin console Fri Dec 2 09:42 - crash (05:00) _mbsetupuser console Fri Dec 2 09:41 - crash (05:02) root console Fri Dec 2 09:41 - 09:41 (00:00) reboot ~ Fri Dec 2 09:40 _mbsetupuser console Thu Nov 24 18:29 - crash (7+15:11) root console Thu Nov 24 18:29 - 18:29 (00:00) reboot ~ Thu Nov 24 18:28 wtmp begins Thu Nov 24 18:28 $

Fascinating. The 24th was the day that I ordered it. Thus on the 24th, the laptop was apparently not sitting on a B&H shelf already shrink-wrapped; it was somewhere in a pipeline ready to have an OS installed, ready to be shrinken.

Dec 17, 2016 9:38 AM in response to john henning

Maybe B&H doesn't actually stock anything but just places its own system-specific orders with Apple when they (B&H) get your order?


I have 3 Macs in the office, two now running Sierra, but my laptop stuck forever at ElCap because of its age. Usually any same-release systems of mine get the update notices at the same time or within a day or so. Did you do anything during your testing process that may have confused the AppStore, like downgrading to ElCap and then later restoring Sierra from a backup? I would imagine that when your local software update process is running silently in the background it checks your current local configuration (Sierra) and offers updates accordingly, but I don't really know.

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

Maybe B&H doesn't actually stock anything but just places its own system-specific orders with Apple when they (B&H) get your order?

Yes. Or some intermediate entity who owns a shrink wrapper and is entitled to sell as 'new'.

The reason this seems fascinating to me is that the touch bar model was announced 4 weeks prior (27-Oct); I had difficulty finding anyone who had the old model available; but B&H claimed 'in stock' and status 'new'.

Thus, I was expecting that I would get a laptop that had been shrink-wrapped at least one month prior.

Dec 18, 2016 9:57 AM in response to john henning

I've been having the same problem. I have two new data points to add to the discussion.


1) This started occurring to me when I upgraded to 10.12.1 Build (16B2657).

2) I experience this problem when sshing to a remote system and using tmux and issuing shell commands.


I'm guessing that this is being triggered by some combination of escape sequences.

Dec 18, 2016 11:46 AM in response to mattj_io

Hi channui and mattj_io, welcome to the party (of sorts)!


channui, it sounds like you are reporting the first instance of this happening with no connection to use of the vi editor inside a Terminal window? That would be an important point, I think, so please clarify if this is not the case.


If you guys aren't already forwarding every single crash report to Apple, that would be good to do. I suspect we are more likely to see some effort on this the more we can ratchet up the body count.


Roger

Dec 18, 2016 6:22 PM in response to channui

Well Hello(!) Mr. Chan-nui, and since you mention tmux, that tells me which Chan-nui I am speaking to :-)


Workaround candidates at this point

  • Vim 7.3: Just now, I have seen a Terminal crash whilst using Vim 7.3; so that rules out that workaround.
  • Secure Text Entry: Roger is trying this suggestion, from Drew, who suggested it Dec 16, 2016 10:05 AM. Let us know how it goes.
  • Old Terminal: I have hesitated to try this for fear of incurring the wrath of some system protection that I do not understand; but am at last trying it. Considering that (for all I know) such (hypothetical) wrath might depend upon details of how it is installed and invoked, I record the detail of the attempt here:
    • Finder / Go / Applications

      File / New Folder 'FromOldDisk'

    • Finder / File / New Finder Window
      • click over to usb copy of El Capitan disk / Applications / Utilities
      • control-click Terminal.app / copy Terminal.app
    • Back to first finder window
      • double-click folder FromOldDisk
      • control-click / Paste Item
      • double-click Terminal.app (within the FromOldDisk folder)
    • Something came up. What is it?

$ me=$$ $ parent=$(ps -o ppid= -p $me) $ grandparent=$(ps -o ppid= -p $parent) $ ps -o pid,ppid,stime,comm -p $me,$parent,$grandparent PID PPID STIME COMM 1219 1 0:00.99 /Applications/FromOldDisk/Terminal.app/Contents/MacOS/Terminal 1222 1219 0:00.01 login 1223 1222 0:00.04 -bash

Thus demonstrating that indeed the OLD one is running; also confirmed by Terminal / About Terminal: 2.6.1 (361.1), vs. the Sierra 2.7.1 (387))

I will report as to whether this is, at last, a viable workaround.

Dec 20, 2016 12:26 AM in response to channui

I am experiencing this issue since Dec 14, I've upgraded the OS to 10.12.2 this day perhaps.

My DiagnosticReports directory has files from Terminal_2016-12-14-* to Terminal_2016-12-20-* (today)


My setups are:


* Upgraded from El Capitan

* Running tmux 2.3 from MacPorts in Terminal.app

* tmux runs zsh 5.2 from macOS

* Crashes happen not only during /usr/bin/vim session, also happens just after issuing simple CLI commands (ex. git)

Dec 20, 2016 7:37 AM in response to broomdodger

Hi Broomdodger, Yes, I have used MacVim, but not recently; the adventures documented here are strictly /usr/bin/vi



Summary of thread thus far

  • Apple case # 100085116387 was filed on 8-Dec
    • The senior support representative was kind, but warned that there might not be quick action
    • If anyone else files a ticket, please ask the representative to cross reference it with the above.
  • Five users report the crashes of Terminal.app (thus far)
  • My crashes happened withSierra 10.12.1, but others have reported 10.12.2
  • I have seen the crashes in:
    • Migrated account, and
    • Fresh new account, and
    • Safe mode, and
    • Wiped disk on other laptop.
  • Other failed workarounds:
    • Use vim 7.3 from El Capitan (still saw crashes)
    • Update Cisco VPN (still saw crashes + subsequently excluded as a candidate by the wiped-disk-other-laptop test))
  • No reproducer exists at this time, and it is hard to get data on the circumstances
    • It would be nice if there were truss or dtrace logs
    • A link above (Dec 9, 6:19am) allegedly explains how to enable dtrace, but I have not dared.
    • The stack traces are not obviously insane when compared to 'normal' running app. (see entry Dec 8 at 7:19pm)
    • Maybe 'fs_usage' could provide clues?
  • The evidence suggests that although Vim is commonly the victim, it is not likely to be the criminal, because
    • Crashes happened with older Vim (7.3)
    • Both Mr. Chan-nui and Sakuro-san report crashes with tmux


Workaround candidates remaining

  • Old Terminal: (described Dec 18 at 6:22pm) No crashes yet. Anyone else want to try it too? If so, please report whether it helps.
  • Secure Text Entry: Roger is trying this suggestion, from Drew, who suggested it Dec 16, 2016 10:05 AM. Let us know how it goes.

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.