From owner-freebsd-threads@FreeBSD.ORG Wed Jul 24 10:53:44 2013 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 95EE4C6B; Wed, 24 Jul 2013 10:53:44 +0000 (UTC) (envelope-from kwm@rainbow-runner.nl) Received: from fep18.mx.upcmail.net (fep18.mx.upcmail.net [62.179.121.38]) by mx1.freebsd.org (Postfix) with ESMTP id 94C222952; Wed, 24 Jul 2013 10:53:43 +0000 (UTC) Received: from edge01.upcmail.net ([192.168.13.236]) by viefep18-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20130724105336.MIYO26154.viefep18-int.chello.at@edge01.upcmail.net>; Wed, 24 Jul 2013 12:53:36 +0200 Received: from crashalot.rainbow-runner.nl ([178.84.132.32]) by edge01.upcmail.net with edge id 4Atb1m00Q0i5fp601Atbvn; Wed, 24 Jul 2013 12:53:36 +0200 X-SourceIP: 178.84.132.32 Message-ID: <51EFB228.20907@rainbow-runner.nl> Date: Wed, 24 Jul 2013 12:53:28 +0200 From: Koop Mast User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130630 Thunderbird/17.0.7 MIME-Version: 1.0 To: Joe Marcus Clarke Subject: Re: Mutexes and error checking References: <51E71D4F.5030502@marcuscom.com> <51E8061B.60906@marcuscom.com> <51EB5EC4.6050802@marcuscom.com> <20130721160220.GA38417@stack.nl> <51EC0BCF.6080501@FreeBSD.org> <51EC49F8.6070207@marcuscom.com> <201307231543.r6NFhS7n007384@higson.cam.lispworks.com> <51EEACC9.8000406@marcuscom.com> In-Reply-To: <51EEACC9.8000406@marcuscom.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: deischen@freebsd.org, avg@freebsd.org, freebsd-threads@freebsd.org X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 10:53:44 -0000 On 07/23/13 18:18, Joe Marcus Clarke wrote: > On 7/23/13 11:43 AM, Martin Simmons wrote: >>>>>>> On Sun, 21 Jul 2013 16:52:08 -0400, Joe Marcus Clarke said: >>> The specifics are this. There are some GNOME/GTK+/GLib apps that are >>> crashing now that GLib checks the return of pthread_mutex_unlock() in >>> g_mutex_unlock(). While we can workaround this in GLib by simply >>> nop'ing the EPERM return, we'd like to pursue something that may be a >>> bit more manageable for those apps written for Linux that do not use GLib. >> Which apps are broken and why can't they be fixed? > Koop, do you have a complete list? The one that was reported to me was > sonata (a Python app). I have not yet traced down the offending code as > I was curious why Linux was not failing, and this appears to be why. > > Joe I only am aware of audio/sonata currently. I can remember seeing a similar error once or twice before. So while looking for more failures like the one in sonata, I ran into a fix for sonata in the OpenBSD ports [1]. . I also found the same solution was fixed in lxpanel [2]. The fix is to use the |GDK| mutual exclusion lock to prevent more then one thread being active [3]. With this I can fix the few ports that exhibit this problem and we don't have to change anything in base. -Koop [1] http://www.openbsd.org/cgi-bin/cvsweb/ports/audio/sonata/patches/patch-sonata_main_py?rev=1.5;content-type=text%2Fplain [2] https://github.com/hsgg/lxpanel/commit/75f5e575e692818869cb3d7fded6f42c735f6954 [3] http://www.pygtk.org/docs/pygtk/gdk-functions.html#function-gdk--threads-enter >> >>> Again, I'm not arguing the voracity of the 3rd party app code, just the >>> discrepancy between Linux and Solaris compared to FreeBSD. >> Note that unlocking an unlocked normal mutex on Linux (glibc) does *not* work, >> but leaves it in a subtly inconsistent state. Therefore bugs like the one you >> reported to the GNOME Bugzilla >> (https://bugzilla.gnome.org/show_bug.cgi?id=678758) should be fixed, not >> ignored by hiding the error status. >> >> __Martin >> >