freezes for > 10s when displaying long changelogs

Bug #628657 reported by Tormod Volden
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
Confirmed
Medium
Unassigned

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 2.6.32.15+drm33.5
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
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: update-manager

Revision history for this message
Tormod Volden (tormodvolden) wrote :
Revision history for this message
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
linux-libc-dev:
  Installed: 2.6.32-24.41
  Candidate: 2.6.32-25.43
  Version table:
     2.6.32-25.43 0
        500 http://ch.archive.ubuntu.com/ubuntu/ lucid-proposed/main Packages
     2.6.32-24.42 0
        500 http://ch.archive.ubuntu.com/ubuntu/ lucid-updates/main Packages
 *** 2.6.32-24.41 0
        500 http://security.ubuntu.com/ubuntu/ lucid-security/main Packages
        100 /var/lib/dpkg/status
     2.6.32-21.32 0
        500 http://ch.archive.ubuntu.com/ubuntu/ lucid/main Packages

Revision history for this message
Tormod Volden (tormodvolden) wrote :

Fiddling with /usr/lib/python2.6/dist-packages/UpdateManager/ChangelogViewer.py 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.

Revision history for this message
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>
    app.main(options)
  File "/usr/lib/python2.6/dist-packages/UpdateManager/UpdateManager.py", line 965, in main
    gtk.main()
  File "/usr/lib/python2.6/dist-packages/UpdateManager/UpdateManager.py", 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/UpdateManager.py", line 313, in set_changes_buffer
    changes_buffer.insert(end_iter, line+"\n")
  File "/usr/lib/python2.6/dist-packages/UpdateManager/ChangelogViewer.py", line 122, in on_insert_text
    traceback.print_stack()

summary: - goes wild when selecting latest proposed oo packages
+ freezes for > 10s when displaying long changelogs
Robert Roth (evfool)
Changed in update-manager (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Adam Bruce (brucey-99-deactivatedaccount) wrote :

Present in 13.04

tags: added: raring
Revision history for this message
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.]

Revision history for this message
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/UpdatesAvailable.py < update-manager-changelog-slow-628657.patch

Revision history for this message
dino99 (9d9) wrote :

This version is no more supported

Changed in update-manager (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Tormod Volden (tormodvolden) wrote :

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

Revision history for this message
Tormod Volden (tormodvolden) wrote :

Certainly happening in xenial, which is still supported. Clicking on a kernel package makes it hang for a long time. Still have to apply my above patch.

Changed in update-manager (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Tormod Volden (tormodvolden) wrote :

Today's linux-libc-dev changelog was 40000 lines. This freezes the update-manager GUI (with 100% CPU) in Ubuntu 20.04 for very long.

My 10 year old patch above still applies.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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