Bug#544354: glib2.0: gio breaks on Lenny kernels when calling inotify_init1()
Michael Stone
michael at laptop.org
Sun Aug 30 21:05:11 UTC 2009
Package: glib2.0
Severity: normal
Summary
-------
Recent upstream patches contained in glib2.0_2.20.4-1 cause the glib2.0-derived
packages in squeeze to depend on kernel functionality -- inotify_init1() --
that is not available in Lenny kernels. These packages should not depend on
such functionality until squeeze is released.
Remediations
------------
A reasonable compromise might be to adjust the glib2.0 source code to call
inotify_init whenever inotify_init1 fails, as in the following outline:
> inotify_instance_fd = -1;
>
> #ifdef HAVE_INOTIFY_INIT1
> inotify_instance_fd = inotify_init1 (IN_CLOEXEC);
> #endif
>
> if (inotify_instance_fd < 0)
> inotify_instance_fd = inotify_init ();
>
> if (inotify_instance_fd < 0)
> return FALSE;
(Thanks to dilinger at queued.mit.edu for the code.)
Details
-------
I periodically test the Sugar packaging in squeeze and sid by installing
sugar-0.84 into clean Debian chroots on top of my main (lenny) machine. Last
week, Sugar regressed in that it became unable to launch the Journal or to find
installed activities and the Sugar ~/.sugar/default/logs/shell.log file
contained the following suspicious new messages:
> (sugar-session:1844): GLib-GIO-WARNING **: Could not initialize inotify
>
> Traceback (most recent call last):
> File "/usr/lib/python2.5/site-packages/jarabe/desktop/favoritesview.py", line 122, in __connect_to_bundle_registry_cb
> registry = bundleregistry.get_registry()
> File "/usr/lib/python2.5/site-packages/jarabe/model/bundleregistry.py", line 394, in get_registry
> _instance = BundleRegistry()
> File "/usr/lib/python2.5/site-packages/jarabe/model/bundleregistry.py", line 58, in __init__
> monitor = directory.monitor_directory()
> gio.Error: Unable to find default local directory monitor type
Investigating these messages pointed me to
gio/inotify/inotify-helper.c:89,
gio/inotify/inotify-kernel.c:194, and
gio/glocaldirectorymonitor.c:295
in the glib2.0 source code.
The problem seems to have been introduced into inotify-kernel.c in this recent
commit:
http://git.gnome.org/cgit/glib/commit/?id=2192f1003f27eaf523917a046a42d8fc0019a8
7b
which results in the following logic in inotify-kernel.c:
> #ifdef HAVE_INOTIFY_INIT1
> inotify_instance_fd = inotify_init1 (IN_CLOEXEC);
> #else
> inotify_instance_fd = inotify_init ();
> #endif
>
> if (inotify_instance_fd < 0)
> return FALSE;
Unfortunately, inotify_init1() only became available in kernel-2.6.27. Lenny is
currently using 2.6.26.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20090830/b8900fac/attachment-0001.pgp>
More information about the pkg-gnome-maintainers
mailing list