Bug 202128

Summary: gtk-based file chooser freezes after update of x11-toolkits/gtk30 to 3.16
Product: Ports & Packages Reporter: Piotr Kubaj <pkubaj>
Component: Individual Port(s)Assignee: Koop Mast <kwm>
Status: Closed FIXED    
Severity: Affects Many People CC: anindya49, bugsfreebsd, fidaj, gnome, koobs, kwm, miwi, olivierd, pi, shen.elf, w.litter, wulf
Priority: --- Keywords: easy, needs-qa, patch, regression
Version: LatestFlags: bugzilla: maintainer-feedback? (gnome)
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202250
Attachments:
Description Flags
glib2.44-disable-kqueue.patch none

Description Piotr Kubaj freebsd_committer freebsd_triage 2015-08-06 12:49:25 UTC
When I open file chooser in GTK-based programs (e.g. Firefox, Deadbeef) it doesn't open, but makes the whole program freeze. Then, it has to be killed. It didn't happen before. Running programs from command line doesn't print any relevant warnings or errors. To be sure, I also recompiled Deadbeef, but it didn't help.
Comment 1 Walter Schwarzenfeld 2015-08-06 13:35:49 UTC
Same problems. With all editors (including LibreOffice), firefox and thunderbird. pcmanfm does not start anymore.
Comment 2 Ivan Klymenko 2015-08-06 13:47:21 UTC
(In reply to Walter Schwarzenfeld from comment #1)
+1
thunar, nautilus...
Comment 3 Yanhui Shen 2015-08-06 14:12:13 UTC
Looks like I've found the right place to discuss this issue.

Actually, the program hangs at g_volume_monitor_get() => populate_union_monitor() => g_object_new().
therefore it is caused by glib-2.44.1, and there is no bug report for glib yet on this site.

Some pure Qt based applications also have this issue,
due to QFileDialog::getOpenFileNames() some how calls in to glib's g_volume_monitor_get().
Comment 4 Vladimir Kondratyev freebsd_committer freebsd_triage 2015-08-06 14:16:26 UTC
Created attachment 159617 [details]
glib2.44-disable-kqueue.patch

Something broken in gio-kqueue backend. As temporary workaround you can disable it with attached patch
Comment 5 Walter Schwarzenfeld 2015-08-06 14:31:46 UTC
Thanks, seems to work.
Comment 6 commit-hook freebsd_committer freebsd_triage 2015-08-06 16:14:56 UTC
A commit references this bug:

Author: kwm
Date: Thu Aug  6 16:14:43 UTC 2015
New revision: 393663
URL: https://svnweb.freebsd.org/changeset/ports/393663

Log:
  Disable kqueue for now, so we can take our time finding out what is up
  with the file/directory monitoring code. And people can use there
  Gtk based programs again.

  PR:		202128

Changes:
  head/devel/glib20/Makefile
Comment 7 Koop Mast freebsd_committer freebsd_triage 2015-08-06 16:16:26 UTC
Thanks everyone for reporting and proposing the work around patch. This will give us the time to investigate this problem at our leasure.
Comment 8 Walter Schwarzenfeld 2015-08-08 13:19:21 UTC
Filed a PR on gnome.org https://bugzilla.gnome.org/show_bug.cgi?id=753378
Comment 9 Walter Schwarzenfeld 2015-09-22 15:19:19 UTC
Seems they found a solution at gnome-bugzilla:

=> "commenting out that mutex in gio/gunionvolumemonitor.c
and it seem to not hang any more"

581 _g_mount_get_for_mount_path (const gchar  *mount_path,
582                              GCancellable *cancellable)
583 {

593   if (klass->get_mount_for_mount_path)
594     {
595 //      g_rec_mutex_lock (&the_volume_monitor_mutex);
596       mount = klass->get_mount_for_mount_path (mount_path, cancellable);
597 //      g_rec_mutex_unlock (&the_volume_monitor_mutex);
598     }

I tried this on my machine, seems to work.
Comment 10 Anindya Mukherjee 2015-09-29 18:12:38 UTC
Hi, I've been unable to use colord because of this problem; colormgr returns no profiles when kqueue is disabled. I tried commenting out the mutex and re-enabling kqueue in the makefile on my FreeBSD 10.2 64 bit system, and it works! No hangs from any of the listed programs.
Comment 11 Tomasz Sowa 2015-10-05 20:49:52 UTC
(In reply to Walter Schwarzenfeld from comment #9)
For me this patch is working too.
Comment 12 Olivier Duchateau freebsd_committer freebsd_triage 2015-10-12 11:26:50 UTC
(In reply to Walter Schwarzenfeld from comment #9)

Tested with GLib 2.46 (current stable release) with kqueue/kevent backend enabled, and it works.

Thanks!
Comment 13 commit-hook freebsd_committer freebsd_triage 2015-10-17 17:17:33 UTC
A commit references this bug:

Author: kwm
Date: Sat Oct 17 17:16:33 UTC 2015
New revision: 399544
URL: https://svnweb.freebsd.org/changeset/ports/399544

Log:
  Re-enable kqueue backend for file monitoring. But add a hack, it
  should allow programs to work properly again.

  PR:		202128

Changes:
  head/devel/glib20/Makefile
  head/devel/glib20/files/patch-gio_gunionvolumemonitor.c
Comment 14 Martin Wilke freebsd_committer freebsd_triage 2016-01-17 11:37:45 UTC
Fixed in 399544.
Comment 15 Kubilay Kocak freebsd_committer freebsd_triage 2016-01-19 07:04:51 UTC
Assign to Committer that resolved