Hi!

thanks for your bug report.

I have uploaded a patched version to collab-maint repository (current
version is not ready to publish):

http://anonscm.debian.org/cgit/collab-maint/gftp.git/

This problem is caused by a new call to abort() within code of releasing
glib mutex[1]. Other Debian bugs with similar issues have also been open
(#763575, #763625, #763787, #758619)

The attached patch is a workaround based on the fact that
g_main_context_iteration() leaves the lock released after called, so any
further call to GDK_THREADS_LEAVE() will make gftp to fail. Patch adds a
GDK_THREADS_ENTER() call after each g_main_context_iteration().

I have not seen a better solution. Please, let me know if you guys have
a better one.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=731986
Author: Cleto Martin <cl...@debian.org>
Description: After GLIB > 2.41, abort() is called if a mutex is
 released two times in a row from a single thread. After code
 analysis, I have seen that g_main_context_iteration() leaves the lock
 released so after it is called a GDK_THREADS_LEAVE() is executed,
 making gFTP abort. This patch adds a GDK_THREADS_ENTER() call after
 each g_main_context_iteration().

Index: gftp/src/gtk/gtkui.c
===================================================================
--- gftp.orig/src/gtk/gtkui.c
+++ gftp/src/gtk/gtkui.c
@@ -132,6 +132,7 @@ gftpui_prompt_username (void *uidata, gf
 #else
       g_main_context_iteration (NULL, TRUE);
 #endif
+      GDK_THREADS_ENTER ();
     }
 }
 
@@ -154,6 +155,7 @@ gftpui_prompt_password (void *uidata, gf
 #else
       g_main_context_iteration (NULL, TRUE);
 #endif
+      GDK_THREADS_ENTER ();
     }
 }
 
@@ -254,6 +256,7 @@ gftpui_generic_thread (void * (*func) (v
 #else
       g_main_context_iteration (NULL, TRUE);
 #endif
+      GDK_THREADS_ENTER ();
     }
 
   _gftpui_teardown_wakeup_main_thread (cdata->request, handler);
@@ -540,6 +543,7 @@ gftpui_protocol_ask_yes_no (gftp_request
 #else
           g_main_context_iteration (NULL, TRUE);
 #endif
+          GDK_THREADS_ENTER ();
         }
     }
 
@@ -596,6 +600,7 @@ gftpui_protocol_ask_user_input (gftp_req
 #else
           g_main_context_iteration (NULL, TRUE);
 #endif
+          GDK_THREADS_ENTER ();
         }
     }
 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to