pop-os / shop

Pop!_Shop
GNU General Public License v3.0
92 stars 19 forks source link

fix(upgrade-fail-dialog): Segfault on undefined error property after object construction #394

Closed mmstick closed 2 years ago

mmstick commented 2 years ago

This looks like a compiler bug in Valac. The object is initialized with the error property defined, but the program crashes in the constructor because it's accessing a field that's not initialized.

The crash can be replicated by having some updates available, modifying /etc/hosts with

127.0.0.1       apt.pop-os.org

And then clicking Update All on the Installed tab.

Closes #395 Closes #393 Closes #386 Closes #387 Closes #381 Closes #356 Closes #358
Closes #341 Closes #353

jacobgkau commented 2 years ago

A number of these are difficult to recreate on demand. I have confirmed this fixes https://github.com/pop-os/shop/issues/393 -- When apt.pop-os.org is set to resolve to the loopback address in /etc/hosts, I now get Failed to update "AppName" instead of a crash.

This does not fix https://github.com/pop-os/shop/issues/353 -- I still get a crash when attempting to uninstall the preinstalled Vim. Is this supposed to fix that, or should it be removed from the list?

mmstick commented 2 years ago

Can investigate the vim issue separtely

mmstick commented 2 years ago

Actually, maybe I'll add a quick patch for the other error dialogs. It's possible that it's the same kind of memory safety violation.

mmstick commented 2 years ago

This commit should fix the error dialogs when installing and uninstalling packages

jacobgkau commented 2 years ago

Regression testing checklist also passed:

mmstick commented 2 years ago

Done https://github.com/elementary/appcenter/pull/1936