GNOME Bugzilla – Bug 565924
GFileMonitor makes crash gedit
Last modified: 2017-10-05 12:24:52 UTC
we have this: if (g_file_is_native (parent->file) && dir->monitor == NULL) { dir->monitor = g_file_monitor_directory (parent->file, G_FILE_MONITOR_NONE, NULL, NULL); if (dir->monitor != NULL) { g_signal_connect (dir->monitor, "changed", G_CALLBACK (on_directory_monitor_event), parent); } } If I do not comment this gedit crashes in windows. the on_directory_monitor_event: static void on_directory_monitor_event (GFileMonitor * monitor, GFile * file, GFile * other_file, GFileMonitorEvent event_type, FileBrowserNode * parent) { FileBrowserNode *node; FileBrowserNodeDir *dir = FILE_BROWSER_NODE_DIR (parent); switch (event_type) { case G_FILE_MONITOR_EVENT_DELETED: node = node_list_contains_file (dir->children, file); if (node != NULL) { model_remove_node (dir->model, node, NULL, TRUE); } break; case G_FILE_MONITOR_EVENT_CREATED: if (g_file_query_exists (file, NULL)) { model_add_node_from_file (dir->model, parent, file, NULL); } break; default: break; } } You can have a look at the code in: http://svn.gnome.org/viewvc/gedit/trunk/plugins/filebrowser/gedit-file-browser-store.c?view=markup
It would be helpful to know a bit more about the crash you see. What is crashing ? g_file_is_native, or g_file_monitor_directory, or your callback ?
I know this is not going to be quite useful but I am not able to get a better backtrace in windows. Stacktrace: Program received signal SIGSEGV, Segmentation fault. 0x6d5999c3 in g_file_monitor_is_cancelled () from C:\msys\bin\libgio-2.0-0.dll (gdb) bt
+ Trace 211231
The g_win32_directory_monitor_callback() code was eliminated in commit 671292bbb284735aead726f55fbd8c99f9793959 (bug #730116), so I think this can be closed.