freezes for > 10s when displaying long changelogs

Bug #628657 reported by Tormod Volden on 2010-09-02
This bug affects 4 people
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)

Bug Description

Binary package hint: update-manager

There are a bunch of openoffice packages in proposed right now. When selecting on of these in update-manager (does not matter if I have "Description of update" open or not) the GUI freezes and the CPU goes high for 10 seconds while "Downloading list of changes" is displayed. If I click a non-oo package the response is immediate. Selecting the same oo package again causes the same freeze/CPU churn.

I do not know how to trace a pile of python, but find enclosed a ltrace in case it can cast some light over it.

When I ran ltrace -c on it, the one click caused 6 minutes of waiting yielding these results:
% time seconds usecs/call calls function
------ ----------- ----------- --------- --------------------
 15.23 85.527228 186 459799 free
 15.13 84.985249 161 525668 memcpy
 12.31 69.140534 142 485820 memset
 10.55 59.279684 141 419911 malloc
  8.67 48.723256 211 230058 strchr

plz rewrite update-manager in c thx bye :-P

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: update-manager 1:0.134.10
ProcVersionSignature: Ubuntu 2.6.32-24.41-generic
Uname: Linux 2.6.32-24-generic i686
Architecture: i386
Date: Thu Sep 2 08:57:19 2010
ExecutablePath: /usr/bin/update-manager
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
InterpreterPath: /usr/bin/python2.6
PackageArchitecture: all
 PATH=(custom, user)
SourcePackage: update-manager

Tormod Volden (tormodvolden) wrote :
Tormod Volden (tormodvolden) wrote :

This is not limited to the oo packages or the -proposed pocket, although that case is very obvious and should be easy to reproduce. Also viewing the latest linux-libc-dev in lucid-updates gives a delay, but it is sub-second.

$ apt-cache policy linux-libc-dev
  Installed: 2.6.32-24.41
  Candidate: 2.6.32-25.43
  Version table:
     2.6.32-25.43 0
        500 lucid-proposed/main Packages
     2.6.32-24.42 0
        500 lucid-updates/main Packages
 *** 2.6.32-24.41 0
        500 lucid-security/main Packages
        100 /var/lib/dpkg/status
     2.6.32-21.32 0
        500 lucid/main Packages

Tormod Volden (tormodvolden) wrote :

Fiddling with /usr/lib/python2.6/dist-packages/UpdateManager/ I can see that on_insert_text() is called 11136 times each time I click on an oo package.
1266 times for linux-libc-dev, 9 times for ure.

Tormod Volden (tormodvolden) wrote :

The above number corresponds approximately to the number of lines in the displayed changelog AFAICT. set_changes_buffer() iterates through each line. I guess the design is just horribly inefficient.

  File "/usr/bin/update-manager", line 105, in <module>
  File "/usr/lib/python2.6/dist-packages/UpdateManager/", line 965, in main
  File "/usr/lib/python2.6/dist-packages/UpdateManager/", line 397, in on_treeview_update_cursor_changed
    self.set_changes_buffer(changes_buffer, changes, name, srcpkg)
  File "/usr/lib/python2.6/dist-packages/UpdateManager/", line 313, in set_changes_buffer
    changes_buffer.insert(end_iter, line+"\n")
  File "/usr/lib/python2.6/dist-packages/UpdateManager/", line 122, in on_insert_text

summary: - goes wild when selecting latest proposed oo packages
+ freezes for > 10s when displaying long changelogs
Robert Roth (evfool) on 2011-08-08
Changed in update-manager (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium

Present in 13.04

tags: added: raring
Mark (mark-k) wrote :

The effects of this bug became more annoying with recent update-manager versions.

Starting with Ubuntu 13.04, update-manager (Software Updater) was changed so that package names are no longer shown in the list. Only a one-line summary is shown, but sometimes that gives no clue as to what the package actually is; e.g. the summary could be something like "Transitional dummy package".

In order to show package names, you have to click Technical description, then on the Changes tab. As you click on each item in the list, you have to wait for the changelog to display, which takes ages and maxes out the CPU for longer changelogs (e.g. for new kernel versions). [Since 13.04 was only released recently however, currently most changelogs are quite short. Later in the cycle as changelogs get longer, that this will become more of a problem.]

Tormod Volden (tormodvolden) wrote :

This is bad as ever on 14.04. The current kernel updates have a > 10000 line changelog, and update-manager freezes around 20 seconds (on a quad-core, 8 GB RAM desktop) before it refreshes the GUI when I click on these packages.

I use the attached patch as a stop gap, it only lists up to 24 lines of a changelog. A real fix is probably a bit more complex because of the convoluted way the changelog is filtered and displayed. Maybe python cannot do it efficiently enough, the match operations seem pretty slow and limited and processing only line by line with all the hoops to get the work done doesn't help.

The patch can be applied with: sudo patch /usr/lib/python3/dist-packages/UpdateManager/ < update-manager-changelog-slow-628657.patch

dino99 (9d9) wrote :

This version is no more supported

Changed in update-manager (Ubuntu):
status: Confirmed → Invalid
Tormod Volden (tormodvolden) wrote :

dino99, what do you mean, isn't 14.04 supported any longer?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers