Gnome and Human icon themes do not contain icon caches

Bug #262723 reported by Sergey Nizovtsev
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Baltix
New
Undecided
Unassigned
breathe-icon-theme (Ubuntu)
Fix Released
Undecided
Andrew Starr-Bochicchio
Nominated for Hardy by Mantas Kriaučiūnas
Nominated for Jaunty by Mantas Kriaučiūnas
gnome-icon-theme (Ubuntu)
Fix Released
Low
Unassigned
Nominated for Hardy by Mantas Kriaučiūnas
Nominated for Jaunty by Mantas Kriaučiūnas
gtk+2.0 (Ubuntu)
Fix Released
Low
Unassigned
Nominated for Hardy by Mantas Kriaučiūnas
Nominated for Jaunty by Mantas Kriaučiūnas
human-icon-theme (Ubuntu)
Fix Released
Low
Unassigned
Nominated for Hardy by Mantas Kriaučiūnas
Nominated for Jaunty by Mantas Kriaučiūnas

Bug Description

It takes the system a long time (from 3 to 10 seconds) to start up many of Gnome programs, because they have to do a lot of disk operations as startup, and icon caches can help to reduce disk intensivity.
However, "Human" and "gnome" icon themes has not cache in Ubuntu.

Facts:
Default Ubuntu 8.04:
$ time strace -e open gnome-system-monitor 2>&1 | wc -l
1914

real 0m3.459s
user 0m0.576s
sys 0m2.628s

Let's create icon cache:
$ sudo gtk-update-icon-cache /usr/share/icons/Human/
$ sudo gtk-update-icon-cache /usr/share/icons/gnome/

And now:
$ time strace -e open gnome-system-monitor 2>&1 | wc -l
976

real 0m2.318s
user 0m0.380s
sys 0m1.688s

P.S. Sorry for my bad English

Revision history for this message
Siegfried Gevatter (rainct) wrote :

Thanks for your bug report, but I can't reproduce it. Which version of Ubuntu, gnome-icon-theme and human-icon-theme are you using?

Revision history for this message
Sergey Nizovtsev (snizovtsev) wrote :

Clean Ubuntu 8.04 with all updates (in virtualbox).
gnome-icon-theme 2.22.0-1ubuntu2
human-icon-theme 0.28
This is proposal to optimization, not a usual bug.
It easy to check - /usr/share/icons/{gnome,Human} doesn't contain icon-theme.cache file.

Revision history for this message
Siegfried Gevatter (rainct) wrote :

This is a bug, as the icon cache should be generated after installing the packages. I don't understand why you are experiencing this problem, though, as at least human-icon-theme should already be doing that.

Revision history for this message
Sergey Nizovtsev (snizovtsev) wrote :

human-icon-theme runs "update-icon-caches /usr/share/icons/Human/", but update-icons-cache does not create icon-theme.cache file, it only updates this:
    if [ -f "$dir"/index.theme ]; then
        if [ -f "$dir"/icon-theme.cache ]; then
            # The cache already exists, regenerate it
            if ! gtk-update-icon-cache --force --quiet "$dir"; then
                echo "WARNING: icon cache generation failed for $dir"
            fi
        fi
Default Ubuntu installation does not contain icon-theme.cache file.

Revision history for this message
Sebastien Bacher (seb128) wrote :

the bug is not a gtk one

Changed in gtk+2.0:
importance: Undecided → Low
status: New → Invalid
Revision history for this message
Milan Bouchet-Valat (nalimilan) wrote :

Could somebody confirm that trivial bug? It seems to have consequences important enough to see what happens...

Revision history for this message
Stefan Friesel (stefan-friesel) wrote :

I think both themes should run
gtk-update-icon-cache --quiet /usr/share/icons/<theme-name>/
directly to create the cache.

As Sergey pointed out, update-icon-caches will only update already existing caches (which is yet another bug imho).

Revision history for this message
Benjamin Drung (bdrung) wrote :

The Human icon theme runs dh_icons. dh_icons creates postinst and postrm scripts, which runs update-icon-caches.

The GNOME icon theme runs dh_icons, too. But dh_icons does not create the postinst and postrm scripts. Is this a bug in debhelper?

Changed in gnome-icon-theme (Ubuntu):
importance: Undecided → Low
Revision history for this message
Elliot Glaysher (glaysher) wrote :

The Chromium project is interested in seeing this fixed. I would like to turn the GTK interface on by default in Chromium and Google Chrome but currently can't because our startup tests show a roughly 200ms regression in startup time because of the lack of icon caches.

Revision history for this message
Sebastien Bacher (seb128) wrote :

the issue has been fixed for a while, icon caches are built for all themes in a automatic way for several cycles

Changed in human-icon-theme (Ubuntu):
importance: Undecided → Low
status: New → Fix Released
Changed in gnome-icon-theme (Ubuntu):
status: New → Fix Released
Revision history for this message
Stefan Friesel (stefan-friesel) wrote :

What exactly is this automatic way? I don't get caches after reinstalling the *-icon-theme packages.There are still no caches installed by default and the postinst-scripts still run update-icon-caches which does not create new caches as Sergey pointed out. Maybe its a bug in dh_icons?

Revision history for this message
Sebastien Bacher (seb128) wrote :

could you give details on the ubuntu version you are using and the icon themes you are installing too?

Revision history for this message
Sebastien Bacher (seb128) wrote :

did you look in the directory to make sure you have no cache?

Revision history for this message
Stefan Friesel (stefan-friesel) wrote :

This is up-to-date jaunty and I meant {gnome,human}-icon-theme.

stefan@stefan-laptop:~$ ls /usr/share/icons/Human/
12x12 16x16 22x22 24x24 32x32 48x48 8x8 index.theme scalable

If a cache existed prior to updating/reinstalling it of course remains and is correctly updated. I'll check if caches are installed by default on current live CDs but nonetheless it should be possible to delete the cache, reinstall the theme and get it back, right?

Revision history for this message
Elliot Glaysher (glaysher) wrote :

There currently aren't icon caches for Human or gnome on jaunty xubuntu:

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.04
DISTRIB_CODENAME=jaunty
DISTRIB_DESCRIPTION="Ubuntu 9.04"

$ find /usr/share/icons -name "icon-theme.cache"
/usr/share/icons/hicolor/icon-theme.cache
/usr/share/icons/Mist/icon-theme.cache
/usr/share/icons/Crux/icon-theme.cache
/usr/share/icons/HighContrastLargePrintInverse/icon-theme.cache

/usr/share/icons/{gnome,Human,Tango}/ exist, but they don't have icon caches.

Revision history for this message
Sebastien Bacher (seb128) wrote :

trying with the karmic alpha6 iso the human cache is there but not the gnome one

Changed in gnome-icon-theme (Ubuntu):
status: Fix Released → Triaged
Revision history for this message
Alexander Sack (asac) wrote :

from what Sebastien told me the fix involved changes to the packaging tools ... which makes it a not-so-easy to backport for hardy etc.

Revision history for this message
Mantas Kriaučiūnas (mantas) wrote :

Alexander Sack wrote on 2009-09-28:
> from what Sebastien told me the fix involved changes to the packaging tools ... which makes it a not-so-easy to backport for hardy etc.

AFAIK you are not right - this is stupid bug in /usr/sbin/update-icon-caches script, because update-icons-cache does not create icon-theme.cache file, it works only if icon-theme.cache file already exist in theme folder. Sergey Nizovtsev (reporter of this bug) already noticed this and correctly assigned this bug to gtk+2.0 package (update-icon-caches script is in libgtk2.0-bin package).
This bug was fixed in gtk+ 2.16.1-1, which was released on 12 April 2009, but Ubuntu developers forgot to include these improvements in Ubuntu Jaunty libgtk+2.0-bin package, released on 15 April 2009 and included only in libgtk2.0-bin 2.18.x package in Ubuntu Karmic, look at changelog.Debian :

gtk+2.0 (2.16.1-1) experimental; urgency=low
  [ Josselin Mouette ]
  * Make update-icon-caches always generate the cache, now that dh_icons is widespread.
-- Sebastian Dröge <email address hidden> Sun, 12 Apr 2009 11:21:58 +0200

So, please fix this bug in Ubuntu Jaunty and Hardy by applying attached 2 lines patch against update-icon-caches script, this is safe and patched packages can go into ubuntu-updates repository.

Changed in gtk+2.0 (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

did you read the changelog comment? the change has been made on the assumption that dh_icons is used correctly, it would require a review of all the jaunty packages installing an icons before changing that to a stable, that's not the sort of change we want in a sru, the issue is fixed in karmic too

Changed in gtk+2.0 (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Mantas Kriaučiūnas (mantas) wrote :

Sebastien Bacher wrote 4 minutes ago:
> did you read the changelog comment?
> the change has been made on the assumption that dh_icons is used correctly, it would require a review of all the jaunty packages installing an icons before changing that to a stable

Sorry, I don't understand you :( I've found just one line about update-icon-caches in changelog.Debian:

gtk+2.0 (2.16.1-1) experimental; urgency=low
  * Make update-icon-caches always generate the cache, now that dh_icons is widespread.

Please tell me exactly what I should read and why this change "require a review of all the jaunty packages installing an icons before changing that to a stable"? What problems can appear in Ubuntu Jaunty if I apply patch against update-icon-caches to make always generate the cache?

Thanks,
Mantas Kriaučiūnas,
Main developer of Baltix GNU/Linux operating system - http://launchpad.net/baltix

Revision history for this message
Sebastien Bacher (seb128) wrote :

the key word in this line is dh_icons, if some package don 't use it but install an icon in the gnome directory it will be broken by the gtk change since gtk will not look out of the cache if there is a cache available and return that the icon is not installed which leads to issues , before turning that cache update for the gnome theme you have to make sure all applications do update the cache, we didn't do this work on jaunty and it would require somebody to check every package installing a gnome icon to see which one are broken and would need to be update for the change to work on jaunty

Revision history for this message
Stefan Friesel (stefan-friesel) wrote :

Sebastien Bacher wrote 9 hours ago:
> it will be broken by the gtk change since gtk will not look out of the cache if there is a cache available

...which is yet another bug :-)

A cache should speed up read access, not return false negatives.

Revision history for this message
Sebastien Bacher (seb128) wrote :

> ...which is yet another bug :-)

you can argue about that, looking through the directory to find things with a timestamp newer than the cache would have an impact on the lookup speed for no reason in most cases if the case is correctly updated

Revision history for this message
Stefan Friesel (stefan-friesel) wrote :

Sorry, I meant looking through the directories only in case the icon is _not_ in the cache.

Changed in breathe-icon-theme (Ubuntu):
assignee: nobody → Andrew Starr-Bochicchio (andrewsomething)
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package breathe-icon-theme - 0.51.1

---------------
breathe-icon-theme (0.51.1) karmic; urgency=low

  * debian/rules: Explicitly call dh_icons. (LP: #262723)
  * debian/links: Add symlink for for nm-no-connection (LP: #429449),
    drive-*-usb (LP: #253599), and media-flash-* (LP: #417294).

 -- Andrew Starr-Bochicchio <email address hidden> Sat, 10 Oct 2009 00:27:18 -0400

Changed in breathe-icon-theme (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Sebastien Bacher (seb128) wrote :

the issue is fixed in lucid now

Changed in gnome-icon-theme (Ubuntu):
status: Triaged → Fix Released
Paul Sladen (sladen)
tags: added: gtk-update-icon-cache
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.