public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com, Chris Sutcliffe <ir0nh34d@gmail.com>
Subject: Re: rtorrent and recent snapshots - apparent problem with msync()
Date: Fri, 18 Jan 2013 15:44:00 -0000	[thread overview]
Message-ID: <20130118154352.GA23471@ednor.casa.cgf.cx> (raw)
In-Reply-To: <20130118093205.GB11791@calimero.vinschen.de>

On Fri, Jan 18, 2013 at 10:32:05AM +0100, Corinna Vinschen wrote:
>On Jan 17 19:35, Christopher Faylor wrote:
>> And, Corinna, please if the change I made to your function is wrong or
>> you just don't like my variable names or comments please feel free to
>> expunge what I did with extreme prejudice.
>
>Looks good to me.  I'm just wondering.  I have a similar piece of code
>in the rename function in syscalls.cc, lines 2342ff.  This loop also
>allows signals to break the loop.  Maybe we should do the same here?
>
>I just read the Linux msync man page(*) as well as the MSDN
>FlushViewOfFile man page(**).  Looks like this function is missing a
>bit of functionality.  Right now msync only calls FlushViewOfFile.
>Per MSDN this is equivalent to msync called with the MS_ASYNC flag.
>If the MS_SYNC flag is given, the function should also call FlushFileBuffers.
>I'll fix that.
>
>Also, Linux msync is allowed to return with EBUSY if "MS_INVALIDATE was
>specified in flags, and a memory lock exists for the specified address
>range."  That seems to match our situation... except that rtorrent
>doesn't use the MS_INVALIDATE flag.  Either way, maybe we should
>translate ERROR_LOCK_VIOLATION to EBUSY?
>
>(*)  http://www.kernel.org/doc/man-pages/online/pages/man2/msync.2.html
>(**) http://msdn.microsoft.com/en-us/library/windows/desktop/aa366563%28v=vs.85%29.aspx

That sounds right to me.  EACCES didn't seem like the right translation
here.

>> I can't explain what in the newer snapshots would cause a difference
>> in behavior other than the fact that they were being built with a
>> newer compiler and a revamped configure script.
>
>I tried with my gcc 4.5.3 build and I can't reproduce the problem.
>Still, it's just calls to OS functions.  There should be no compiler
>induced difference in the error values returned from OS functions.
>Except your gcc produces faster code than WIndows allows ;)

Yeah, my compiler setup is great.  Now if I could just use it to compile
my packages, I'd be very happy.  So far it only seems to work right with
Cygwin.  Other stuff, like gdb and binutils are currently problematic.

I saw that you made another change to this function.  Is it possible that
this might actually fix the "rtorrent problem"?

cgf

--
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

  reply	other threads:[~2013-01-18 15:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-17  0:31 rtorrent and recent snapshots Chris Sutcliffe
2013-01-17  6:24 ` Christopher Faylor
2013-01-17 11:55   ` Chris Sutcliffe
2013-01-17 21:42     ` Chris Sutcliffe
2013-01-18  0:35       ` rtorrent and recent snapshots - apparent problem with msync() Christopher Faylor
2013-01-18  3:05         ` Chris Sutcliffe
2013-01-18  9:32         ` Corinna Vinschen
2013-01-18 15:44           ` Christopher Faylor [this message]
2013-01-18 16:08             ` Corinna Vinschen
2013-01-18 16:12               ` Christopher Faylor
2013-01-18 20:21               ` Andrey Repin
2013-01-18 21:10                 ` Christopher Faylor
2013-01-18 21:24                   ` Christopher Faylor
2013-01-19 11:25                     ` Corinna Vinschen

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=20130118154352.GA23471@ednor.casa.cgf.cx \
    --to=cgf-use-the-mailinglist-please@cygwin.com \
    --cc=cygwin@cygwin.com \
    --cc=ir0nh34d@gmail.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).