delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/12/18/13:37:10

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 4BIIbAft556226
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 4BIIbAft556226
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=AJmOgMJa
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF4E63858D20
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1734547028;
bh=BxQI74azrkyprfe34MboZI2CRmylugxcwBdB3jBB6B4=;
h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=AJmOgMJadbQoATxpoB4HFWt12itaht89eoxx7lLwR7mqXVr2JzUa9I1Jkw30SdDjn
Jp5Px6R4jPCR0+i3JATLDQe1U+MjxeAD4eTGcYtww4jSKwUR04ZEozikwENAA5yssw
URWigBKNJYB891fOcZFxLqdNEP6BeC3HYHcDbkm4=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FA5F3858D20
Date: Wed, 18 Dec 2024 19:35:43 +0100
To: cygwin AT cygwin DOT com
Subject: Re: Atomic mmap replacement
Message-ID: <Z2MV__BG-IdmtGvc@calimero.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20180219090042 DOT GC3417 AT calimero DOT vinschen DOT de>
<e6b3bd42-f981-405e-b65b-529693598735 AT cornell DOT edu>
<d84f7f6c-5527-4f39-83a5-1aa16d8e451f AT cornell DOT edu>
<Z2AsCg7Oo4FyHFjG AT calimero DOT vinschen DOT de>
<b7564609-6a87-4691-b5ec-1f56b51543df AT cornell DOT edu>
<bb796c13-c2b7-48a0-899b-cc7485fee783 AT cornell DOT edu>
<Z2GpCxIUDMqp6yen AT calimero DOT vinschen DOT de>
<cbeac0c9-70a1-4be9-acbb-eceadfde2e1e AT cornell DOT edu>
<Z2LcCIToHJ8Xc0VV AT calimero DOT vinschen DOT de>
<b060fb24-ba47-45f6-95b1-cad18aa01df6 AT cornell DOT edu>
MIME-Version: 1.0
In-Reply-To: <b060fb24-ba47-45f6-95b1-cad18aa01df6@cornell.edu>
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

On Dec 18 10:45, Ken Brown via Cygwin wrote:
> On 12/18/2024 9:28 AM, Corinna Vinschen via Cygwin wrote:
> > Hi Ken,
> > 
> > On Dec 17 15:23, Ken Brown via Cygwin wrote:
> > > Hi Corinna,
> > > 
> > > On 12/17/2024 11:38 AM, Corinna Vinschen via Cygwin wrote:
> > > > Ideally a separate patch.  If you see a chance to send it to cygwin-patches
> > > > this week, we can even merge it into 3.5.5, which I'm planning to release
> > > > end of this week (after that --> vacation :)))
> > > That should be no problem.  By the way, I think I found a second bug.
> > > Shouldn't mmap:649 be
> > > 
> > > (*)  if (u_addr > (caddr_t) addr || u_len < len
> > > 
> > > instead of
> > > 
> > > (**)  if (u_addr > (caddr_t) addr || u_addr + len < (caddr_t) addr + len
> > > 
> > > ?
> > > 
> > > If the first condition in (**) fails, then u_addr == addr, so the second
> > > condition is automatically false.  But what we want to be testing at this
> > > point is whether the matched region is big enough, as in (*).  Or am I
> > > confused?
> > 
> > u_addr could be < addr.  We have two areas, the free area in u_addr and
> > u_len, and the requested area in addr and len.
> > 
> > So we have to check that addr is >= u_addr and addr + len is <= u_len:
> > 
> >    |----------------------------------------------------|
> >   u_addr                                           u_addr + u_len
> > 
> >             |--------------------|
> >            addr             addr + len
> > 
> > Make sense?
> No, I'm still confused.  I thought that the interval determined by u_addr
> and u_len was the intersection of the requested interval and the whole
> interval of the mmap_record; this implies u_addr >= addr.  Back in the
> definition of mmap_record::match, we set low = max (addr, get_address ()),
> and then on success we set m_addr = low.  Doesn't that imply m_addr >= addr?
> Sorry if I'm just being dense.

Apologies, I didn't check mmap_record::match().  You're right of course.
So, yeah, just go ahead.


Thanks,
Corinna

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019