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 737098 - Crashes whole Xorg session when no polkit authenticator is found
Crashes whole Xorg session when no polkit authenticator is found
Status: RESOLVED OBSOLETE
Product: system-monitor
Classification: Core
Component: general
3.12.x
Other Linux
: Normal critical
: ---
Assigned To: System-monitor maintainers
System-monitor maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-22 02:05 UTC by dbdaniel42
Modified: 2018-05-22 12:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description dbdaniel42 2014-09-22 02:05:51 UTC
Steps to reproduce:

1.  Unload your polkit authenticator (This may be built into GNOME.  I use XFCE and didn't have one loaded at the time of the crash.)

2.  Try to change a process's priorty (or do something else that requires elevated privlages.)

3.  Xorg becomes unresponsive.  I could move my mouse but couldn't interact with any of my applications.  I had to change TTYs and kill the Xorg process losing all of my work from applications running in Xorg.

I noticed a message printed to the TTY after I killed Xorg.  Instead of doing anything reasonable (like printing an error message), it tried to get me to authenticate from the TTY that Xorg was running on which crashed my whole Xorg session with no way to recover (I obviously can't type on the TTY that Xorg is displaying on.)  IMO this should never happen.  Anything else would be preferable to this.  Print an error message, do nothing, even simply crashing gnome-system-monitor would be better than crashing my whole X session.
Comment 1 André Klapper 2014-09-22 09:27:02 UTC
(In reply to comment #0)
> Steps to reproduce:
> 
> 1.  Unload your polkit authenticator

How?
Comment 2 dbdaniel42 2014-09-22 16:03:28 UTC
Look for a process named "polkit-gnome", "lxpolkit", "polkit-kde", or "mate-polkit" and kill it.  On my system the polkit-gnome package is labled as Legacy so I'm thinking GNOME 3 may provide a built-in polkit authenticator under a different name.  Again, on my system, I have to install the polkit authenticator manually and configure it to autostart with the DE or I don't have one running at all and run into this bug.

If you can't find the process to kill, you may find it easier to temporarilly load into a minimal WM like Openbox and reproduce the bug there.
Comment 3 Matthias Clasen 2014-09-23 19:32:16 UTC
gnome-system-monitor can't really do anything that would crash your X server - if the X server crashes, it is an X server bug.
Comment 4 Matthias Clasen 2014-09-23 19:33:29 UTC
Oh, I misread - you killed X. So yes, we should deal gracefully with the absence of an authentication agent.
Comment 5 Matthias Clasen 2014-09-24 00:31:57 UTC
Whats actually happening here is that gnome-system-monitor is using pkexec to do launch a command, and pkexec has its own builtin fallback to a text-based authentication agent.

The fix is probably to pass --disable-internal-agent when calling pkexec.
Comment 6 Robert Roth 2014-09-24 19:52:51 UTC
@mclasen: thanks for the investigation and the hints.

@dbdaniel42@gmail.com: I have pushed the fix suggested by Matthias to master, could you perhaps test it? If not, I will try to setup an install reproducing this, but it doesn't sound too easy at first.
Comment 7 dbdaniel42 2014-09-29 08:01:35 UTC
Thanks for the quick fix.  I tested and that did the trick.  It was in fact pkexec trying to prompt on the console that caused the crash.  If I ran the pre-fix version from a terminal it prompted there and all was good, no crash but if I ran it from a desktop menu shortcut like I normally would there's no terminal to prompt on so it tries to prompt on the TTY that X is running on and hangs it.

With this fix, instead of prompting it just throws the following error to the console:

Error executing command as another user: No authentication agent found.

If you're running from a desktop shortcut, the user won't see the message and gnome-system-monitor appears to ignore the command to elevate the priorty which may be confusing to some users but neither gnome-system-monitor nor X crashes or hangs anymore so that's definitely an improvement :)
Comment 8 Stefan Schick 2017-06-04 05:29:58 UTC
Hello,
this Bug is three years old. Also it seems to be fixed. The X Server does not crash anymore. wouldn't it be a good idea to close this bug?
Comment 9 GNOME Infrastructure Team 2018-05-22 12:11:42 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-system-monitor/issues/45.