From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9180 invoked by alias); 15 Feb 2012 20:46:09 -0000 Received: (qmail 8896 invoked by uid 22791); 15 Feb 2012 20:45:38 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Wed, 15 Feb 2012 20:45:24 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 80B3F2C006A; Wed, 15 Feb 2012 21:45:21 +0100 (CET) Date: Wed, 15 Feb 2012 20:46:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: STC for libapr1 failure Message-ID: <20120215204521.GB27454@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <4F3A14A8.4090506@acm.org> <20120214140240.GB25918@calimero.vinschen.de> <20120214144551.GC25918@calimero.vinschen.de> <4F3AA0BB.7000806@acm.org> <20120214182452.GK25918@calimero.vinschen.de> <4F3AD58A.9040106@acm.org> <20120215153851.GQ25918@calimero.vinschen.de> <4F3C09D9.6000406@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4F3C09D9.6000406@acm.org> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2012-02/txt/msg00467.txt.bz2 On Feb 15 11:39, David Rothenberger wrote: > On 2/15/2012 7:38 AM, Corinna Vinschen wrote: > > Did I mention that I hate synchronization problems? Anyway, I think I > > found the problem. I applied a patch which fixes the problem for me > > and, surprise!, the flock test still runs fine, too. I've just uploaded > > a new snapshot. Please give it a try. > > All the procmutex tests pass now! Awesome! > > But... now one of the flock tests is failing. It takes a while to > extract a STC from the APR test suite because everything is written in > APR-ese and I have to convert every APR call into the base C library > calls. I'll work on that over the next day or three. > > The gist of the test that's failing is this: > > * Create a file. > * Get an exclusive flock on it. > * Spawn a child process that attempts to get an exclusive, non-blocking > lock on the file. > > The test is expecting that the child will not be able to get the lock, > but the child is able to. Did I really mention that I hate synchronization problems? Does it fork/exec or does it only exec? If the latter, and if the child uses the file descriptor inherited from the parent, then it's ok that it gets the lock, afaics. From the Linux man page: Locks created by flock() are associated with an open file table entry. This means that duplicate file descriptors (created by, for example, fork(2) or dup(2)) refer to the same lock, and this lock may be modi‐ fied or released using any of these descriptors. Furthermore, the lock is released either by an explicit LOCK_UN operation on any of these duplicate descriptors, or when all such descriptors have been closed. [...] Locks created by flock() are preserved across an execve(2) But maybe I misunderstood something when implementig this? I guess I really need the testcase. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple