[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#994042: libc6: debconf text fallback failed to accept input, had to be killed leading to broken dist-upgrade



On Fri, Sep 10, 2021 at 04:02:06PM +0100, Neil Williams wrote:
> This is related to #984533 - in my case, there was no effect on the initramfs.
> 
> I am attaching the section of the apt log. (gzipped)
> I am also attaching the dpkg -l output for the package list (after upgrade).
> 
> The apt log includes the details of the --purge autoremove operation I completed
> after a reboot, so those packages were also installed on buster too.
> 
> This was an upgrade from buster to bullseye.
> apt upgrade worked fine (first part of the log).
> 
> When dist-upgrade started, I got:
> 
> Preparing to unpack .../92-libc6_2.31-13_amd64.deb ...
> debconf: unable to initialize frontend: Dialog
> debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78.)
> debconf: falling back to frontend: Readline
> Checking for services that may need to be restarted...
> Checking init scripts...
> Do you want to upgrade glibc now?
> 
> Running services and programs that are using NSS need to be restarted,
> otherwise they might not be able to do lookup or authentication any more.
> The installation process is able to restart some services (such as ssh or
> telnetd), but other programs cannot be restarted automatically.  One such
> program that needs manual stopping and restart after the glibc upgrade by
> yourself is xdm - because automatic restart might disconnect your active
> X11 sessions.
> 
> This script detected the following installed services which must be
> stopped before the upgrade: postgresql 
> 
> If you want to interrupt the upgrade now and continue later, please
> answer No to the question below.
> 
> Do you want to upgrade glibc now? [Y/n] y
> Y

The code in libc.preinst that attempts to fall back to text mode,
introduced in 2.31-10, is clearly incorrect; apologies for not noticing
this earlier.  It sources the debconf confmodule and then conditionally
sets USE_DEBCONF; but since the debconf confmodule has already been
sourced by this point, text mode won't work properly since standard
input and output refer to the debconf frontend.  (In particular, reading
from stdin can't work.)

The only way to fix what libc.preinst is currently trying to do would
be:

 * Fetch the current debconf frontend *without* first sourcing the
   confmodule, e.g. using something like "echo GET debconf/frontend |
   debconf-communicate" which I *think* is safe as long as you haven't
   sourced the confmodule yet;

 * Decide whether to use debconf based on this and other information;

 * Only source the confmodule if you've positively decided to use it.

But a simpler approach might be to update debconf in buster with the
change from 1.5.76 to check whether whiptail/dialog is usable before
trying to use it, and then remove at least some of this fragile and
broken code from libc.preinst.  At the very least, USE_DEBCONF=1 must
always be set if (and only if) the debconf confmodule has been sourced.

I'm currently seeing if I can construct a reduced reproduction recipe
based on Neil's logs, since it evidently depends on exactly which order
apt chooses to unpack things early on, and it would be very helpful to
be able to test fixes properly.

-- 
Colin Watson (he/him)                              [cjwatson@debian.org]


Reply to: