After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 343345 - gdk_pixbuf_scale_simple spins with 100% cpu
gdk_pixbuf_scale_simple spins with 100% cpu
Status: RESOLVED DUPLICATE of bug 80925
Product: gdk-pixbuf
Classification: Platform
Component: general
git master
Other All
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-05-30 00:16 UTC by Matthew Wire
Modified: 2010-07-10 04:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase (256 bytes, text/x-csrc)
2006-07-05 12:36 UTC, James "Doc" Livingston
Details

Description Matthew Wire 2006-05-30 00:16:48 UTC
Please describe the problem:
When Rhythmbox is minimised to system tray it will play a few songs and then
freeze - it does not respond to mouseclicks or keyboard commands.
After an arbitrary delay ~15 minutes it starts playing the next song.

Steps to reproduce:
1. Minimise RB to system tray
2. Leave it playing songs (shuffle on)
3.


Actual results:
Rhythmbox freezes.  Then recovers after ~15minutes.

Expected results:
Normal playback

Does this happen every time?
Yes, I think so

Other information:
I ran rhythmbox all day today with -d active.  I have had no problems.  This
suggests to me that there is some sort of race-condition occurring which is
eliminated when being debugged.
Please let me know if you require more information.
I'm running Ubuntu Dapper on an AMD64 system but the same thing happens on a
32bit system.
Comment 1 Jonathan Matthew 2006-05-30 00:22:34 UTC
I'm not seeing this happen at all.  Which plugins do you have enabled?
Can you get a stack trace from when it's frozen?
Comment 2 Victor Osadci (Vic) 2006-05-30 09:50:18 UTC
Something similat happens here with HEAD, but I haven't waited 15 min to see if starts working. Can you see if it takes 100% CPU when rb freezes ? It does for me.
Comment 3 Matthew Wire 2006-05-30 12:34:24 UTC
Victor, what configuration options do you build rb with?
This is mine:
configure: Rhythmbox was configured with the following options:
configure: ** Tree database is enabled
configure:    Tag writing is disabled
configure: ** Track transfer is enabled - USE AT YOUR OWN RISK
configure: ** Multimedia keys support is enabled
configure: ** MusicBrainz support is enabled
configure: ** GStreamer 0.10 player is enabled
configure:    iPod integration disabled
configure:    DAAP (music sharing) support is disabled
configure: ** libnotify support is enabled
configure: ** HAL support enabled
configure: ** Python support enabled
configure:    Audioscrobbler support disabled
configure: ** Separate metadata helper process enabled
configure:    using internal libsexy
configure: End options

Yes, mine uses 100% cpu as  well.

Just rebuilt today and can't get it to freeze. Typical... I'll keep you posted on this.
Comment 4 Victor Osadci (Vic) 2006-05-30 15:00:09 UTC
configure: Rhythmbox was configured with the following options:
configure: ** Tree database is enabled
configure:    Tag writing is disabled
configure:    Track transfer is disabled
configure: ** Multimedia keys support is enabled
configure: ** MusicBrainz support is enabled
configure: ** GStreamer 0.10 player is enabled
configure:    iPod integration disabled
configure: ** DAAP (music sharing) support is enabled
configure: ** libnotify support is enabled
configure: ** HAL support enabled
configure: ** Python support enabled
configure: ** Audioscrobbler support enabled
configure: ** Separate metadata helper process enabled
configure: ** using system-wide libsexy
configure: End options

I have the following plugins enabled: Last.fm, Lyrics, Artist/Album Browser (not in stock), Art Display. I am disabling them one by one and will see how it goes, but this may take a bit of time .
Comment 5 Matthew Wire 2006-05-31 20:42:31 UTC
This one is going to be a difficult one I think...
From what I can tell it only seems to happen when I have the art display plugin enabled and rhythmbox minimised.  But sometimes it doesn't happen straight away.
Comment 6 James "Doc" Livingston 2006-06-07 04:59:38 UTC
When it has frozen, could you run "gdb --pid=`pidof rhythmbox`" in a terminal, and then enter "thread apply all bt" and put the output here?
Comment 7 Matthew Wire 2006-06-07 14:16:11 UTC
Just happened again (Using latest head by the way).
Here is the debug trace as requested:

(gdb) thread apply all bt

Thread 1 (Thread 1115969888 (LWP 4234))

  • #0 poll
    from /lib/libc.so.6
  • #1 snd_pcm_direct_check_interleave
    from /usr/lib/libasound.so.2
  • #2 snd_pcm_direct_server_create
    from /usr/lib/libasound.so.2
  • #3 snd_pcm_dmix_open
    from /usr/lib/libasound.so.2
  • #4 _snd_pcm_dmix_open
    from /usr/lib/libasound.so.2
  • #5 snd_pcm_free
    from /usr/lib/libasound.so.2
  • #6 snd_pcm_open_slave
    from /usr/lib/libasound.so.2
  • #7 _snd_pcm_softvol_open
    from /usr/lib/libasound.so.2
  • #8 snd_pcm_free
    from /usr/lib/libasound.so.2
  • #9 snd_pcm_free
    from /usr/lib/libasound.so.2
  • #10 snd_pcm_open_slave
    from /usr/lib/libasound.so.2
  • #11 _snd_pcm_plug_open
    from /usr/lib/libasound.so.2
  • #12 snd_pcm_free
    from /usr/lib/libasound.so.2
  • #13 snd_pcm_free
    from /usr/lib/libasound.so.2
  • #14 ??
    from /usr/lib/gstreamer-0.10/libgstalsa.so
  • #15 gst_audio_sink_get_type
    from /usr/lib/libgstaudio-0.10.so.0
  • #16 gst_ring_buffer_open_device
    from /usr/lib/libgstaudio-0.10.so.0
  • #17 gst_base_audio_sink_create_ringbuffer
    from /usr/lib/libgstaudio-0.10.so.0
  • #18 gst_element_continue_state
    from /usr/lib/libgstreamer-0.10.so.0
  • #19 gst_element_lost_state
    from /usr/lib/libgstreamer-0.10.so.0
  • #20 gst_auto_audio_sink_get_type
    from /usr/lib/gstreamer-0.10/libgstautodetect.so
  • #21 gst_element_continue_state
    from /usr/lib/libgstreamer-0.10.so.0
  • #22 gst_element_lost_state
    from /usr/lib/libgstreamer-0.10.so.0
  • #23 gst_bin_iterate_sorted
    from /usr/lib/libgstreamer-0.10.so.0
  • #24 gst_element_continue_state
    from /usr/lib/libgstreamer-0.10.so.0
  • #25 gst_element_lost_state
    from /usr/lib/libgstreamer-0.10.so.0
  • #26 gst_bin_iterate_sorted
    from /usr/lib/libgstreamer-0.10.so.0
  • #27 gst_gconf_audio_sink_get_type
    from /usr/lib/gstreamer-0.10/libgstgconfelements.so
  • #28 gst_element_continue_state
    from /usr/lib/libgstreamer-0.10.so.0
  • #29 gst_element_lost_state
    from /usr/lib/libgstreamer-0.10.so.0
  • #30 gst_bin_iterate_sorted
    from /usr/lib/libgstreamer-0.10.so.0
  • #31 gst_element_continue_state
    from /usr/lib/libgstreamer-0.10.so.0
  • #32 gst_element_lost_state
    from /usr/lib/libgstreamer-0.10.so.0
  • #33 ??
    from /usr/lib/gstreamer-0.10/libgstplaybin.so
  • #34 ??
    from /usr/lib/gstreamer-0.10/libgstplaybin.so
  • #35 gst_play_base_bin_get_type
    from /usr/lib/gstreamer-0.10/libgstplaybin.so
  • #36 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #37 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #38 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #39 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #40 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #41 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #42 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #43 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #44 ??
    from /usr/lib/gstreamer-0.10/libgstogg.so
  • #45 ??
    from /usr/lib/gstreamer-0.10/libgstogg.so
  • #46 ??
    from /usr/lib/gstreamer-0.10/libgstogg.so
  • #47 gst_task_get_type
    from /usr/lib/libgstreamer-0.10.so.0
  • #48 g_thread_pool_free
    from /usr/lib/libglib-2.0.so.0
  • #49 g_static_private_free
    from /usr/lib/libglib-2.0.so.0
  • #50 start_thread
    from /lib/libpthread.so.0
  • #51 clone
    from /lib/libc.so.6
  • #52 ??
  • #0 poll
    from /lib/libc.so.6

Comment 8 Victor Osadci (Vic) 2006-06-11 16:20:16 UTC
Another trace; this only happens with the art plugin and rb minimised

Thread 1 (Thread -1227602240 (LWP 5434))

  • #0 gdk_pixbuf_rotation_get_type
    from /usr/lib/libgdk_pixbuf-2.0.so.0
  • #1 _pixops_scale
    from /usr/lib/libgdk_pixbuf-2.0.so.0
  • #2 gdk_pixbuf_scale
    from /usr/lib/libgdk_pixbuf-2.0.so.0
  • #3 gdk_pixbuf_scale_simple
    from /usr/lib/libgdk_pixbuf-2.0.so.0
  • #4 init_gtk
    from /usr/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so
  • #5 PyCFunction_Call
    from /usr/lib/libpython2.4.so.1.0
  • #6 PyEval_EvalFrame
    from /usr/lib/libpython2.4.so.1.0
  • #7 PyEval_EvalFrame
    from /usr/lib/libpython2.4.so.1.0
  • #8 PyEval_EvalFrame
    from /usr/lib/libpython2.4.so.1.0
  • #9 PyEval_EvalFrame
    from /usr/lib/libpython2.4.so.1.0
  • #10 PyEval_EvalFrame
    from /usr/lib/libpython2.4.so.1.0
  • #11 PyEval_EvalFrame
    from /usr/lib/libpython2.4.so.1.0
  • #12 PyEval_EvalCodeEx
    from /usr/lib/libpython2.4.so.1.0
  • #13 PyFunction_SetClosure
    from /usr/lib/libpython2.4.so.1.0
  • #14 PyObject_Call
    from /usr/lib/libpython2.4.so.1.0
  • #15 PyMethod_New
    from /usr/lib/libpython2.4.so.1.0
  • #16 PyObject_Call
    from /usr/lib/libpython2.4.so.1.0
  • #17 PyEval_CallObjectWithKeywords
    from /usr/lib/libpython2.4.so.1.0
  • #18 PyObject_CallObject
    from /usr/lib/libpython2.4.so.1.0
  • #19 initgobject
    from /usr/lib/python2.4/site-packages/gtk-2.0/gobject.so
  • #20 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #21 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #22 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #23 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #24 reemit_playing_signal
    at rb-shell-player.c line 539
  • #25 g_cclosure_marshal_VOID__PARAM
    from /usr/lib/libgobject-2.0.so.0
  • #26 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #27 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #28 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #29 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #30 g_object_interface_list_properties
    from /usr/lib/libgobject-2.0.so.0
  • #31 g_value_get_flags
    from /usr/lib/libgobject-2.0.so.0
  • #32 g_object_notify
    from /usr/lib/libgobject-2.0.so.0
  • #33 rb_shell_player_set_playing_entry
    at rb-shell-player.c line 1024
  • #34 rb_shell_player_do_next
    at rb-shell-player.c line 1480
  • #35 eos_cb
    at rb-shell-player.c line 2428
  • #36 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #37 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #38 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #39 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #40 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #41 _rb_player_emit_eos
    at rb-player.c line 226
  • #42 rb_player_gst_bus_cb
    at rb-player-gst.c line 459
  • #43 gst_bus_set_sync_handler
    from /usr/lib/libgstreamer-0.10.so.0
  • #44 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #45 g_main_context_check
    from /usr/lib/libglib-2.0.so.0
  • #46 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #47 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #48 main
    at main.c line 375
  • #0 gdk_pixbuf_rotation_get_type
    from /usr/lib/libgdk_pixbuf-2.0.so.0

Comment 9 James "Doc" Livingston 2006-07-05 12:31:19 UTC
This appears to be a GDK bug (I have a trivial C testcase), so I'm reassigning there.
Comment 10 James "Doc" Livingston 2006-07-05 12:36:04 UTC
Created attachment 68397 [details]
testcase

This is a trivial testcase compilable with "gcc `pkg-config --cflags --libs gtk+-2.0 ` -o testcase gdk-pixbuf-scale-1-testcase.c", and then run with "./testcase /path/to/some/image".

gdk_pixbuf_scale_simple spins with 100% cpu when width=1, height=1 and interp_type is anything other than GDK_INTERP_NEAREST. A quick profiling indicates that virtually all the time is being spent in pixops_process, but I don't have full debu symbols installed for gtk, so that may be wrong.

I haven't completely checked whether it occurs with gdk_pixbuf_scale simple, but  I assume it would.
Comment 11 Matthias Clasen 2006-07-05 15:11:29 UTC
doesn't hang here...
Comment 12 Jan Schmidt 2006-07-07 10:05:36 UTC
I am also seeing the infinite cpu spin with RB minimised and using the art cover.

I tried the testcase with a png ~ 100x100 pixels - it exited cleanly.
I also tried with some 2560x1920 pixel jpegs from my camera and I get:

GLib-ERROR **: gmem.c:135: failed to allocate 5037753344 bytes
aborting...
Aborted

which is a little disturbing. 


Comment 13 James "Doc" Livingston 2006-07-08 13:49:48 UTC
I've just tried this with Gtk 2.10, and it's still occurring.

When running my test on a square plain white PNG image, the running times are:
<=95px    negligable
96  0.2 sec
97  0.8 sec
98  3.2 sec
99  6.3 sec
100 8.8 sec
101 9.8 sec
102 0.1 sec
110 0.1 sec
120 27 sec
130 13 sec
134 0.2 sec
140 42 sec
160 111 sec
...

In general it goes up largely with the size, however there are certain sizes where it runs very quickly. Those quick times are seemingly random, but consistent - and they're not things that would be an obvious fast-path like powers of two.

After about 200px square it's taking over 10 minutes, so I haven't really checked. Why resizing a 200x200 image to 1x1 takes that long I don't know, something funky must be going on.



Scaling to a 1x2 or 2x1 image always runs quickly regardless of size, it appears to only be 1x1 that causes this.
Comment 14 Behdad Esfahbod 2006-07-08 15:23:29 UTC
Can you attach one of the PNGs that it's slow on?
Comment 15 Owen Taylor 2006-07-08 17:24:10 UTC
gdk-pixbuf works really badly for large downscale factors; see bug 80925.
The algorithm it uses really falls over in that case, and it will allocate 
many megabytes of temporary matrices. I suspect that this is just a 
duplicate of that.

I'm not sure why you are getting such big differences between different
sizes. Maybe you are running  out of memory and into swap.
Comment 16 James "Doc" Livingston 2006-07-09 03:18:11 UTC
Yeah, this look to be a dupe of bug 80928.

I've just committed a few minor changes to Rhythmbox so that we shouldn't trigger it any more: don't fade between art when minimised, don't ever scale to 1x1 (just hide it) and use known-good values for the widget width.


So either this should be marked as a dupe of bug 80928, or moved back to Rhythmbox and closed.
Comment 17 Matthias Clasen 2006-07-10 15:52:56 UTC

*** This bug has been marked as a duplicate of 80925 ***