Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Mon, 24 Feb 2003 21:28:07 -0500
From: Christopher Faylor <cgf-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: 1.3.20: mmap with nonzero file offset results in seg fault (Win2k )"
Message-ID: <20030225022807.GD24688@redhat.com>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <754324CDE8E4EE4498D8E0357D913685D4D16A@saab-bt.act.cmis.CSIRO.AU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <754324CDE8E4EE4498D8E0357D913685D4D16A@saab-bt.act.cmis.CSIRO.AU>
User-Agent: Mutt/1.5.1i

On Tue, Feb 25, 2003 at 12:49:45PM +1100, brett.matson@csiro.au wrote:
>
>Accessing the mapped region of memory after an mmap call 
>with a non-zero offset results in a seg fault. A zero 
>offset will not result in a seg fault.
>
>Cygwin1.dll version 1.3.19 doesn't experience this problem.  
>Cygcheck output is attached.
>
>Example:
>
>if (rslt = mmap(0, size, prot, MAP_SHARED,  fd, offset)) 
>    == MAP_FAILED) {
>} else {
>    printf("%d", rslt[0]); // seg fault
>}
>AND
>if (rslt = mmap(0, size, prot, MAP_SHARED,  fd, 0)) 
>    == MAP_FAILED) {
>} else {
>    printf("%d", rslt[0]); // no seg fault (zero offset)
>}

The above is bogus code since rslt will be equal to either 1 or 0
depending on whether mmap failed or not.

Please provide a real working test case which can be cut, pasted,
compiled, linked, and run, if you want help.  The theory is that,
if you want help, you reduce the barrier of providing the help as
much as possible.  Providing buggy examples isn't going to do that.

cgf
--
Please use the resources at cygwin.com rather than sending personal email.
Special for spam email harvesters: send email to aaaspam@sourceware.org
and be permanently blocked from mailing lists at sources.redhat.com

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

