Dropping a colour into the NSColorPicker first palette position triggers a crash

Hi,

We have an issue where adding a colour to the first slot in an empty palette in NSColourPicker crashes the application with assertion:

Assertion failed: (backingScaleFactor > 0.f), function drawnFocusRingBitmapForTime, file /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-2022.10.104/AppKit.subproj/NSAutomaticFocusRing.m, line 306.

This is actually reproducible in System Preferences on Big Sur and Monterrey, you can see a crash report attached here:

:

My app actually uses SWT, you can see details of the issue logged in the bug tracker here:

  • https://bugs.eclipse.org/bugs/show_bug.cgi?id=568920

Here's steps on how to replicate, taken from that:

:

1 - macOS | System Preferences | General | Highlight Colour

  • Select 'Other' to open the color dialog.
  • Drag&drop a color from bottom left to a slot in bottom right.

2 - Notes | | Font | Show colours

  • Drag&drop a color from bottom left to a slot in bottom right.

Some other applications, such as TextEdit, do not crash.

After a color was moved in the slot, it needs to be deleted using Del key in order to reproduce crashes again.

Am I wrong to think this is a general MacOS issue?

There's similar reports over the internet, for example:

That page has some more details and someone has created a snippet in Objective-C that also reproduces the problem.

I've sent a submission via Feedback Assistant (FB9016916, on 23rd Feb '21) but there's been no response to that.

Has anyone encountered this issue, and if so is there some workaround to prevent this crash?!

Many thanks!

Replies

What is SWT ? Eclipse Standard Widget Toolkit ?

You'd better not use such acronyms in your questions.

Did you ask the question directly to Eclipse ? Problem may be on their side and not a MacOS issue.

Yes indeed SWT = Eclipse's Standard Widget Toolkit. As you can see in my post there's a link to a bug regarding this issue.

However, as pointed out, this error is not limited to that framework. It's crops up online reported by users of various applications.

It's only started since Big Sur & Monterrey - it doesn't occur on Catalina or earlier.

It can be triggered using a colour panel in System Preferences > General and setting the Highlight colour as described above, which of course is all Apple's own code.

If it helps I can aim to get a screen recording demonstrating that... (A crash report from that is actually attached above also)