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 751731 - GFile/DirectoryMonitor emit move events with other_file=NULL
GFile/DirectoryMonitor emit move events with other_file=NULL
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.45.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
: 749225 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-06-30 14:11 UTC by Carlos Garnacho
Modified: 2015-07-07 11:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
file monitors: report MOVED only with both sides (1.19 KB, patch)
2015-07-06 14:22 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Carlos Garnacho 2015-06-30 14:11:25 UTC
With glib master from yesterday, the following Tracker tests in tests/libtracker-miner/tracker-monitor-test fail:

/libtracker-miner/tracker-monitor/file-event/moved/to-not-monitored
/libtracker-miner/tracker-monitor/directory-event/moved/to-not-monitored

Both with the same error:
(/home/carlos/Source/gnome/tracker/tests/libtracker-miner/.libs/lt-tracker-monitor-test:17595): GLib-GIO-CRITICAL **: g_file_get_path: assertion 'G_IS_FILE (file)' failed
Trace/breakpoint trap (core dumped)

The failing file is the other_file on a G_FILE_MONITOR_EVENT_MOVED, we used to rely on getting these cases translated into G_FILE_MONITOR_EVENT_DELETED by glib, and only get MOVED events if both source and dest are monitored.

This doesn't seem to happen in my system's glib 2.44.1 (f22), where I get the DELETED event as TrackerMonitor/tests used to expect. Note that Tracker doesn't use yet G_FILE_MONITOR_WATCH_MOVES, and keeps using SEND_MOVED.
Comment 1 Allison Karlitskaya (desrt) 2015-07-06 14:22:39 UTC
Created attachment 306925 [details] [review]
file monitors: report MOVED only with both sides

Make sure we know the destination file before reporting a MOVED event.
Otherwise, we should just fall back to reporting it as a DELETED.
Comment 2 Carlos Garnacho 2015-07-06 14:29:45 UTC
That makes the test suite pass again, thanks!
Comment 3 Allison Karlitskaya (desrt) 2015-07-06 14:43:19 UTC
Attachment 306925 [details] pushed as 7ed76a4 - file monitors: report MOVED only with both sides
Comment 4 Iain Lane 2015-07-07 11:51:40 UTC
*** Bug 749225 has been marked as a duplicate of this bug. ***