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 758625 - segfault when running nmcli agent
segfault when running nmcli agent
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: nmcli
1.0.x
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-11-25 02:06 UTC by Michael Biebl
Modified: 2015-11-30 08:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Biebl 2015-11-25 02:06:36 UTC
When I run "nmcli agent" (under GNOME Shell) the tool segfaults:

$ nmcli a
nmcli successfully registered as a NetworkManager's secret agent.

** (process:18372): CRITICAL **: polkit_agent_listener_register_with_options: assertion 'POLKIT_IS_SUBJECT (subject)' failed

(process:18372): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

(process:18372): GLib-GIO-CRITICAL **: g_dbus_error_strip_remote_error: assertion 'error != NULL' failed
Segmentation fault


There should be a nicer fallback if a secret agent is already active.
Comment 1 Jiri Klimes 2015-11-25 11:31:52 UTC
First, I can't reproduce that. But I can see where the problem appeared. It is not an issue with the secret agent, but with the polkit agent.
polkit_unix_session_new_for_process_sync() failed for some reason and nmcli did not check the error and passed NULL to polkit_agent_listener_register().
http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/clients/common/nm-polkit-listener.c#n324

Fixed:
master: 542200f clients: check errors of polkit_unix_session_new_for_process_sync()
nm-1-0: c7cb2e8 clients: check errors of polkit_unix_session_new_for_process_sync()

Michael, could you try with the fix again.
$ nmcli agent polkit
We would see why polkit_unix_session_new_for_process_sync() failed.

And if you are only interested in NM secret agent, you can/should run 'nmcli agent secret'.


Note:
There can be multiple NM secret agent registered. For polkit, only one agent can be registered. If a polkit agent is active and another polkit agent tries to register, polkit prints
** (process:948): WARNING **: Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: An authentication agent already exists for the given subject
which is not nice, especially if there is no way to find out that an agent is already registered (or is it?).
Comment 2 Michael Biebl 2015-11-25 13:31:35 UTC
The crash is fixed. Thanks.