From owner-svn-src-head@freebsd.org Sat Jun 25 22:33:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECA31B80C4E; Sat, 25 Jun 2016 22:33:42 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B95EE2BF3; Sat, 25 Jun 2016 22:33:42 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 0A609358C61; Sun, 26 Jun 2016 00:33:39 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id DE09428494; Sun, 26 Jun 2016 00:33:38 +0200 (CEST) Date: Sun, 26 Jun 2016 00:33:38 +0200 From: Jilles Tjoelker To: Konstantin Belousov Cc: Daniel Eischen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625223338.GA22802@stack.nl> References: <201606251130.u5PBUeGC001988@repo.freebsd.org> <20160625171440.GA19698@stack.nl> <20160625172956.GE38613@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160625172956.GE38613@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 22:33:43 -0000 On Sat, Jun 25, 2016 at 08:29:56PM +0300, Konstantin Belousov wrote: > I already asked re for approval of the reversal and got it. But I am still > hesitating doing the revert vs. returning EDEADLK for error-checking > mutexes. > My initial mistake was reading the statement about PTHREAD_MUTEX_ERRORCHECK > returning EDEADLK as the requirement for both functions. It was induced > by reading the following code in samba: > https://github.com/samba-team/samba/blob/master/lib/tdb/common/mutex.c#L928 > I did extracted this into stand-alone test and checked that glibc does > return EDEADLK in this case. BTW, if somebody has Solaris machine available > to test this, I would be grateful. Code is available at > https://www.kib.kiev.ua/kib/pshared/pthread_samba.c > I.e., plain revert would disable the only known to me consumer of the > robust mutexes. The patch which I mailed last time, returns EDEADLK for > trylock on ERRORCHECKed mutexes only. And I am tending toward glibc > compatibility there, over the literal POSIX compliance, but I want to > see the confirmation from the Klimenko' test first. To be bug-compatible with glibc, you'd need to return the wrong [EDEADLK] error for robust errorcheck mutexes only. Robust non-errorcheck and non-robust errorcheck mutexes return the correct [EBUSY]. I have not checked PI and PP mutexes which probably use a different code path. I'm not sure whether we should copy glibc's bug, but if we do it must be documented in the man page. I'm not happy with it because the bug may break applications written to the standard; at least, Samba developers should be contacted first. -- Jilles Tjoelker