From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: STC for libapr1 failure
Date: Wed, 15 Feb 2012 20:46:00 -0000 [thread overview]
Message-ID: <20120215204521.GB27454@calimero.vinschen.de> (raw)
In-Reply-To: <4F3C09D9.6000406@acm.org>
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
next prev parent reply other threads:[~2012-02-15 20:46 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-14 8:00 David Rothenberger
2012-02-14 8:07 ` David Rothenberger
2012-02-14 14:03 ` Corinna Vinschen
2012-02-14 14:46 ` Corinna Vinschen
2012-02-14 17:58 ` David Rothenberger
2012-02-14 18:25 ` Corinna Vinschen
2012-02-14 21:43 ` David Rothenberger
2012-02-15 15:39 ` Corinna Vinschen
2012-02-15 19:39 ` David Rothenberger
2012-02-15 20:46 ` Corinna Vinschen [this message]
2012-02-15 21:16 ` David Rothenberger
2012-02-15 21:20 ` Corinna Vinschen
2012-02-15 22:14 ` David Rothenberger
2012-02-16 14:11 ` Corinna Vinschen
2012-02-16 15:57 ` David Rothenberger
2012-02-16 16:06 ` Corinna Vinschen
2012-02-18 21:52 ` David Rothenberger
2012-02-20 14:19 ` Corinna Vinschen
2012-02-20 20:15 ` David Rothenberger
2012-02-21 1:29 ` Yaakov (Cygwin/X)
2012-02-21 8:59 ` Corinna Vinschen
2012-02-21 17:10 ` Corinna Vinschen
2012-02-23 14:20 ` Corinna Vinschen
2012-02-23 18:43 ` Achim Gratz
2012-02-24 3:49 ` Yaakov (Cygwin/X)
2012-02-24 8:15 ` Corinna Vinschen
-- strict thread matches above, loose matches on Subject: below --
2011-08-26 0:39 David Rothenberger
2011-08-26 11:16 ` Corinna Vinschen
2011-08-27 20:37 ` Corinna Vinschen
2011-08-27 22:27 ` David Rothenberger
2011-08-29 13:55 ` Corinna Vinschen
2011-08-29 17:09 ` David Rothenberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120215204521.GB27454@calimero.vinschen.de \
--to=corinna-cygwin@cygwin.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).