From owner-freebsd-hackers@freebsd.org Mon Nov 21 13:50:43 2016 Return-Path: Delivered-To: freebsd-hackers@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 620DBC4C4A8 for ; Mon, 21 Nov 2016 13:50:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E78F5911 for ; Mon, 21 Nov 2016 13:50:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id uALDoaNc062398 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 21 Nov 2016 15:50:37 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uALDoaNc062398 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id uALDoaMY062397; Mon, 21 Nov 2016 15:50:36 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 21 Nov 2016 15:50:36 +0200 From: Konstantin Belousov To: Volker Lendecke Cc: freebsd-hackers@freebsd.org Subject: Re: process shared mutexes? Message-ID: <20161121135036.GY54029@kib.kiev.ua> References: <20161121133528.GA30947@sernet.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161121133528.GA30947@sernet.de> User-Agent: Mutt/1.7.1 (2016-10-04) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2016 13:50:43 -0000 On Mon, Nov 21, 2016 at 02:35:28PM +0100, Volker Lendecke wrote: > Hello! > > For Samba's tdb I'm trying to get process shared robust mutexes to > work. However, tdb has a usage pattern that seems to confuse FreeBSD > 11 (32-bit x86 if that matters). > > The attached program fails in the final pthread_mutex_lock call. If I > comment out the call to > > ptr = mmap(NULL, 0xb0, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0x1000); > > it works. > > FWIW, tdb uses robust shared mutexes on Linux successfully for a while > now. I haven't tried Solaris yet, the only other platform I know about > that has them. > > What am I doing wrong? > > Thanks, > There is no attached program, please mail it either inline or put it somewhere on web.