delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/13/23:06:49

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <000701c0ac3b$f186b8c0$b6085b18@ne.mediaone.net>
From: "Jordan Stout" <jdstout AT mediaone DOT net>
To: <cygwin AT cygwin DOT com>
Subject: mmap example problem in NT and 2000
Date: Tue, 13 Mar 2001 23:05:01 -0500
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400

Sorry if I'm rehashing old stuff.
In trying to build xemacs,  I crashed in
the temacs step.  The following sample program
also crashes in the same way.


I'd go further but for my nubie questions...

how do I get syscall_printf to work?

how I do I make cygwin with -O0 instead of -O2 besides hacking the makefile.
(I noticed emacs debug also builds with -O2)

whenever I compile with -O0, every cygwin app crashes.

gcc --version = 2.95.2-6 if that matters.
~/mmaptest>uname -a
CYGWIN_NT-4.0 FOOBAR 1.3.0(0.36/3/2) 2001-03-13 00:38 i686 unknown

P.S. I did get emacs to build by undefineing HAS_MMAP in emacs's config.h


#include <memory.h>
main()
{
char *a;
char *b;
char *c;
char *d;

a=(char *)mmap(0,4096,3,34,-1,0);    //24930000
b=(char *)mmap(0,4096,3,34,-1,0) ;   //24931000
c=(char *)mmap(0,36864,3,34,-1,0) ;  //24932000

munmap(b,4096)              ;
d=(char *)mmap(0,73728,3,34,-1,0);   //2493b000  // footnote 1
memcpy(d,c,34768);
}

footnote 1
This call apparently succeeds even though

mmap_record::map_map (DWORD off, DWORD len)
knows something is wrong when

   if (os_being_run == winNT
              && !VirtualProtect (base_address_ + off * getpagesize (),
                           len * getpagesize (), prot, &old_prot))
                    syscall_printf ("-1 = map_map (): %E");

calls syscall_printf



--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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