X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Mon, 20 Apr 2009 17:34:42 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: [1.7] flock change breaks autotools 'make -j2' Message-ID: <20090420153442.GB8722@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20090417100148 DOT GD5200 AT calimero DOT vinschen DOT de> <49E87CFA DOT 9070709 AT byu DOT net> <20090417133103 DOT GG8722 AT calimero DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-02-20) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Apr 20 15:14, Eric Blake wrote: > Corinna Vinschen cygwin.com> writes: > > > > > I'd prefer a testcase in C. > > > > > > So would I. I'm not even sure whether perl was using flock or > > > lockf/fcntl. Do you still need me to try and write a STC, or at least > > > test how perl behaves with your first patch? > > > > I checked in a patch which hopefully solves both problems. The lock.pl > > testcase now works, at least. Can you test if the original scenario > > works now as well? If not, I'd really need another testcase. > > Nope; with snapshot 20090418 I'm still seeing the 'make -j2' failures. I'll Too bad. > see if I can come up with a C program that can be run as two processes to > simulate the failure as a simpler test case. I did verify via strace that perl > is using flock(fd, LOCK_EX). Yes, I saw this already while debugging the lock.pl testcase. Whatever it is, it must be more complicated than this: #include #include int main () { int fd = open ("flock.c", O_RDWR); if (fd >= 0) { printf ("About to call flock\n"); if (!flock (fd, LOCK_EX)) { printf ("flock succeeded. Waiting...\n"); getchar (); close (fd); } else perror ("flock"); } return 0; } Because this testcase works fine. I hope it's not trying to do this: parent opens file fork child calls flock() exit fork second child relies on the lock. because this is exactly the scenario which doesn't work with flock right now. I have it on my TODO list, but so far I'm at a loss as to how to implement it. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/