The Shape of Everything
A website mostly about Mac stuff, written by August "Gus" Mueller
» Acorn
» Retrobatch
» Mastodon
» Micro.blog
» Instagram
» Github
» Maybe Pizza?
» Archives
» Feed
» Micro feed
September 2, 2021

I released Acorn 7.1 yesterday, which has some new features, changes, and bug fixes. There's nothing earth shattering in here, just another release that continually improves Acorn. The full release notes are available as always.

There is one little, yet devilish, bug fix in the 7.1 release. It took a while to track down and the fix of course was super easy.

Soon after the release of MacOS 11.5 I started getting crash reports. Lots of crash reports. They all had similar stack traces, pointing to something in the guts of Apple's Key Value Observing code (_NSKeyValueObservationInfoGetObservances specifically).

But the messages from my customers in the crash reports all pointed to wildly different things. Someone was using flood fill, and got a crash. Someone else was changing the size of the pencil tool, or someone else was changing a preference, or someone was exporting an image. The one thing that they all had in common was that a preference was being changed or read.

So something in the frameworks for MacOS 11.5 obviously changed, and was surfacing a bug in Acorn that's probably been around for a while (this wasn't my first thought of course. My first thought was that Apple broke Acorn again, horribly, like they did last April).

And I couldn't get it to reproduce more than once or twice. It was pretty infuriating.

I started bouncing ideas off some friends, and I eventually came to the idea of having one of my tech savy customers who could reproduce it to try running Acorn from the terminal with NSZombies turned on. If you're not familiar with it, NSZombies is a debugging tool which will report when messages are sent to classes which have had their memory reclaimed.

And sure enough, the crash happened with a message helping me pinpoint exactly where it was going wrong. What was it? Acorn's startup window had a bit of code that was listening for a preference change and when that window was closed it wasn't unregistering the listener code from the framework.

Here's the kicker - this particular preference (which was a setting for all white windows (which never shipped for good reasons)) was never called or used in any way. Just this little bit of code saying "hey let me know if this pref changes so I can update my appearance". And then when it was released, it never cleaned up. So the fix was to delete the code which listened for the no-longer-existing pref.

Programming is really dumb sometimes.

So Acorn 7.1 is out, you should go grab it. It's got a really good bug fix in it.

Oh, and support for Mozilla's MozJPEG encoder in the Export window is new. That's been a popular request.