Emacs upgrade hangs: preinst should avoid lsof

Bug #558592 reported by Björn Lindqvist on 2010-04-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
emacs22 (Ubuntu)
Undecided
Unassigned

Bug Description

In Ubuntu 9.04, apt-get upgrade of emacs fails and hangs:

(Läser databasen ... 237426 filer och kataloger installerade.)
Förbereder att ersätta emacs22-gtk 22.2-0ubuntu2 (med .../emacs22-gtk_22.2-0ubuntu2_i386.deb) ...

And then hangs. This is what the process tree looks like:

root 30393 0.1 0.6 22388 18628 pts/3 S+ 19:36 0:00 | \_ apt-get autoremove
root 30410 0.0 1.3 45472 42836 pts/4 Ss+ 19:36 0:00 | \_ /usr/bin/dpkg --status-fd 22 --unpack --auto-deconfigure /var/cache/apt/archives/emacs22-gtk_22.2-0ubu
root 30417 0.0 0.0 1872 508 pts/4 S+ 19:36 0:00 | \_ /bin/sh -e /var/lib/dpkg/tmp.ci/preinst upgrade 22.2-0ubuntu2
root 30418 0.0 0.0 1872 268 pts/4 S+ 19:36 0:00 | \_ /bin/sh -e /var/lib/dpkg/tmp.ci/preinst upgrade 22.2-0ubuntu2
root 30419 0.0 0.0 2300 912 pts/4 D+ 19:36 0:00 | \_ lsof -F p /usr/bin/emacs22-gtk
root 30420 0.0 0.0 2168 228 pts/4 S+ 19:36 0:00 | | \_ lsof -F p /usr/bin/emacs22-gtk
root 30421 0.0 0.0 3344 680 pts/4 S+ 19:36 0:00 | \_ wc -l

It is obviously waiting for lsof which never returns.

affects: ubuntu → emacs22 (Ubuntu)
Björn Lindqvist (bjourne) wrote :

The lsof -F p /usr/bin/emacs22-gtk call hangs because an unrelated process was stuck waiting on an nfs server that had disappeared. So in essence, the problem is a symptom of nfs being very stupid, see https://bugzilla.redhat.com/show_bug.cgi?id=131712.

But the lsof call is only used to check if emacs is running and print a warning, so it would be simple to replace it with something that does not risk hanging. pidof /usr/bin/emacs22-gtk for example could be used as a drop-in replacement.

era (era) on 2010-06-25
summary: - Emacs upgrade hangs
+ Emacs upgrade hangs: preinst should avoid lsof
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.