[DRE-maint] Bug#582043: libgtk2-ruby1.8: Ruby/GTK+ program spins around when other Ruby threads are executing

Drake Wilson drake at begriffli.ch
Mon May 17 21:10:51 UTC 2010


Package: libgtk2-ruby1.8
Version: 0.19.3-2
Severity: normal

The following program:

----------------------------------------
#!/usr/bin/ruby
require 'gtk2'

@window = Gtk::Window.new('Bogosity')
@window.set_default_size(320, 240)
@window.show

def count() i = 0; loop { sleep 1; i += 1 } end
@thread = Thread.new { count() }
Gtk.main
----------------------------------------

does not properly block when no GTK+ input events are being received
and the other thread is sleeping.  It generates strace output (with
strace -etrace=\!rt_sigprocmask) along the lines of the attached file;
observe the repeated flips between select() and poll(), all with zero
timeouts.

Commenting out the @thread creation causes the GTK+ main loop to block
(according to interactive strace) when no input events are coming to
the window, and commenting out the Gtk.main and replacing it with <<
sleep 0.5; count() >> causes the Ruby threading engine to block when
both threads are sleeping.  Mixing the two causes a furious explosion
of system calls.

   ---> Drake Wilson

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.29-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libgtk2-ruby1.8 depends on:
ii  libatk1-ruby1.8              0.19.3-2    ATK bindings for the Ruby language
ii  libatk1.0-0                  1.30.0-1    The ATK accessibility toolkit
ii  libc6                        2.10.2-7    Embedded GNU C Library: Shared lib
ii  libcairo2                    1.8.8-2     The Cairo 2D vector graphics libra
ii  libfontconfig1               2.8.0-2.1   generic font configuration library
ii  libfreetype6                 2.3.11-1    FreeType 2 font engine, shared lib
ii  libgdk-pixbuf2-ruby1.8       0.19.3-2    Gdk-Pixbuf 2 bindings for the Ruby
ii  libglib2.0-0                 2.24.0-1    The GLib library of C routines
ii  libgtk2.0-0                  2.20.0-3    The GTK+ graphical user interface 
ii  libpango1-ruby1.8            0.19.3-2    Pango bindings for the Ruby langua
ii  libpango1.0-0                1.26.2-1    Layout and rendering of internatio
ii  libruby1.8                   1.8.7.249-2 Libraries necessary to run Ruby 1.

libgtk2-ruby1.8 recommends no packages.

libgtk2-ruby1.8 suggests no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dpw-20100517-gtk-spin-1.strace.gz
Type: application/x-gzip
Size: 16953 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-ruby-extras-maintainers/attachments/20100517/0eb47974/attachment.bin>


More information about the Pkg-ruby-extras-maintainers mailing list