delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/11/27/17:19:51

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: =?ISO-8859-1?Q?Ren=E9_Berber?= <r DOT berber AT computer DOT org>
Subject: Re: mmap() on 64K aligned address fails
Date: Sun, 27 Nov 2005 16:17:45 -0600
Lines: 32
Message-ID: <dmdba8$dd4$1@sea.gmane.org>
References: <dm8oki$48t$1 AT sea DOT gmane DOT org> <20051126180331 DOT GI5074 AT bouh DOT residence DOT ens-lyon DOT fr> <dmajga$8lq$1 AT sea DOT gmane DOT org> <20051126214701 DOT GW5074 AT bouh DOT residence DOT ens-lyon DOT fr> <dmaov2$nk0$1 AT sea DOT gmane DOT org> <dmavc9$5bt$1 AT sea DOT gmane DOT org> <20051127130652 DOT GT2999 AT calimero DOT vinschen DOT de>
Mime-Version: 1.0
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
In-Reply-To: <20051127130652.GT2999@calimero.vinschen.de>
OpenPGP: url=ldap://keyserver.pgp.com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Corinna Vinschen wrote:
[snip]
>>mmap(0x470000, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd,=
 0L)
>>somehow an invalid invocation.
>=20
>=20
> I didn't inspect the testcase all too closely since it's annoyingly long
> for such a simple test.  But what exactly do you expect when trying to
> mmap an arbitrary memory address in the virtual address space which you
> know nothing about?

It's not an arbitrary memory address, the 0x470000 is the result of alignin=
g a
pagesize space into 17xpagesize malloced memory.

> The code is making invalid assumptions about the
> usage of the underlying memory layout.
>=20
> Don't use MAP_FIXED unless you know what you're doing.

I'm not an expert but I think the example did comply with all the Windows
"granularity" requirements and unless I'm really missing something else it
should have worked without the invalid argument error.

Thanks for your reply.
--=20
Ren=E9 Berber


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

- Raw text -


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