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 565924 - GFileMonitor makes crash gedit
GFileMonitor makes crash gedit
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: win32
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2008-12-29 12:42 UTC by Ignacio Casal Quinteiro (nacho)
Modified: 2017-10-05 12:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ignacio Casal Quinteiro (nacho) 2008-12-29 12:42:33 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
Comment 1 Matthias Clasen 2009-01-02 02:40:08 UTC
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 ? 
Comment 2 Ignacio Casal Quinteiro (nacho) 2009-01-02 11:33:01 UTC
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
  • #0 g_file_monitor_is_cancelled
    from C:\msys\bin\libgio-2.0-0.dll
  • #1 g_win32_directory_monitor_callback
    from C:\msys\bin\libgio-2.0-0.dll
  • #2 ReadFileEx
    from C:\WINDOWS\system32\kernel32.dll
  • #3 ??
  • #4 ??
  • #5 ??
  • #6 ??
  • #7 ??
  • #8 ntdll!LdrCreateOutOfProcessImage
    from ntdll.dll
  • #9 g_win32_directory_monitor_cancel
    from C:\msys\bin\libgio-2.0-0.dll

Comment 3 Philip Withnall 2017-10-05 12:24:52 UTC
The g_win32_directory_monitor_callback() code was eliminated in commit 671292bbb284735aead726f55fbd8c99f9793959 (bug #730116), so I think this can be closed.