gdk-pixbuf uses temporary files when loading xpm images

Bug #777011 reported by James Hunt
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gdk-pixbuf
Fix Released
Medium
gdk-pixbuf (Ubuntu)
New
Undecided
Unassigned

Bug Description

io-xpm.c:gdk_pixbuf__xpm_image_begin_load() has the following comment:

/*
 * FIXME xpm loading progressively is not properly implemented.
 * Instead we will buffer to a file then load that file when done.
 * This is very broken but it should be relayively simple to fix
 * in the future.
 */

What this actually means is that gdk creates a file in /tmp, writes to it, and then deletes it *every* time you do any of the following in a gnome/Unity environment:

- click a mouse button anywhere (any app, any window)
- scroll a mouse wheel anywhere (any app, any window)

Additionally, if you move your mouse to top-left or bottom-right of the screen *and just hold it there*, files will be created, modified and then deleted continuously.

Clearly, this is a nasty hack and temporary files are evil at the best of times. If you have slow disks, your desktop experience may also suffer.

Temp files are created using g_file_open_tmp():

fd = g_file_open_tmp ("gdkpixbuf-xpm-tmp.XXXXXX", &context->tempname, NULL);

This template expands to file names like "/tmp/gdkpixbuf-xpm-tmp.UV9WUV".

Pressing the Windows/meta button to get the Unity search box to appear generates approximately 60 temporary files (!!)

Revision history for this message
James Hunt (jamesodhunt) wrote :

The Unity team might be interested in this bug.

Revision history for this message
Colin Watson (cjwatson) wrote :
Revision history for this message
Kees Cook (kees) wrote :

Using "inotifywait -mr /tmp" I don't see these files being created. Perhaps this only happens with Unity-2d?

Revision history for this message
James Hunt (jamesodhunt) wrote :

@Kees: I was running Unity 3D. However, the problem has now "gone away" so since the gdk-pixbuf code hasn't been fixed yet...

http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/oneiric/gdk-pixbuf/oneiric/view/head:/gdk-pixbuf/io-xpm.c#L709

... Unity must have worked around this issue by avoiding the use of xpm images I guess (or avoided use of gdk-pixbuf?)

Changed in gdk-pixbuf:
importance: Unknown → Medium
status: Unknown → New
Changed in gdk-pixbuf:
status: New → Fix Released
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.