0

In the latest update saga, gnome-software has started segfaulting. Of course my parents don't notice this. It just means they won't get notifications for security updates, and the PC will get horrible and insecure.[1] The first page of Google shows nothing, to explain why this Debian Desktop is failing to deliver security update notifications (again, sigh).

Have the following symptoms been seen by others? Can we provide an explanation? Does it admit a permanent fix?

(Short of the root cause: inadequate resources for Debian Desktop, compared to other desktops).

sudo journalctl suggests this is a NULL pointer dereference in libgs_plugin_systemd-updates.so. (The last three digits of the Instruction Pointer are the same in each case).

Nov 22 14:59:39 drystone kernel: pool[2781]: segfault at 0 ip 00007f86c4d6f6d6 sp 00007f86b92249d0 error 4 in libgs_plugin_systemd-updates.so[7f86c4d6e000+2000]

The journal shows it crashed 66 times before today, starting from 2017-10-18. The current version of gnome-software was upgraded to on 2017-09-23. This would have been when I upgraded the machine from Debian Wheezy to Stretch. I know I was able to open gnome-software immediately after the upgrade.

Today it was crashing whenever I started it, until I took the steps to install gnome-software-dbgsym. Removing the -dbgsym package didn't get it to start crashing again. It must have been something about the state of apt. For the future, I've enabled capturing backtraces by installing systemd-coredump.

The closest I can find is a matching gnome-software segfault which happened to be logged in a report against a completely different program. This turned up in the results for "libgs_plugin_systemd-updates segfault". (I'm guessing the Kali version in question included the same binary from Debian Stretch). Searching more specifically for this segfault message, Google's index currently only includes the Kali report and my question here.


$ apt-cache policy gnome-software
gnome-software:
  Installed: 3.22.5-1
  Candidate: 3.22.5-1
  Version table:
 *** 3.22.5-1 500
        500 http://ftp.uk.debian.org/debian stretch/main amd64 Packages
        100 /var/lib/dpkg/status

and apt-get upgrade showed no pending updates for gnome-software (or packagekit).

$ gnome-software 
14:59:38:0408 Gs  failed to call gs_plugin_add_updates_historical on packagekit-offline: The package id's 'curl;7.52.1-5+deb9u2;amd64;debian-stable-main&

[snip. this warning happens anyway when it doesn't crash]

&xwayland;2:1.19.2-1+deb9u2;amd64;debian-stable-main' are not valid
Segmentation fault

[1] The Debian Desktop does not come with any popup for crashes.

My parents are used to it as a multi-user system and it's possible they log out to gdm before shutting down, which wouldn't show the nice tickybox to reboot and install updates. Apparently my parents tend to shut down directly without logging out first. So that's good, at least they should still see "reboot and install updates" when they shut down. (It appears as a tickbox which is ticked by default).

  • I got a similar segfault on one computer. "Apparently my parents shut down directly without logging out first". Yes this happened too, the filesystem even needed a manual fsck. I suppose some systemfile broke somewhere... – axkibe Nov 23 '17 at 10:02
  • @axkibe thanks. To try and clarify, I don't mean they shut down the system down uncleanly by just turning it off at the plug or something. What I'm trying to get at is that if you shut down normally, you get a notification of security updates which is independent of gnome-software. But you don't if you log out to gdm and then shut down from gdm. – sourcejedi Nov 23 '17 at 12:00
1

TL;DR PackageKit is buggy (specifically the offline updates - the various references to systemd are because the offline updates are implemented using it). It chokes on the Google Chrome package for Debian. I reported this upstream.

You could try to work around this by installing pk-update-icon, and commenting/removing/editing the line NotShowIn=KDE;GNOME; in /etc/xdg/autostart/pk-update-icon.desktop. Note that if you want to quickly test pk-update-icon, you may want to run it with pk-update-icon --delay=0. Personally I would combine this with the Gnome extension TopIcons Plus, because of issues with the icon's notifications.


The crashes started again after a month, so I was able to capture the following backtrace.

Thread 9 "pool" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffcffff700 (LWP 2689)]
gs_plugin_add_updates (plugin=0x555555885d00, list=0x555557735af0, cancellable=<optimized out>, error=<optimized out>)
    at gs-plugin-systemd-updates.c:122
(gdb) bt full 3
#0  gs_plugin_add_updates (plugin=0x555555885d00, list=0x555557735af0, cancellable=<optimized out>, error=<optimized out>) at gs-plugin-systemd-updates.c:122
        app = 0x5555558af7c0
        split = 0x0
        i = 1
        error_local = 0x0
        package_ids = 0x7fffc0073d00
#1  0x00005555555ad795 in gs_plugin_loader_run_results (plugin_loader=plugin_loader@entry=0x555555849c30, function_name=0x5555555ca453 "gs_plugin_add_updates", flags=2228800, cancellable=cancellable@entry=0x555557764b60, error=error@entry=0x7fffcfffeaf0) at gs-plugin-loader.c:723
        error_local = 0x0
        ptask2 = 0x7fffc006c030
        list = 0x555557735af0
        plugin_func = 0x7fffe405d600 <gs_plugin_add_updates>
        plugin = 0x555555885d00
        exists = <optimized out>
        ret = <optimized out>
        i = 8
        ptask = 0x7fffc00757f0
        __func__ = "gs_plugin_loader_run_results"
#2  0x00005555555ad9b7 in gs_plugin_loader_get_updates_thread_cb (task=0x555558116a70, object=0x555555849c30, task_data=0x7fffc40bd520, cancellable=0x555557764b60) at gs-plugin-loader.c:1171
        method_name = <optimized out>
        state = 0x7fffc40bd520
        error = 0x0
        ret = <optimized out>
(More stack frames follow...)

Source code gs-plugin-systemd-updates.c:

121     split = pk_package_id_split (package_ids[i]);
122     gs_app_add_source (app, split[PK_PACKAGE_ID_NAME]);

We have split = 0x0 (NULL pointer) above. pk_package_id_split() returns NULL only when the id is invalid.

(gdb) p package_ids[0]
$1 = (gchar *) 0x7fffc407f720 "google-chrome-stable;63.0.3239.84-1;amd64;google"
(gdb) p package_ids[1]
$2 = (gchar *) 0x7fffc4087e20 "_inc.-stable-main"
(gdb) p package_ids[2]
$3 = (gchar *) 0x0
(gdb) p i
$5 = 1

It seems the invalid id is _inc.-stable-main. pkcon get-updates shows only one package containing the text from both ids. However pkcon get-offline-updates appears to illustrate the same bug. (apt-get --dry-run upgrade shows there is only one upgradable package).

$ pkcon get-updates      
Normal          google-chrome-stable-63.0.3239.84-1.amd64 (google,_inc.-stable-main)    The web browser from Google
$ pkcon offline-get-prepared
Prepared updates:
google-chrome-stable-63.0.3239.84-1.amd64
(null)

lol. pk-offline.c:

/* return raw package ids */
return g_strsplit (prepared_ids, ",", -1);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.