delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/07/12/11:48:48

X-Spam-Check-By: sourceware.org
Date: Wed, 12 Jul 2006 10:48:39 -0500
From: Brian Ford <Brian DOT Ford AT flightsafety DOT com>
Reply-To: cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
Subject: 1.5.21s mmap error
Message-ID: <Pine.CYG.4.58.0607121030410.3792@PC1163-8460-XP.flightsafety.com>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

This is just a heads up for now as I plan to try and produce an STC
with cygcheck output later today or tomorrow as time allows.  But, just in
case it rings any bells...

CYGWIN_NT-5.1 PC1163-8460-XP 1.5.21s(0.156/4/2) 20060707 11:45:39 i686
unknown unknown Cygwin

     17 [unknown (0xC08)] vital 3784 mmap_record::alloc_page_map: Warning:
VirtualProtect (addr: 0x2E230000, len: 0x18000000, new_prot: 0x4,
old_prot: 0x5321000), Win32 error 487

The application in question was trying to (code fragment):

    {
        int fd;

#ifdef MAP_ANON

        fd = -1;

#else  /* ndef MAP_ANON */

#define MAP_ANON 0

        fd = open("/dev/zero", O_RDONLY);
        if (fd < 0)
        {
            perror("open failed for /dev/zero");
            return -1;
        }

#endif /* ndef MAP_ANON */

#ifndef MAP_NORESERVE
#ifdef MAP_AUTORESRV
#define MAP_NORESERVE MAP_AUTORESRV
#else
#define MAP_NORESERVE 0
#endif
#endif

	// addr = a hint address just after a previously mmaped system
        //        chosen address
        // virtsize = 0x18000000

        addr = mmap(addr, virt_size, (PROT_READ|PROT_WRITE),
                    (MAP_NORESERVE|MAP_PRIVATE|MAP_ANON), fd, 0);
        if (addr == MAP_FAILED)
        {
            perror("mapping VM scratch space");
            close(fd);
            return -1;
        }

#ifndef MAP_ANON
        close(fd);
#endif
    }

To the application, the mmap call apeared to succeed, but when it tries to
use the space, a SIGSEGV occurs.

The same application works fine under Cygwin 1.5.18.

Thanks.

-- 
Brian Ford
Lead Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained pilot...

.


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019