#1055409 /usr/bin/dpkg-deb: dpkg-deb goes defunct and has to be killed during apt dist-upgrade

Package:
dpkg
Source:
dpkg
Description:
Debian package management system
Submitter:
Simon John
Date:
2023-11-08 18:09:02 UTC
Severity:
normal
#1055409#5
Date:
2023-11-05 13:38:47 UTC
From:
To:
Dear Maintainer,

3 times in the last month or so I have had apt dist-upgrade stall.

The culprit appears to be dpkg-deb which goes defunct. Once I kill it,
the transaction seems to continue although I have to run "apt-get -f
install" or "dpkg reconfigure -a" to finish it.

It appears to be at the unpack stage where we see the problem.

Another Sid user on social media also has a quite powerful machine (we
both have 32 cores, nvme and 64gb+ ecc ram) and has the same problem, so
maybe its a threading thing? Obviously not a memory/disk issue.

Logs from today's occurrence:

# ps auxw|grep dpkg
root     1324970 91.0  0.2 151484 145108 pts/2   Rs+  13:04   6:12
/usr/bin/dpkg --status-fd 25 --no-triggers --unpack --auto-deconfigure
--recursive /tmp/apt-dpkg-install-ilDw1k
root     1328162  0.0  0.0   7364  2048 pts/2    S+   13:08   0:00
dpkg-deb --fsys-tarfile
/tmp/apt-dpkg-install-ilDw1k/081-libgtk-4-doc_4.12.3+ds-2_all.deb
root     1328163  0.0  0.0      0     0 pts/2    Z+   13:08   0:00
[dpkg-deb]
<defunct>
root     1328164  0.3  0.1 153632 115056 pts/2   Sl+  13:08   0:00
dpkg-deb --fsys-tarfile
/tmp/apt-dpkg-install-ilDw1k/081-libgtk-4-doc_4.12.3+ds-2_all.deb
simon    1329047  0.0  0.0   6348  2048 pts/3    S+   13:11   0:00 grep
--color=auto dpkg

"pkill dpkg-deb" resulted in:

dpkg: error processing archive /tmp/apt-dpkg-install-
ilDw1k/081-libgtk-4-doc_4.12.3+ds-2_all.deb (--unpack):
  dpkg-deb --fsys-tarfile subprocess was killed by signal (Terminated)

For the rest of the dist-upgrade i keep seeing defunct dpkg-debs:

# ps auxw|grep defunct
root     1331212  0.0  0.0      0     0 pts/2    Z+   13:14   0:00
[dpkg-deb]
<defunct>
root     1331276  0.0  0.0   6348  2048 pts/3    S+   13:14   0:00 grep
defunct

killing them off seems to just spawn a new instance:

# kill -9 1331212
-bash: kill: (1331212) - No such process

# ps auxw|grep defunct
root     1331368  0.0  0.0      0     0 pts/2    Z+   13:14   0:00
[dpkg-deb]
<defunct>
root     1331426  0.0  0.0   6348  2048 pts/3    S+   13:14   0:00 grep
defunct

At the end of the operation i get:

Errors were encountered while processing:
  /tmp/apt-dpkg-install-ilDw1k/081-libgtk-4-doc_4.12.3+ds-2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
W: Operation was interrupted before it could finish

"apt-get -f install" allows the transaction to complete.

I had same problem before with:
/tmp/apt-dpkg-install-PdxOu1/1-texlive-fonts-
extra_2023.20231007-1_all.deb and another package I can't quite remember
before
that.

#1055409#10
Date:
2023-11-07 23:21:02 UTC
From:
To:
Happened again today, what I noticed is that there seems to be two
processes doing the same thing, as well as a defunct one:

root     2479916 79.5  0.2 150492 143888 pts/0   Rs+  23:14   2:25
/usr/bin/dpkg --status-fd 25 --no-triggers --unpack --auto-deconfigure
--recursive /tmp/apt-dpkg-install-uIkOEw

root     2481666  0.0  0.0   7364  2048 pts/0    S+   23:16   0:00
dpkg-deb --fsys-tarfile
/tmp/apt-dpkg-install-uIkOEw/44-libgtk-4-doc_4.12.3+ds-2_all.deb

root     2481667  0.0  0.0      0     0 pts/0    Z+   23:16   0:00
[dpkg-deb] <defunct>

root     2481668  0.5  0.1 153632 114472 pts/0   Sl+  23:16   0:00
dpkg-deb --fsys-tarfile
/tmp/apt-dpkg-install-uIkOEw/44-libgtk-4-doc_4.12.3+ds-2_all.deb

It did eventually complete after 4mins!

#1055409#15
Date:
2023-11-08 18:04:46 UTC
From:
To:
and again today, although recovered after 2mins it still went defunct:

ps auxw|grep dpkg
root     2838842 99.0  0.2 150244 144440 pts/1   Rs+  17:58   3:38
/usr/bin/dpkg --status-fd 25 --no-triggers --unpack --auto-deconfigure
--recursive /tmp/apt-dpkg-install-aJ3NZb

root     2838973  0.0  0.0   7364  2304 pts/1    S+   17:58   0:00
dpkg-deb --fsys-tarfile
/tmp/apt-dpkg-install-aJ3NZb/05-golang-1.21-src_1.21.4-1_all.deb

root     2838974  0.0  0.0      0     0 pts/1    Z+   17:58   0:00
[dpkg-deb] <defunct>

root     2838975  0.9  0.2 244672 147964 pts/1   Sl+  17:58   0:01
dpkg-deb --fsys-tarfile
/tmp/apt-dpkg-install-aJ3NZb/05-golang-1.21-src_1.21.4-1_all.deb