X-Spam-Check-By: sourceware.org Date: Fri, 14 Jul 2006 11:16:01 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: 1.5.21s mmap error Message-ID: <20060714091601.GD8759@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20060712165900 DOT GQ8759 AT calimero DOT vinschen DOT de> <20060712202215 DOT GS8759 AT calimero DOT vinschen DOT de> <20060713103431 DOT GA17383 AT calimero DOT vinschen DOT de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk 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 Jul 13 13:52, Brian Ford wrote: > > On Thu, 13 Jul 2006, Corinna Vinschen wrote: > > > I added an (hopefully) appropriate patch, which commits a page within a > > > MAP_NORESERVE area when memory in this page is accessed by the > > > application. If commiting the memory fails, SIGBUS is generated. Please > > > test CVS HEAD or the next developer snapshot from > > > http://cygwin.com/snapshots/ > > > > Wow! Thanks. Given my limited Windows API knowledge, that sounded > > difficult to accomplish properly. I'll test it for you shortly. > > One problem found. If the memory is not touched before using it as a > buffer to a read call, the read returns -1 with errno set to ISDIR. STC > attached. Unfortunately the OS functions don't trigger the exception handler of the application, so the standard way of doing this doesn't work here. There's no way around that except for wrapping each and every call to an OS function manipulating application memory (here: ReadFile) with a test for ERROR_NOACCESS and trying to resolve this by looking through the list of mmaps. I'm not sure we really want to do that, certainly not for 1.5.21. If you need this sort of functionality, switch off MAP_NORESERVE. As for EISDIR, that's fixed in CVS. EACCES is returned now. 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/