Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Date: Tue, 25 Feb 2003 01:16:02 -0500 From: Christopher Faylor 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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/