delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/11/21/20:31:31

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
Date: Tue, 21 Nov 2000 17:16:53 -0800
From: "Zack Weinberg" <zackw AT Stanford DOT EDU>
To: Kelley Cook <Kelley DOT Cook AT home DOT com>,
"GCC-Bugs AT gcc DOT gnu DOT org" <GCC-Bugs AT gcc DOT gnu DOT org>,
"GCC-patches AT gcc DOT gnu DOT org" <GCC-patches AT gcc DOT gnu DOT org>,
Cygwin mailing list <Cygwin AT sources DOT redhat DOT com>
Subject: Re: Reason for cygwin GCC 2.97 non-bootstrap found
Message-ID: <20001121171653.I17712@wolery.stanford.edu>
References: <200011211839 DOT eALIdOd15553 AT ahmlir2 DOT mail DOT eds DOT com> <20001121162522 DOT G17712 AT wolery DOT stanford DOT edu> <20001121195005 DOT A17637 AT disaster DOT jaj DOT com>
Mime-Version: 1.0
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 AT sourceware DOT cygnus DOT com

- Raw text -


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