GNOME Bugzilla – Bug 708721
synchronously enumerating the children of a file from multiple threads leads to critical warnings
Last modified: 2013-09-26 10:36:44 UTC
Created attachment 255664 [details] simple test-case that illustrates the problem We have code that access an SMB share from multiple threads and since we have updated gvfs from version 1.12 to version 1.16, we are seeing critical warnings from g_main_context_push_thread_default() and g_main_context_pop_thread_default(). I will attach a simple test-case that illustrates the problem.
Ok, so the problem is that in gdaemonfileenumerator.c:register_vfs_filter_cb() will be called back on all threads that use dbus for their dbus connections (bug 708744). This then proceeds to push the daemon->next_files_context as the default main context in order to get all dbus replies to the skeleton to the right main context. However, this tries to aquire the context, which can fail if the thread that does i/o on the file enumerator is spinning the mainloop on the context (i.e. it runs g_daemon_file_enumerator_next_file()).
*** This bug has been marked as a duplicate of bug 708744 ***