Subject: bug#38564: 27.0.50; macOS "emacs -nw" git-gutter-mode segfault

From: Mike Hamrick <[email-masked]>
Date: Wed, 11 Dec 2019 07:15:56 -0800

Robert Pluim writes:
> Iʼm surprised nobody's seen this before.

I was able to find a couple of references to the bug that were reported
downstream.

https://github.com/d12frosted/homebrew-emacs-plus/issues/112
https://github.com/hlissner/doom-emacs/issues/1170

> Right idea, but one layer lower than needed. ns_color_index_to_rgba
> should not be calling ns_lookup_indexed_color in non-gui mode. Try
> this instead:

Your patch does indeed fix the bug for me! It also explains why this
issue doesn't exist in 26.2, as the ns_color_index_to_rgba function was
added a little over a year ago. I'm a bit shocked at how quickly my bug
report reached someone intimately familiar with the underlying code.