From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10750 Path: news.gmane.org!.POSTED!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: Re: Robust shared mutexes? Date: Sun, 27 Nov 2016 14:51:08 +0300 (MSK) Message-ID: References: <20161126214943.GA2635@hotdamn.lan> <20161126222443.GV1555@brightrain.aerifal.cx> <20161126225104.GA2151@hotdamn.lan> <20161126225617.GW1555@brightrain.aerifal.cx> <20161126230110.GX5749@port70.net> <20161127105425.GA14788@hotdamn.lan> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1480247503 4222 195.159.176.226 (27 Nov 2016 11:51:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 27 Nov 2016 11:51:43 +0000 (UTC) User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) Cc: musl@lists.openwall.com, Szabolcs Nagy To: Sebastian Kemper Original-X-From: musl-return-10763-gllmg-musl=m.gmane.org@lists.openwall.com Sun Nov 27 12:51:39 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1cAxze-0000aV-CF for gllmg-musl@m.gmane.org; Sun, 27 Nov 2016 12:51:38 +0100 Original-Received: (qmail 19775 invoked by uid 550); 27 Nov 2016 11:51:40 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 19753 invoked from network); 27 Nov 2016 11:51:40 -0000 In-Reply-To: <20161127105425.GA14788@hotdamn.lan> Xref: news.gmane.org gmane.linux.lib.musl.general:10750 Archived-At: On Sun, 27 Nov 2016, Sebastian Kemper wrote: > I've posted the corresponding part from config.log below. It fails > because musl doesn't define PTHREAD_MUTEX_ROBUST_NP (glibc does). And > apr uses PTHREAD_MUTEX_ROBUST_NP. It means that I should set > apr_cv_mutex_robust_shared=no when cross-compiling this apr, I suppose > :) > > configure:25459: checking for robust cross-process mutex support > configure:25500: gcc -o conftest -g -O2 -DLINUX -D_REENTRANT -D_GNU_SOURCE conftest.c -lpthread >&5 > conftest.c: In function 'main': > conftest.c:197:47: error: 'PTHREAD_MUTEX_ROBUST_NP' undeclared (first use in this function) > if (pthread_mutexattr_setrobust_np(&attr, PTHREAD_MUTEX_ROBUST_NP)) This configure check is very old and predates standartization of robust mutexes in POSIX 2008: http://svn.apache.org/viewvc?view=revision&revision=382030 Consequently, APR uses _np interfaces for robust mutexes, so the their uses in locks/unix/proc_mutex.c would need to be fixed together with this configure check. But I don't understand their use of robust mutexes, in that file proc_mutex_proc_pthread_acquire just calls pthread_mutex_consistent_np without any sort of callback or indicating it to the caller via the return value. Alexander