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 667230 - gamin server deadlock (PATCH)
gamin server deadlock (PATCH)
Status: RESOLVED FIXED
Product: gamin
Classification: Other
Component: general
0.1.x
Other Linux
: Normal normal
: ---
Assigned To: Gamin Maintainer(s)
Gamin Maintainer(s)
: 669292 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-01-03 22:50 UTC by Anssi Hannula
Modified: 2017-04-25 14:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix possible server deadlock in ih_sub_cancel (2.04 KB, patch)
2012-01-03 22:50 UTC, Anssi Hannula
committed Details | Review

Description Anssi Hannula 2012-01-03 22:50:00 UTC
Created attachment 204537 [details] [review]
fix possible server deadlock in ih_sub_cancel

Lately I've been getting deadlocks in gam_server once every few days or so, causing e.g. KDE applications to no longer start (similar to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=542361).

Looking at the code, ih_sub_cancel tries to lock a GMutex recursively, which causes undefined behavior. Attached patch should fix it.

I'm currently glib 2.31.6 and glibc 2.14.1, on x86_64.
Below is more information about the deadlock.

The gamin server deadlocks at:

Thread 1 (Thread 0x7f7b1b41b700 (LWP 23947))

  • #0 __lll_lock_wait
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S line 136
  • #1 _L_lock_915
    from /lib64/libpthread.so.0
  • #2 __pthread_mutex_lock
    at pthread_mutex_lock.c line 101
  • #3 g_mutex_lock
    at gthread-posix.c line 211
  • #4 ih_sub_cancel
    at inotify-helper.c line 130
  • #5 ih_sub_foreach_worker
    at inotify-helper.c line 162
  • #6 gam_inotify_remove_subscription
    at gam_inotify.c line 185
  • #7 gam_connection_request
    at gam_connection.c line 400
  • #8 gam_connection_data
    at gam_connection.c line 509
  • #9 gam_client_conn_read
    at gam_channel.c line 283
  • #10 g_main_dispatch
    at gmain.c line 2513
  • #11 g_main_context_dispatch
    at gmain.c line 3050
  • #12 g_main_context_iterate
    at gmain.c line 3121
  • #13 g_main_context_iterate
    at gmain.c line 3058
  • #14 g_main_loop_run
    at gmain.c line 3315
  • #15 main
    at gam_server.c line 647

The gamin client will hang at:
connect(10, {sa_family=AF_FILE, path=@"/tmp/fam-anssi-"}, 110
Comment 1 Tomas Bzatek 2012-04-11 11:48:10 UTC
Right, this patch looks to be more complete than the one from bug 669292. Fine from my side, would be good to talk to gamin maintainer before committing.
Comment 2 Pacho Ramos 2012-06-11 18:43:29 UTC
This looks to be still valid and other users downstream on Gentoo has reported the upstream works for them, could it be committed please? 

Thanks a lot
Comment 3 Daniel Elstner 2014-11-04 15:37:13 UTC
Ping? It appears that this longstanding bug is still in need of fixing, and there is a simple patch which reportedly fixes the problem.

I think if the maintainer is AWOL it's OK to just commit this. I would do it myself if nobody objects.

Of course, to get this downstream we would also need a new release.
Comment 4 Daniel Elstner 2014-11-04 15:49:35 UTC
*** Bug 669292 has been marked as a duplicate of this bug. ***
Comment 5 Andreas Hartmetz 2016-01-31 13:54:37 UTC
Ping
Comment 6 Olav Vitters 2016-02-09 08:52:56 UTC
Just commit.
Comment 7 Olav Vitters 2016-02-09 22:49:20 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.
Comment 8 Germano Massullo 2017-01-31 10:08:03 UTC
(In reply to Olav Vitters from comment #7)
> This problem has been fixed in the unstable development version. The fix
> will be available in the next major software release. You may need to
> upgrade your Linux distribution to obtain that newer version.

When the next major release will be released? I am experiencing KDE Plasma application freezes on Fedora 25 with

gamin-0.1.10-23.fc25.x86_64
gamin-0.1.10-23.fc25.i686

=====================
gam_server backtrace
=====================


=================
Amarok backtrace
=================

See https://bugs.kde.org/show_bug.cgi?id=375301
Comment 9 Rex Dieter 2017-01-31 17:55:24 UTC
Fedora's gamin packaging includes the commit referenced to fix this bug, yet users are still experiencing deadlocks.  open a new bug?
Comment 10 Germano Massullo 2017-01-31 18:10:13 UTC
(In reply to Rex Dieter from comment #9)
> Fedora's gamin packaging includes the commit referenced to fix this bug, yet
> users are still experiencing deadlocks.  open a new bug?

Done
https://bugzilla.gnome.org/show_bug.cgi?id=777997
Comment 11 Germano Massullo 2017-04-25 14:34:07 UTC
gam_server freezeing Dolphin
https://bugs.kde.org/show_bug.cgi?id=379196