Merge lp:~vanvugt/lightdm/fix-1192051 into lp:~mir-team/lightdm/unity

Proposed by Daniel van Vugt
Status: Merged
Approved by: Robert Ancell
Approved revision: 1618
Merged at revision: 1619
Proposed branch: lp:~vanvugt/lightdm/fix-1192051
Merge into: lp:~mir-team/lightdm/unity
Diff against target: 75 lines (+25/-5)
4 files modified
src/plymouth.c (+22/-2)
src/plymouth.h (+1/-1)
src/seat-unity.c (+1/-1)
src/xserver-local.c (+1/-1)
To merge this branch: bzr merge lp:~vanvugt/lightdm/fix-1192051
Reviewer Review Type Date Requested Status
Robert Ancell Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+170362@code.launchpad.net

Commit message

seat-unity: Wait for Plymouth to complete the "deactivate" command. Otherwise
we risk fighting for the VT device and Plymouth's error handling is not robust
enough to handle that, making it spin at 100% CPU and never deactivating.
(LP: #1192051)

Description of the change

I'm sure some kind of robustness fix could be done in plymouth instead, but:

1. I don't yet understand the full flow of this bug from lightdm to plymouth. Other than plymouth is spinning on an fd of "/dev/tty7" with errno==EIO. And waiting for the plymouth deactivate to properly complete (hence drmDropMaster), avoids the bug.

2. Our PPAs don't contain plymouth so packaging the fix there would take significantly more effort.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Hacky, but will work for now.

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I agree it's hacky. And I spent a couple of extra hours trying to find a way to make it less so. This is the least of the evils.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/plymouth.c'
2--- src/plymouth.c 2011-09-07 05:37:55 +0000
3+++ src/plymouth.c 2013-06-19 13:42:27 +0000
4@@ -81,10 +81,30 @@
5 }
6
7 void
8-plymouth_deactivate (void)
9+plymouth_deactivate (gboolean wait)
10 {
11+ gint attempt = 1;
12 is_active = FALSE;
13- plymouth_run_command ("deactivate", NULL);
14+
15+ /*
16+ * The "plymouth" command has no option like --wait-for-deactivation so
17+ * we have to wait in a loop.
18+ */
19+ do
20+ {
21+ g_debug("Deactivating Plymouth (attempt #%d)", attempt);
22+ attempt++;
23+ plymouth_run_command ("deactivate", NULL);
24+
25+ if (!wait)
26+ return;
27+
28+ sleep (1);
29+ have_checked_active_vt = FALSE;
30+ } while (plymouth_has_active_vt () && attempt <= 60);
31+
32+ if (has_active_vt)
33+ g_debug("Failed to deactivate Plymouth.");
34 }
35
36 void
37
38=== modified file 'src/plymouth.h'
39--- src/plymouth.h 2013-04-23 03:07:03 +0000
40+++ src/plymouth.h 2013-06-19 13:42:27 +0000
41@@ -22,7 +22,7 @@
42
43 gboolean plymouth_has_active_vt (void);
44
45-void plymouth_deactivate (void);
46+void plymouth_deactivate (gboolean wait);
47
48 void plymouth_quit (gboolean retain_splash);
49
50
51=== modified file 'src/seat-unity.c'
52--- src/seat-unity.c 2013-06-19 04:32:53 +0000
53+++ src/seat-unity.c 2013-06-19 13:42:27 +0000
54@@ -305,7 +305,7 @@
55 {
56 g_debug ("Compositor will replace Plymouth");
57 SEAT_UNITY (seat)->priv->vt = active_vt;
58- plymouth_deactivate ();
59+ plymouth_deactivate (TRUE);
60 }
61 else
62 g_debug ("Plymouth is running on VT %d, but this is less than the configured minimum of %d so not replacing it", active_vt, vt_get_min ());
63
64=== modified file 'src/xserver-local.c'
65--- src/xserver-local.c 2013-06-17 23:38:35 +0000
66+++ src/xserver-local.c 2013-06-19 13:42:27 +0000
67@@ -170,7 +170,7 @@
68 g_debug ("X server %s will replace Plymouth", xserver_get_address (XSERVER (self)));
69 self->priv->replacing_plymouth = TRUE;
70 self->priv->vt = active_vt;
71- plymouth_deactivate ();
72+ plymouth_deactivate (FALSE);
73 }
74 else
75 g_debug ("Plymouth is running on VT %d, but this is less than the configured minimum of %d so not replacing it", active_vt, vt_get_min ());

Subscribers

People subscribed via source and target branches