Bug 49355

Summary: two-step does no quit when "ask-for-password" waits until progress finished (happens on crypted partitions and slow users)
Product: plymouth Reporter: Dr. Tilmann Bubeck <tilmann>
Component: generalAssignee: Ray Strode [halfline] <rstrode>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: medium CC: rstrode
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch to fix this problem in two-step.

Description Dr. Tilmann Bubeck 2012-05-01 15:01:06 UTC
Plymouth does not quit (so never a GDM or text login is shown). The boot process stalls. There is no way to repair, only ctrl-alt-del to restart.

This happens if you use the standard fedora charge theme AND ask-for-password to ask for a password (e.g. because your home directory is crypted) AND the user does not enter the password for a long time (approx. 90 secs).

I assume the following problem:

While ask-for-password waits for a password the charge theme seems to charge up. When it reaches 100% it calls "on_animation_stopped", pulls the idle trigger and sets idle_trigger=NULL and sets is_idle=true. In the meantime the user hits return and display_normal gets called. It calls start_progress_animation which sets is_idle=false in view_start_progress_animation.

If now a quit command is received then become_idle checks for is_idle which is now false (I think, this is wrong). Then the idle_trigger from on_animation_stopped gets never pulled.

The above is not quite correct, because I did not completely understand the different state and triggers.

But the problem is nearly 100% reproducible by using a standard Fedora system (15-17 will all fail) with a encrypted partition AND waiting 2 minutes before entering the password.
Comment 1 Ray Strode [halfline] 2012-05-01 16:36:03 UTC
i believe systemd has a timeout for ask-for-password requests. it could be that whatever it does when it hits that timeout hoses plymouth. my guess is it gives up on the ask-for-password request and continues booting. when boot finishes it does plymouth quit.

So we probably need to make sure plymouth quit cancels any pending ask-for-password requests.
Comment 2 Dr. Tilmann Bubeck 2012-05-01 21:56:03 UTC
(In reply to comment #1)
> i believe systemd has a timeout for ask-for-password requests. it could be that
> whatever it does when it hits that timeout hoses plymouth. my guess is it gives
> up on the ask-for-password request and continues booting. when boot finishes it
> does plymouth quit.

Yes, you are right, systemd has such a timeout. But I did switch that timeout off with:

/etc/crypttap (add timeout option):
luks-ab948062-a3e3-4ff2-8def-f26cc8324c44 UUID=59591900-04a0-45cb-b499-a8766ae63d9b none timeout=10m

/etc/fstab (add timeout option):
/dev/mapper/luks-ab948062-a3e3-4ff2-8def-f26cc8324c44 /home                   ext4    comment=systemd.device-timeout=0,relatime        1 2

The above bug report should have included that information. Sorry for leaving it out.
Comment 3 Dr. Tilmann Bubeck 2012-05-02 09:27:49 UTC
Created attachment 60907 [details] [review]
Patch to fix this problem in two-step.
Comment 4 Ray Strode [halfline] 2012-05-07 19:02:01 UTC
Hey, thanks, I've pushed this with minor changes here:

http://cgit.freedesktop.org/plymouth/commit/?id=ecd2721f1e83b149a3ef24ad88aa6e32f622d129

The two changes were:

1) I reworked the (already quite good) commit message to be just a little more wordy

2) I made on_boot_progress return early instead of having the extra layer of indentation.  I know that, by some metrics, it's considered better practice to avoid early returns, but I personally find it more readable this way.

Thanks for debugging this and crafting the fix!  It's really appreciated.
Comment 5 Ray Strode [halfline] 2012-05-07 19:12:56 UTC
Just to follow up, it doesn't look like any of the other splashes have the "do something at 90%" behavior, so they aren't affected by this bug.
Comment 6 Dr. Tilmann Bubeck 2012-05-07 22:33:08 UTC
Thanks for applying. This bug bothered me since the introduction of plymouth, because I often turn on my laptop (with a crypted partition), go away for a coffee, and when I return and enter the password, the boot process does not finish.

I did suspect systemd for a long time....

Thanks!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.