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 643176 - gdm crashes when hitting the login button while doing passwordless login
gdm crashes when hitting the login button while doing passwordless login
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
2.30.x
Other Linux
: Normal major
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2011-02-24 09:56 UTC by 3044cf6e49914e60efea1f82ae8a1be1
Modified: 2011-03-08 22:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdb backtraced generated using the ubuntu packages with nostrip,debug options (3.99 KB, application/octet-stream)
2011-02-24 09:57 UTC, 3044cf6e49914e60efea1f82ae8a1be1
  Details
patch adding has_pending_queries boolean against 2.30.5 (from gnome.org) (2.49 KB, patch)
2011-02-24 09:59 UTC, 3044cf6e49914e60efea1f82ae8a1be1
none Details | Review
git formatted patch against gnome-2-32 branch (3.16 KB, patch)
2011-03-02 11:55 UTC, Martin Pitt
none Details | Review
git formatted patch against gnome-2-32 branch (with modified credits) (3.18 KB, patch)
2011-03-03 15:21 UTC, 3044cf6e49914e60efea1f82ae8a1be1
none Details | Review
patch disabling the login button in MODE_AUTHENTICATION if no query is pending (against 2.32.0) (1.40 KB, patch)
2011-03-06 14:07 UTC, 3044cf6e49914e60efea1f82ae8a1be1
none Details | Review
patch disabling the login button in MODE_AUTHENTICATION if no query is pending (against 2.91.91) (1.46 KB, patch)
2011-03-06 14:08 UTC, 3044cf6e49914e60efea1f82ae8a1be1
none Details | Review
patch disabling the login button in MODE_AUTHENTICATION if no query is pending (against 2.30.5) (2.05 KB, patch)
2011-03-06 14:10 UTC, 3044cf6e49914e60efea1f82ae8a1be1
none Details | Review
greeter: disable the login button in MODE_AUTHENTICATION if no query is pending (2.35 KB, patch)
2011-03-08 22:01 UTC, Ray Strode [halfline]
committed Details | Review

Description 3044cf6e49914e60efea1f82ae8a1be1 2011-02-24 09:56:10 UTC
If the user does not need a password to login with gdm, then hitting the "log in" button causes gdm to crash. This seems to be due to an AnswerQuery DBUS message being generated even if the password input field is not visible and an password has not been requested. The user has a real opportunity to hit this bug at least if pam_mkhomedir is in use and needs some time to finish due to the size of the skeleton. Please find attached a patch that adds a has_pending_queries boolean that prevents gdm from issuing a answer query message if no password has been requested by pam.
Comment 1 3044cf6e49914e60efea1f82ae8a1be1 2011-02-24 09:57:51 UTC
Created attachment 181807 [details]
gdb backtraced generated using the ubuntu packages with nostrip,debug options
Comment 2 3044cf6e49914e60efea1f82ae8a1be1 2011-02-24 09:59:18 UTC
Created attachment 181808 [details] [review]
patch adding has_pending_queries boolean against 2.30.5 (from gnome.org)
Comment 3 3044cf6e49914e60efea1f82ae8a1be1 2011-02-24 10:05:39 UTC
You may also have a look at https://bugs.launchpad.net/gdm/+bug/724205 for more details.
Comment 4 Martin Pitt 2011-03-02 11:55:45 UTC
Created attachment 182242 [details] [review]
git formatted patch against gnome-2-32 branch

This patch is updated against the current gnome-2-32 branch, and changed to standard git format-patch. Unfortuantely I don't know who to credit there, it's an anonymous person in Launchpad as well.
Comment 5 3044cf6e49914e60efea1f82ae8a1be1 2011-03-03 15:18:09 UTC
The patch is authored by Michael Braun <michael-dev@fami-braun.de>.

Thanks.
Comment 6 3044cf6e49914e60efea1f82ae8a1be1 2011-03-03 15:21:03 UTC
Created attachment 182349 [details] [review]
git formatted patch against gnome-2-32 branch (with modified credits)

Change credit.
Comment 7 Ray Strode [halfline] 2011-03-05 02:07:24 UTC
Couldn't this be changed to just check num_queries > 0 instead of introducing a new variable?
Comment 8 3044cf6e49914e60efea1f82ae8a1be1 2011-03-05 17:05:53 UTC
Currently, set_sensitive is used to prevent replies if no query is pending. So one could try to just call set_sensitive(..., FALSE) once the mode switches to MODE_AUTHENTICATION or have set_sentitive(..., FALSE) be in place implicitly when entering this mode, fixing the bug as well.
Though, set_sensitive also blocks the cancel button. As I'm unsure about all the modes of operation of gdm, I don't know when this would be safe.
I also looked at num_queries, though num_queries only counts for alle queries already seen in this session and therefore does itself not indicate if there is an unanswered one. Combining this variable with the set_sensitive mechanism that already blocks duplicate replies would work to fix this bug, but make num_queries a bit overloaded and have it combined with a scheme that should (but doesn't) block calls to n_login_button_clicked_answer_query in this case already. So using num_queries looks a bit more like a work around rather than a fix.
I opted for adding a new variable that indicates the state of a sequential query-reply mechanism as think that this change is safe also in the cases I did not test (I tested user list based logins with a single/without any password).
Comment 9 3044cf6e49914e60efea1f82ae8a1be1 2011-03-06 14:07:51 UTC
Created attachment 182609 [details] [review]
patch disabling the login button in MODE_AUTHENTICATION if no query is pending (against 2.32.0)
Comment 10 3044cf6e49914e60efea1f82ae8a1be1 2011-03-06 14:08:17 UTC
Created attachment 182610 [details] [review]
patch disabling the login button in MODE_AUTHENTICATION if no query is pending (against 2.91.91)
Comment 11 3044cf6e49914e60efea1f82ae8a1be1 2011-03-06 14:10:26 UTC
Created attachment 182611 [details] [review]
patch disabling the login button in MODE_AUTHENTICATION if no query is pending (against 2.30.5)
Comment 12 3044cf6e49914e60efea1f82ae8a1be1 2011-03-06 14:13:07 UTC
I wrote a new patch that avoids using a new variable by just making sure that the login button stays disabled in MODE_AUTHENTICATION if no query is pending. Actually this just requires set_sensitive(...,FALSE) to be called in switch_mode and avoid this to be overriden in reset_dialog and gdm_greeter_login_window_ready.
I've checked that timed login, login with password with/out user lists, login without password with/out user lists works fine and cannot be crashed with pam_mkhomedir taking some time.
Comment 13 Ray Strode [halfline] 2011-03-07 22:01:39 UTC
Okay, one last request, if you don't mind.  Can you supply this as a git formatted patch so that I can give proper attribution?
Comment 14 Ray Strode [halfline] 2011-03-08 22:01:03 UTC
The following fix has been pushed:
66a8a9e greeter: disable the login button in MODE_AUTHENTICATION if no query is pending
Comment 15 Ray Strode [halfline] 2011-03-08 22:01:06 UTC
Created attachment 182885 [details] [review]
greeter: disable the login button in MODE_AUTHENTICATION if no query is pending

If the user does not need a password to login with gdm, then hitting the
"log in" button causes gdm to crash. This seems to be due to an
AnswerQuery DBUS message being generated even if the password input
field is not visible and an password has not been requested. The user
has a real opportunity to hit this bug at least if pam_mkhomedir is in
use and needs some time to finish due to the size of the skeleton.

This commit desensitizes the Login button when it's unavailable.
Comment 16 Ray Strode [halfline] 2011-03-08 22:01:51 UTC
I pushed your patch with the above attribution/description.