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 593856 - file and directory monitors don't work when glib is compiled with --enable-debug=no
file and directory monitors don't work when glib is compiled with --enable-de...
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.21.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2009-09-01 22:03 UTC by Lauro
Modified: 2009-11-26 14:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Allow-code-in-g_assert-to-have-side-effects.patch (1.04 KB, patch)
2009-09-01 22:03 UTC, Lauro
none Details | Review
Fix g_assert() usage (3.12 KB, patch)
2009-11-11 12:40 UTC, Kalle Vahlman
none Details | Review

Description Lauro 2009-09-01 22:03:58 UTC
Created attachment 142281 [details] [review]
0001-Allow-code-in-g_assert-to-have-side-effects.patch

The inotify file and directory monitors use g_asset with side-effects. See the
functions g_inotify_directory_monitor_constructor and
g_inotify_file_monitor_constructor: 

  /* FIXME: what to do about errors here? we can't return NULL or another
   * kind of error and an assertion is probably too hard */
  g_assert (sub != NULL);
  g_assert (_ih_sub_add (sub)); <=========

When the debug is disabled the function _ih_sub_add is not called.


There are two possible solutions for this issue: fix the inotify monitor code
or allow the g_assert to have side-effects (see the attached patch).
Comment 1 Matthias Clasen 2009-09-01 22:10:42 UTC
I prefer to fix the inotify monitor code.
Comment 2 Kalle Vahlman 2009-11-11 12:40:21 UTC
Created attachment 147469 [details] [review]
Fix g_assert() usage

Would this patch do?

It was originally attached to 

  http://linux.onarm.com/bugzilla/show_bug.cgi?id=91

hence the suboptimal commit message...
Comment 3 Adrian Bunk 2009-11-16 23:01:25 UTC
I'd suggest to either make _ih_sub_add() return void, or handle the return value even if it's currently always TRUE.

That's better than keeping the gboolean return while relying on it always being TRUE.
Comment 4 Alexander Larsson 2009-11-26 14:43:45 UTC
commited to master and glib-2-22