delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/02/25/01:16:05

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Date: Tue, 25 Feb 2003 01:16:02 -0500
From: Christopher Faylor <cgf-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: 1.3.20: mmap with nonzero file offset results in seg fault (W in2k )"
Message-ID: <20030225061602.GA29714@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <754324CDE8E4EE4498D8E0357D913685D4D16B AT saab-bt DOT act DOT cmis DOT CSIRO DOT AU>
Mime-Version: 1.0
In-Reply-To: <754324CDE8E4EE4498D8E0357D913685D4D16B@saab-bt.act.cmis.CSIRO.AU>
User-Agent: Mutt/1.5.1i

On Tue, Feb 25, 2003 at 04:51:33PM +1100, brett DOT matson AT csiro DOT au wrote:
>Christopher, a few points about your comments:
>
>1. I wasn't asking for help. This bug report wasn't for 
>   our benefit. We're content to use version 1.3.19.

You really should try B20 if you want the absolute best cygwin out there.

>2. Next time, read the man page:
>
>   "The actual place where the object is mapped is 
>    returned by mmap, and is never 0." - mmap man page

I am quite familiar with mmap.  No inspection of the man page was needed
to determine that there was an obvious problem with your example.

Hmm.  Now that I look at it again, I will admit that I was wrong in my
analysis.  Your code snippet wouldn't have compiled.  I should have
assumed that you were missing an opening parentheses in the below.  If
your further bug report is true, this wouldn't have done me any good but
it does mean that I had wrongly interpreted your code to assume that
rslt would be set to a boolean value rather than the output of mmap.

You had:
if (rslt = mmap(0, size, prot, MAP_SHARED,  fd, offset)) == MAP_FAILED)

I misread it as:
if (rslt = mmap(0, size, prot, MAP_SHARED,  fd, offset) == MAP_FAILED)

It should be:
if ((rslt = mmap(0, size, prot, MAP_SHARED,  fd, offset)) == MAP_FAILED)

>The seg fault only occurs in version 1.3.20.  The TEST_FILE macro needs
>to be set to the name of a file that is larger than 16 system pages +
>32 bytes.

Although you've taken great offense at the suggestion that a real test
case was required, you seem to have provided something that we can now
use to fix cygwin.  Thank you for the test case and analysis.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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