3 ms·
The real problem is here: > It uses D-Bus to ask accounts-daemon how many users there are, but since accounts-daemon is unresponsive, the D-Bus method call fai
by quotemstr 6y ago
The real problem is here:
> It uses D-Bus to ask accounts-daemon how many users there are, but since accounts-daemon is unresponsive, the D-Bus method call fails due to a timeout. (In my testing, the timeout took around 20 seconds.) Due to the timeout error, the code does not set the value of priv->have_existing_user_accounts. Unfortunately, the default value of priv->have_existing_user_accounts is false, not true, so now gdm3 thinks that there are zero user accounts and it launches gnome-initial-setup.
I am sick and tired of programs trying to continue onward somehow after encountering "impossible" error conditions or tripping over arbitrary timeouts. Failing fast when something looks funny is essential to the creation of a secure system. When you write something like the gdm3 code above --- which, when it runs into trouble, clears any ambient error and pretends that the system has no current users --- you may think you're doing the user a favor by continuing to operate, but what you're doing is in fact willfully entering some unknowable and unexplored region of the system's state space, usually one full of dragons and anthrax.
What you want to do instead is just die when something goes wrong. gdm3 should respond to a failure to contact org.freedesktop.Accounts with either a hard lockup or a forced restart of the gdm3 daemon.
- lovehashbrowns 6y agoThe usage for code that I currently write is internal and it’s made with usability in mind, so I am guilty of coding stuff like this on occasion. By that I mean that my code, under certain circumstances, assumes the best and continues moving forward. I do this for a specific reason: I don’t want my team to get pinged with a support request for something trivial. So this type of bug is a huge eye opener for me. I still want to strike a balance between usability and clarity, but this story makes me want to review a lot of the code I’ve written. None of it is mission critical and on this level, luckily.
- quotemstr 6y agoI've found that I spend more time debugging arcane horrible things that go wrong as downstream consequences of recovery paths than I do debugging straightforward and obvious problem reports that come from hard assertion failures and failing fast.