theironrobin / siglo

GTK app to sync InfiniTime watch with PinePhone
Mozilla Public License 2.0
153 stars 23 forks source link

Crash flashing Pine Time if gnome-settings-daemon-common is not installed #45

Closed cincodenada closed 3 years ago

cincodenada commented 3 years ago

Hello, I just followed the build instructions and used Siglo to flash my new PineTime and it was a pretty smooth process, excellent work!

One hitch: when I clicked "Flash It!" the first time, I was met with a crash and a core dump:

› siglo                                
(siglo:405523): GLib-GIO-ERROR **: 23:00:33.133: Settings schema 'org.gnome.settings-daemon.plugins.power' is not installed
zsh: trace trap (core dumped)  siglo

I see that ble_dfu.py is trying to do things with that key, but I don't understand enough of the context to be much more helpful than that.

Fortunately, installing gnome-settings-daemon-common was sufficient to get things working - once I had that installed, it flashed without a problem, and my PineTime is all up to date!

So in the short term, adding gnome-settings-daemon-common to the required packages in docs might be sufficient - I don't know if it should actually be required or not, but some brief googling pointed in that direction and installing it did solve it for me. I suppose probably also a nicer error message than crashing and coring would be helpful too :smile:

Reproduction steps:

Uninstall gnome-settings-daemon Try to flash DFU to a PineTime

Expected result:

It flashes

Actual result:

Crashes with an error message and core dump

I am able to reliably reproduce this by uninstalling gnome-settings-daemon-common. I've attached the core dump as well, in case it is helpful: core.zip

cincodenada commented 3 years ago

Okay, after a little investigation, turns out this code was pretty easy to understand, the nifty new caffeine feature is the culprit. Per Gio.Settings.new docs:

It is an error for the schema to not exist: schemas are an essential part of a program, as they provide type information. If schemas need to be dynamically loaded (for example, from an optional runtime dependency), Gio.SettingsSchemaSource.lookup() can be used to test for their existence before loading them.

Apparently accessing a schema that doesn't exist is an error punishable by coring. I've opened #46 to resolve this by checking for the existence of the schemas we're using before trying to use them.