High Sierra Beta 5 Display Problems

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

High Sierra Beta 5 Display Problems

Bob Halley-2
Yesterday I updated from macOS High Sierra beta 4 to beta 5, and now the Emacs display is oddly broken.  It's almost entirely black and white.  The mode line and fringes are solid black, including the text on the mode line!  Almost all font locking has stopped.  There is a little color still, e.g. selected text is highlighted reasonably.  All controls on customize screens are also black-on-black.  I didn't change anything on the emacs side, so I presume this is some interaction due to changes in macOS libraries.  I have no idea if emacs is doing something in a deprecated way, or if something got broken on High Sierra.

My build (from master) wasn't very old, but I rebuilt with the latest (846870e508021ee8d1099280b3f40fe108a34bf0) and it's still broken.

I am happy to help debug this given guidance about where to look or what to do.  I'm also happy to test patches.

Thanks in advance,

/Bob


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: High Sierra Beta 5 Display Problems

Eli Zaretskii
> From: Bob Halley <[hidden email]>
> Date: Tue, 8 Aug 2017 08:44:56 -0700
>
> Yesterday I updated from macOS High Sierra beta 4 to beta 5, and now the Emacs display is oddly broken.  It's almost entirely black and white.  The mode line and fringes are solid black, including the text on the mode line!  Almost all font locking has stopped.  There is a little color still, e.g. selected text is highlighted reasonably.  All controls on customize screens are also black-on-black.  I didn't change anything on the emacs side, so I presume this is some interaction due to changes in macOS libraries.  I have no idea if emacs is doing something in a deprecated way, or if something got broken on High Sierra.
>
> My build (from master) wasn't very old, but I rebuilt with the latest (846870e508021ee8d1099280b3f40fe108a34bf0) and it's still broken.
>
> I am happy to help debug this given guidance about where to look or what to do.  I'm also happy to test patches.

Is it a GUI session or a TTY session?

Also, what do you see in a buffer popped up by "M-x list-colors-display"?

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: High Sierra Beta 5 Display Problems

Bob Halley-2

On Aug 8, 2017, at 11:46, Eli Zaretskii <[hidden email]> wrote:

Is it a GUI session or a TTY session?

It's a (Cocoa) GUI session that is broken, and looks bad even with I start with -q or -Q, so whatever it is doesn't seem to be related to any configuration I have.  (The only thing I did between working and not-working was upgrade the OS.)

TTY sessions still work correctly.  (Indeed, that's how I'm coping!)

Also, what do you see in a buffer popped up by "M-x list-colors-display"?

I see a list of colors that appear reasonable.  I've attached an image of what things look like; you can see the dark fringes and the black-on-black mode line too.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: High Sierra Beta 5 Display Problems

Eli Zaretskii
> From: Bob Halley <[hidden email]>
> Date: Tue, 8 Aug 2017 12:20:29 -0700
> Cc: [hidden email]
>
> > Also, what do you see in a buffer popped up by "M-x list-colors-display"?
>
> I see a list of colors that appear reasonable.

It doesn't look reasonable to me: too few colors.  There should be a
lot more of them; I have more than 500 on my system.  What does this
show:

  M-: (display-color-cells) RET

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: High Sierra Beta 5 Display Problems

Bob Halley-2

On Aug 8, 2017, at 12:39, Eli Zaretskii <[hidden email]> wrote:

It doesn't look reasonable to me: too few colors.  There should be a
lot more of them; I have more than 500 on my system.  What does this
show:

I acknowledge your much better idea of reasonable!  That screen shot is *all* that it lists, only 49 things in GUI mode, whereas TTY mode's listing has 256 colors.


 M-: (display-color-cells) RET

It shows "16777216 (#o100000000, #x1000000)"

When cutting and pasting that, I noticed that my *Messages* buffer is full of complaints about loading various colors.  Presumably this explains what I see, though I don't know why they have disappeared!  Here's an example of the messages:

Unable to load color "grey75" [2 times]
Unable to load color "grey95"
Unable to load color "grey90"
Unable to load color "grey20"
Unable to load color "gray60"
Unable to load color "gray80"
Unable to load color "gray40"
Unable to load color "grey75"
Unable to load color "grey90"
Unable to load color "grey20"
Unable to load color "grey75"
Unable to load color "gray30"
Unable to load color "medium blue"
Unable to load color "grey40"
Unable to load color "grey90"
Unable to load color "grey20"
Unable to load color "grey40"




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: High Sierra Beta 5 Display Problems

Bob Halley-2
In reply to this post by Eli Zaretskii
I looked at the code that appears to be reading color name to value mappings, starting around line 5049 of nsterm.m.

In the broken emacs, the call to [NSColorList colorListNamed: @"Emacs"] succeeds as the "if ( cl == nil )" section is not executed.  Yet whatever it's getting doesn't seem to be useful given my lack of colors.

If I force cl to nil after that line, so as to always run the "if ( cl == nil )" section that reads the rgb.txt file, then my emacs works.

/Bob


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: High Sierra Beta 5 Display Problems

Bob Halley-2
Sorry for all the email today!  I learned a few more useful bits of info though, and thought it better to relay them.

The color table it is loading appears to be stored in ~/Library/Colors/Emacs.clr.  There is no difference between the file that I had there before any of this happened and the file it writes when I force it to run the "rebuild it from the rgb.txt" path.  (I checked this by restoring from a backup.)  If I start an unhacked Emacs and ~/Library/Colors/Emacs.clr does not exist, then Emacs launches correctly with proper colors.  It also recreates the file.  Subsequent starts of Emacs always result in the broken colors.

/Bob



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: High Sierra Beta 5 Display Problems

Alan Third
On Tue, Aug 08, 2017 at 01:50:38PM -0700, Bob Halley wrote:
> The color table it is loading appears to be stored in
> ~/Library/Colors/Emacs.clr. There is no difference between the file
> that I had there before any of this happened and the file it writes
> when I force it to run the "rebuild it from the rgb.txt" path. (I
> checked this by restoring from a backup.) If I start an unhacked
> Emacs and ~/Library/Colors/Emacs.clr does not exist, then Emacs
> launches correctly with proper colors. It also recreates the file.
> Subsequent starts of Emacs always result in the broken colors.

Hi Bob, is there anything else in ~/Library/Colors? From the looks of
the code in ns_get_color Emacs searches *all* colour lists for any
that contain the name it’s looking for, not just Emacs.clr. Maybe
there’s a corrupt one that’s causing the search to fail early?

I can’t think of anything else. From the documentation it doesn’t look
like anything has changed, but perhaps Apple just aren’t listing High
Sierra changes yet...?
--
Alan Third

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: High Sierra Beta 5 Display Problems

Bob Halley-2
On Aug 8, 2017, at 15:13, Alan Third <[hidden email]> wrote:
>
> Hi Bob, is there anything else in ~/Library/Colors?

No, it's otherwise empty.

> From the looks of
> the code in ns_get_color Emacs searches *all* colour lists for any
> that contain the name it’s looking for, not just Emacs.clr. Maybe
> there’s a corrupt one that’s causing the search to fail early?

No

There's also no /Library/Colors, and /System/Library/Colors has nothing called "Emacs".  The system library colors seem to have deeper structure; they are directories not files, contain localizations, and seem otherwise different than the simple format that the API emacs calls writes.  I looked for notices of changes here but didn't find anything.  I'm no expert in macOS development though!

Also, I know that it's the file in ~/Library/Colors that emacs makes because I see emacs create it, and if I delete it the problem goes away on the next start, so it's not some other file that's bad.  It's like the system library can write the file but no longer correctly read it.

I looked for documentation about changes in this area but didn't see anything either.



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: High Sierra Beta 5 Display Problems

Bob Halley-2
In reply to this post by Alan Third
I opened a bug report with Apple.  I will report anything I learn.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: High Sierra Beta 5 Display Problems

Herbert J. Skuhra-5
In reply to this post by Bob Halley-2
> On 08 August 2017 at 17:44 Bob Halley wrote:
>
> Yesterday I updated from macOS High Sierra beta 4 to beta 5, and now the
> Emacs display is oddly broken.

This issue is resolved in the Developer Beta 6.

--
Herbert

Loading...