aptitude -d Failed to write temporary StateFile /var/lib/apt/extended_states.tmp - also consumes CPU power and takes a while to finish the operation after download

Bug #960525 reported by totya
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
aptitude (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

If I use aptitude with the -d option it consumes a lot of CPU power and takes a while to finish
(give me the prompt) after the download. Before aptitude give me back the prompt print the following
error message:

E: Failed to write temporary StateFile /var/lib/apt/extended_states.tmp

Until today I haven't encountered with this phenomenon. So aptitude with the -d option worked well
when Ubuntu 12.04 Beta1 released.

Without the -d option everything is just fine.

I've created a strace output with the following way:

root@penge:~# strace -o aptitude.strace aptitude -d install vim
The following NEW packages will be installed:
  vim vim-runtime{a}
0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,872 kB of archives. After unpacking 24.8 MB will be used.
Do you want to continue? [Y/n/?] y
Get: 1 http://de.archive.ubuntu.com/ubuntu/ precise/main vim-runtime all 2:7.3.429-2ubuntu2 [5,893 kB]
Get: 2 http://de.archive.ubuntu.com/ubuntu/ precise/main vim i386 2:7.3.429-2ubuntu2 [979 kB]
Fetched 6,872 kB in 11s (610 kB/s)
E: Failed to write temporary StateFile /var/lib/apt/extended_states.tmp

I will try to upload the strace file later (48M without compression).

Here's a typical top output when aptitude -d run after the donwload has been finished:

top - 19:59:06 up 14 min, 3 users, load average: 1.69, 1.82, 1.05
Tasks: 153 total, 3 running, 150 sleeping, 0 stopped, 0 zombie
Cpu(s): 57.1%us, 13.8%sy, 0.0%ni, 0.0%id, 23.3%wa, 0.0%hi, 5.8%si, 0.0%st
Mem: 1024800k total, 788808k used, 235992k free, 21360k buffers
Swap: 1046524k total, 58424k used, 988100k free, 245972k cached

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 2527 root 20 0 59552 22m 9.8m S 47.7 2.3 3:15.38 aptitude
 2654 test 20 0 425m 344m 70m S 13.9 34.5 1:20.56 oneconf-service
 2526 root 20 0 2384 720 624 S 1.7 0.1 0:11.85 strace
 2084 test 20 0 90956 11m 5728 S 1.0 1.1 0:06.74 gnome-terminal
 2153 test 20 0 54616 7764 4780 S 0.7 0.8 0:03.84 update-notifier
12259 root 20 0 8776 4436 732 R 0.7 0.4 0:00.02 dpkg
12261 root 20 0 8120 3876 1916 R 0.7 0.4 0:00.02 dpkg-preconfigu
    7 root RT 0 0 0 0 S 0.3 0.0 0:02.01 watchdog/0
   20 root 20 0 0 0 0 S 0.3 0.0 0:03.86 kworker/0:1
   40 root 20 0 0 0 0 S 0.3 0.0 0:01.36 kworker/u:3
 1045 root 20 0 102m 54m 9184 S 0.3 5.4 0:10.33 Xorg
 1781 test 20 0 20512 1428 1428 S 0.3 0.1 0:02.72 gvfs-afc-volume
12103 root 20 0 2832 1160 872 R 0.3 0.1 0:00.02 top
    1 root 20 0 3504 1312 1020 S 0.0 0.1 0:01.38 init
    2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd

The aptitude process state not always "S" it's sometimes "R".

Please fix this problem! If you need more details I'm glad to help you.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: aptitude 0.6.5-1ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-19.30-generic-pae 3.2.11
Uname: Linux 3.2.0-19-generic-pae i686
ApportVersion: 1.94.1-0ubuntu2
Architecture: i386
Date: Tue Mar 20 20:05:51 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Beta i386 (20120301)
ProcEnviron:
 LANGUAGE=en_US:en
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: aptitude
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
totya (totya) wrote :
Revision history for this message
totya (totya) wrote :

Here's the strace output. I've compressed with "bzip2 -9".

Revision history for this message
totya (totya) wrote :

I run aptitude -d and aptitude without -d to show you the difference how much time
needed to finish the job in the two cases:

root@penge:~# apt-get clean
root@penge:~# time aptitude -y -d install vim
The following NEW packages will be installed:
  vim vim-runtime{a}
0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,872 kB of archives. After unpacking 24.8 MB will be used.
Get: 1 http://de.archive.ubuntu.com/ubuntu/ precise/main vim-runtime all 2:7.3.429-2ubuntu2 [5,893 kB]
Get: 2 http://de.archive.ubuntu.com/ubuntu/ precise/main vim i386 2:7.3.429-2ubuntu2 [979 kB]
Fetched 6,872 kB in 11s (621 kB/s)
E: Failed to write temporary StateFile /var/lib/apt/extended_states.tmp

real 10m40.767s
user 3m10.120s
sys 3m13.456s

root@penge:~# apt-get clean
root@penge:~# time aptitude -y install vim
The following NEW packages will be installed:
  vim vim-runtime{a}
0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,872 kB of archives. After unpacking 24.8 MB will be used.
Get: 1 http://de.archive.ubuntu.com/ubuntu/ precise/main vim-runtime all 2:7.3.429-2ubuntu2 [5,893 kB]
Get: 2 http://de.archive.ubuntu.com/ubuntu/ precise/main vim i386 2:7.3.429-2ubuntu2 [979 kB]
Fetched 6,872 kB in 10s (682 kB/s)
Selecting previously unselected package vim-runtime.
(Reading database ... 153837 files and directories currently installed.)
Unpacking vim-runtime (from .../vim-runtime_2%3a7.3.429-2ubuntu2_all.deb) ...
Adding 'diversion of /usr/share/vim/vim73/doc/help.txt to /usr/share/vim/vim73/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim73/doc/tags to /usr/share/vim/vim73/doc/tags.vim-tiny by vim-runtime'
Selecting previously unselected package vim.
Unpacking vim (from .../vim_2%3a7.3.429-2ubuntu2_i386.deb) ...
Processing triggers for man-db ...
Setting up vim-runtime (2:7.3.429-2ubuntu2) ...
Processing /usr/share/vim/addons/doc
Setting up vim (2:7.3.429-2ubuntu2) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode.

real 0m19.450s
user 0m6.364s
sys 0m2.172s

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in aptitude (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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