This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Reason for cygwin GCC 2.97 non-bootstrap found


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]