Transform Metrics panel keeps crashing glyphs app

3.3 (3315)

When I open the panel up and try to change the input for the relative LSB and RSB boxes with ‘Relative’ Checked, it crashes. No plugins enabled.

No plugins enabled

did you start without plugins or just disabled all?

And did you add your name to the crash reports?

I started in safe mode. Yes I sent with my email and name.

Georg I think I’ve narrowed it down to this plugin:

When I have this installed, my Glyphs App crashes constantly?

Sorry for the trouble, Wei.
Which Mac OS do you use? I added a lot of functionality recently, some of it could cause hiccups with older OSes. But those updates are now months ago, and you seem only recently to see those crashes?

Thanks for making the plugin! I appreciate the reply here.
I hadn’t updated the plugin until only recently – I am on macOS Monterey 12.7.5 (21H1222)

You’re welcome. If you installed it from the Plugin Manager, it should have updated on your machine automatically.

Thanks for the info. So Monterey cannot be it, I am on that one myself.

Does it only crash together with the transformations panel use, as you initially described?

Do you know how to launch Glyphs from the Terminal? We could try that one to see if something gets logged that we cannot catch during the crash. DMing you …

Here’s the console output at the time of crash:

▶       /Applications/Glyphs\ 3.app/Contents/MacOS/Glyphs\ 3 
2024-08-19 20:05:09.454 Glyphs 3[28744:1221839] __import 1
2024-08-19 20:05:09.454 Glyphs 3[28744:1221839] __import 2
2024-08-19 20:05:09.459 Glyphs 3[28744:1221839] __import 3
2024-08-19 20:05:09.459 Glyphs 3[28744:1221839] __import 4
2024-08-19 20:05:09.984 Glyphs 3[28744:1221839] Glyphs listening on port com.GeorgSeifert.Glyphs3
2024-08-19 20:05:09.984 Glyphs 3[28744:1221839] Glyphs listening on port com.GeorgSeifert.Glyphs3.3316
2024-08-19 20:05:10.100 Glyphs 3[28744:1221839] Log message from "Sync Metrics Keys":
Menu state
2024-08-19 20:05:10.100 Glyphs 3[28744:1221839] Log message from "Sync Metrics Keys":
0
2024-08-19 20:05:10.100 Glyphs 3[28744:1221839] Log message from "Sync Metrics Keys":
Sync Metrics Keys Start
[1]    28744 segmentation fault  /Applications/Glyphs\ 3.app/Contents/MacOS/Glyphs\ 3

It doens’t always crash with the transform metrics panel, sometimes it works sometimes it doesn’t. It sometimes also crashes when I try to show the ruler too.

The crash happens (as far as I know) when something sets a user default and there was someone observing those user defaults but didn’t properly remove itself from the observation before it was deallocated.
So the problem happens quite a bit bevor you use the transformation panel. It could be happening when you close a document.

1 Like

That could actually be the Show Rotated, I forgot to add the observer flag and don’t do any deallocation at all. (Sorry for that). Will see if I can squeeze that fix in soon.

1 Like

Ohh interesting. I’m glad we got to the bottom of it. If there’s an example of how the observer flag is added in another plugin and how deallocation works I’d be happy to try make a pull request.

There are some. Usually it’s just the matter of adding a bool property has_observer and setting it to true when adding observers. Then checking for its trueness before removing the observers.
Thanks for the kind PR-offer, but for this particular plugin I’d like to do it myself, since there are some observers added in different places, so I want to refactor it a bit beforehand.

Is there a version of Show-Rotated I could roll back to that won’t cause these crashes because it didn’t always happen.

I had another look at the plugin and hopefully fixed it.