X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Thu, 20 Nov 2008 17:50:37 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: mmap call gives invalid argument Message-ID: <20081120165037.GA31444@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <2e7d31500811182249m6c38119cv67686eaaf2e1e5e1 AT mail DOT gmail DOT com> <20081119112813 DOT GG10351 AT calimero DOT vinschen DOT de> <2e7d31500811190656k28244d3ev89a3c6b5ffd571e7 AT mail DOT gmail DOT com> <20081119154450 DOT GJ9927 AT calimero DOT vinschen DOT de> <5E25AF06EFB9EA4A87C19BC98F5C875301EF44CC AT core-email DOT int DOT ascribe DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5E25AF06EFB9EA4A87C19BC98F5C875301EF44CC@core-email.int.ascribe.com> User-Agent: Mutt/1.5.16 (2007-06-09) 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 Nov 20 13:10, Phil Betts wrote: > Corinna Vinschen wrote on Wednesday, November 19, 2008 3:45 PM:: > > On Nov 19 22:56, Carlo Florendo wrote: > >> On Wed, Nov 19, 2008 at 7:28 PM, Corinna Vinschen wrote: > >>> On Nov 19 14:49, Carlo Florendo wrote: > > Trees removed to enable wood to be seen... :-) > >>>> Table at 0x3BEE3000. > > > 152 61108 [main] dmidecode 540 mmap64: addr 0, len 13783, prot 1, > > flags 1, fd 3, off 1005453312 ^^^^^^^^^^ > > Where does dmidecode get this offset from? The address is > > beyond the memory size available. > > off = 1005453312 = 0x3BEE0000 > len = 13783 = 0x000035D7 > > Based only on the code snippet provided, the offset is the table > address (0x3BEE3000) rounded down to the nearest page boundary > (0x3BEE0000), and len is the table length (0x5D7) plus the offset > of the table into the page (0x3000) > > I've not looked at the cygwin mmap code or the /dev/mem code, but > assuming it's close to the linux implementation I'll proceed... > [...] > So: > > Firstly, is the table address correct? Since lseek also fails, it > would suggest not. > > Secondly, the length (i.e. mmoffset+len) should be rounded up to a > multiple of the page size. Perhaps the cygwin implementation is > stricter in this regard than linux. I don't think so. The if-clause which fails in this case is basically: if (offset + length >= physical_memory_size) return EINVAL; 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/