Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Date: Tue, 21 Nov 2000 17:16:53 -0800
From: "Zack Weinberg" <zackw@Stanford.EDU>
To: Kelley Cook <Kelley.Cook@home.com>,
        "GCC-Bugs@gcc.gnu.org" <GCC-Bugs@gcc.gnu.org>,
        "GCC-patches@gcc.gnu.org" <GCC-patches@gcc.gnu.org>,
        Cygwin mailing list <Cygwin@sources.redhat.com>
Subject: Re: Reason for cygwin GCC 2.97 non-bootstrap found
Message-ID: <20001121171653.I17712@wolery.stanford.edu>
References: <200011211839.eALIdOd15553@ahmlir2.mail.eds.com> <20001121162522.G17712@wolery.stanford.edu> <20001121195005.A17637@disaster.jaj.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <20001121195005.A17637@disaster.jaj.com>; from pedwards@disaster.jaj.com on Tue, Nov 21, 2000 at 07:50:05PM -0500

On Tue, Nov 21, 2000 at 07:50:05PM -0500, Phil Edwards wrote:
> On Tue, Nov 21, 2000 at 04:25:22PM -0800, Zack Weinberg wrote:
> > 
> > Could you [since Kelley is out of town till Sunday, this "you" is
> > anyone with a convenient cygwin installation] please compile and run
> > the appended test program under cygwin?  It should either exit
> > successfully, or crash; I need to know which.
> 
> With a somewhat-outdated cygwin installation, it exits successfully.

Uh oh, that means I don't understand what's going on.  Can you try
this augmented version of the test program, which probes things a bit
more thoroughly?  Now I want the output and the exit status.  [If you
know how, also try to turn on Cygwin's internal debug logging and tell
me what that reports.]

zw

#include <sys/types.h>
#include <sys/mman.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <stdio.h>
#include <errno.h>

#define PAGEPROT PROT_READ|PROT_WRITE
#define MAPFLAGS MAP_PRIVATE|MAP_ANONYMOUS

void sigsegv(int unused)
{
  _exit(0);
}

int main(void)
{
  size_t pagesize = getpagesize();
  char *base;

  errno = 0;
  base = mmap(0, 16*pagesize, PAGEPROT, MAPFLAGS, -1, 0);
  perror("mmap");

  memset(base, 0xAB, 16*pagesize);

  errno = 0;
  munmap(base + 4*pagesize, pagesize);
  perror("munmap");

  /* These should not fault.  */
  memset(base, 0xCD, 4*pagesize);
  memset(base + 5*pagesize, 0xCD, 10*pagesize);

  errno = 0;
  signal(SIGSEGV, sigsegv);
  perror("signal");

  /* This one should fault.  */
  memset(base + 4*pagesize, 0xEF, pagesize);

  /* If we get here it didn't crash.  */
  return 1;
}  

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

