After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 659367 - Crash clicking System Info
Crash clicking System Info
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: general
3.1.x
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-09-18 02:01 UTC by Daniele Bartolini
Modified: 2011-09-20 01:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
info: Don't crash when systemd isn't used (2.76 KB, patch)
2011-09-19 23:15 UTC, Bastien Nocera
committed Details | Review
info: Don't warn if PackageKit isn't around (1013 bytes, patch)
2011-09-20 00:35 UTC, Bastien Nocera
committed Details | Review

Description Daniele Bartolini 2011-09-18 02:01:35 UTC
Crash when clicking "System Info" with the following message:

info-cc-panel:ERROR:cc-info-panel.c:1140:info_panel_setup_hostname: assertion failed: (self->priv->hostnamed_proxy)
Aborted

Version: 3.1.91
Comment 1 Bastien Nocera 2011-09-18 12:17:01 UTC
Which version of systemd and distribution are you using?

The crash is in those lines:
1149   /* This could only happen if the policy file was installed•
1150    * but not hostnamed, which points to a system bug */•
1151   g_assert (self->priv->hostnamed_proxy);•

It would mean that you have the PolicyKit file installed for "org.freedesktop.hostname1.set-static-hostname", but not the service, which would be a configuration problem in your distribution.
Comment 2 Daniele Bartolini 2011-09-18 13:22:12 UTC
Removing systemd solves the issue.

I had systemd installed but not using it in favour of the regular Archlinux initscripts. I had that config even whit gnome-control-center 3.0.X but it never crahed before.

systemd-35
systemd-arch-units-20110902
initscripts-systemd-v25
Comment 3 Bastien Nocera 2011-09-18 13:28:45 UTC
hostnamed is usable without using systemd as the init system. It's just badly packaged in ArchLinux it seems (they ship the PolicyKit file without the service, it would seem).
Comment 4 Daniele Bartolini 2011-09-18 14:01:43 UTC
Reported to Archlinux.
Comment 5 Dave Reisner 2011-09-18 19:06:57 UTC
Hi, I'm the systemd packager from Arch.

I'm not sure how this is a packaging bug on our part. We provide everything
needed for hostnamed, including the service you mention:

/etc/dbus-1/system.d/org.freedesktop.hostname1.conf
/lib/systemd/system/dbus-org.freedesktop.hostname1.service
/lib/systemd/system/systemd-hostnamed.service
/lib/systemd/systemd-hostnamed
/usr/share/dbus-1/interfaces/org.freedesktop.hostname1.xml
/usr/share/dbus-1/system-services/org.freedesktop.hostname1.service
/usr/share/polkit-1/actions/org.freedesktop.hostname1.policy

We make no modifications to any of these files.

It seems to me that without systemd running, hostnamed fails to start.
Comment 6 Dave Reisner 2011-09-18 19:11:27 UTC
To clarify: If one starts /lib/systemd/systemd-hostnamed manually prior to launching system-info-applet, there is no crash. This only occurs when hostnamed is asked to autospawn without systemd available on the system bus.
Comment 7 Bastien Nocera 2011-09-19 11:33:13 UTC
(In reply to comment #6)
> To clarify: If one starts /lib/systemd/systemd-hostnamed manually prior to
> launching system-info-applet, there is no crash. This only occurs when
> hostnamed is asked to autospawn without systemd available on the system bus.

That would mean that it doesn't auto-start properly.

I'm fairly certain it doesn't need systemd to be running (and there's nothing in the code for hostnamed that would show this). If it does, it's a systemd bug.
Comment 8 Dave Reisner 2011-09-19 12:55:32 UTC
This is slowly making more sense...

So, based on the dbus service definition, I'd say that yes, this does require systemd. hostnamed depends on /etc/hostname, /etc/machine-id and /etc/machine-info, all of which may not be present on non-systemd machines. Furthermore, the service declares Exec=/bin/false, which ensures that this service never starts under sysvinit. If the service fails to start, it seems to me that g-c-c should be gracefully handling the failure.
Comment 9 Bastien Nocera 2011-09-19 13:14:52 UTC
(In reply to comment #8)
> This is slowly making more sense...
> 
> So, based on the dbus service definition, I'd say that yes, this does require
> systemd. hostnamed depends on /etc/hostname, /etc/machine-id and
> /etc/machine-info, all of which may not be present on non-systemd machines.
> Furthermore, the service declares Exec=/bin/false, which ensures that this
> service never starts under sysvinit. If the service fails to start, it seems to
> me that g-c-c should be gracefully handling the failure.

Indeed.

It's a bug in systemd. Those helpers should be usable without systemd running.
Comment 10 Lennart Poettering 2011-09-19 18:46:17 UTC
(In reply to comment #3)
> hostnamed is usable without using systemd as the init system. It's just badly
> packaged in ArchLinux it seems (they ship the PolicyKit file without the
> service, it would seem).

This is not true. hostnamed is not able to write legacy configuration files (the policy here is: read legacy files, write new standardized files). Since non-systemd systems generally don't follow what we defined as "standardized" files hostnamed will not be useful on those systems. Note that I am not interested in maintaining compatibility hacks for the old files to make this work.

The focus for systemd here is clearly on cooperating on interfaces, not code. We carefully made sure that the interfaces are not systemd specific, and well documented. (http://www.freedesktop.org/wiki/Software/systemd/hostnamed). If people want this stuff to work on other distributions, then they are welcome to implement this on their own, or even base this on our code if they wish, but maintain it on their own. systemd itself is not a dumpster for abstracting legacy interfaces.

In any case hostnamed is probably something administrators can disable if they want to, and GNOME shouldn't crash in that case. I believe the CC should not hit an assert here.
Comment 11 Bastien Nocera 2011-09-19 19:20:42 UTC
(In reply to comment #10)
> (In reply to comment #3)
> > hostnamed is usable without using systemd as the init system. It's just badly
> > packaged in ArchLinux it seems (they ship the PolicyKit file without the
> > service, it would seem).
> 
> This is not true. hostnamed is not able to write legacy configuration files
> (the policy here is: read legacy files, write new standardized files). Since
> non-systemd systems generally don't follow what we defined as "standardized"
> files hostnamed will not be useful on those systems. Note that I am not
> interested in maintaining compatibility hacks for the old files to make this
> work.

The problem isn't the file locations, or content, but the fact that the service cannot be autostarted if systemd isn't running. That could be seen as a packaging problem though, as the service on-disk is completely unusable if systemd isn't the init system.
Comment 12 Kay Sievers 2011-09-19 19:33:33 UTC
(In reply to comment #11)
> The problem isn't the file locations, or content, but the fact that the service
> cannot be autostarted if systemd isn't running.

That's intentional, and done for packages like Avahi, bluez, NetworkManager.

The future plan is to teach D-Bus about native systemd service files. At that point, no D-Bus system service file will be installed anymore, and non-systemd boots will not see the service at all.
Comment 13 Lennart Poettering 2011-09-19 20:04:05 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > (In reply to comment #3)
> > > hostnamed is usable without using systemd as the init system. It's just badly
> > > packaged in ArchLinux it seems (they ship the PolicyKit file without the
> > > service, it would seem).
> > 
> > This is not true. hostnamed is not able to write legacy configuration files
> > (the policy here is: read legacy files, write new standardized files). Since
> > non-systemd systems generally don't follow what we defined as "standardized"
> > files hostnamed will not be useful on those systems. Note that I am not
> > interested in maintaining compatibility hacks for the old files to make this
> > work.
> 
> The problem isn't the file locations, or content, but the fact that the service
> cannot be autostarted if systemd isn't running. That could be seen as a
> packaging problem though, as the service on-disk is completely unusable if
> systemd isn't the init system.

But what would it be good for if hostnamed is autostarted and then used to write a file to /etc/hostname which is not read by the distribution at boot to set the hostname?
Comment 14 Bastien Nocera 2011-09-19 23:14:00 UTC
Reopening, seeing as this discussion is going nowhere.
Comment 15 Bastien Nocera 2011-09-19 23:15:32 UTC
Created attachment 197010 [details] [review]
info: Don't crash when systemd isn't used

It's possible to have systemd installed, including hostnamed,
but have it not be the init system, in which case it will fail
to auto-start. Handle that case instead of crashing.
Comment 16 Bastien Nocera 2011-09-19 23:16:53 UTC
Daniele, please test with this patch, and let me know whether it fixes your crasher.
Comment 17 Lennart Poettering 2011-09-19 23:24:59 UTC
(In reply to comment #15)
> Created an attachment (id=197010) [details] [review]
> info: Don't crash when systemd isn't used
> 
> It's possible to have systemd installed, including hostnamed,
> but have it not be the init system, in which case it will fail
> to auto-start. Handle that case instead of crashing.

Thanks a lot. This looks much better. I am happy!
Comment 18 Daniele Bartolini 2011-09-20 00:05:37 UTC
Patched against g-c-c 3.1.91.

Works fine now, reporting the following when clicking System Info:

(gnome-control-center:28882): info-cc-panel-WARNING **: Error getting PackageKit transaction ID: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PackageKit was not provided by any .service files
Comment 19 Bastien Nocera 2011-09-20 00:35:44 UTC
Created attachment 197012 [details] [review]
info: Don't warn if PackageKit isn't around
Comment 20 Daniele Bartolini 2011-09-20 01:00:01 UTC
Even better.

Thanks Bastien!
Comment 21 Bastien Nocera 2011-09-20 01:38:14 UTC
Attachment 197010 [details] pushed as 32106ff - info: Don't crash when systemd isn't used
Attachment 197012 [details] pushed as 429b0b4 - info: Don't warn if PackageKit isn't around