[PATCH] Fixed CYGWIN_GUARD

Thomas Pfaff tpfaff@gmx.net
Thu Aug 15 13:00:00 GMT 2002


The CYGWIN_GUARD define in dcrt0.cc does not work on WIN98 where
PAGE_GUARD is not available.

Normally this does not occur but i ran into this when i forked in a thread
other than the man thread. I got:

T:\FORK\FORK.EXE: *** fork: couldn't allocate new stack guard page
0x112ADFFF, Win32 error 87
   1334 [unknown (0xFFFA6E1F)] fork 388757 sync_with_child: child
-186165(0x11C) died before initialization with status code 0x1
   1609 [unknown (0xFFFA6E1F)] fork 388757 sync_with_child: *** child
state waiting for longjmp

with this test program:

#include <pthread.h>

static void * TestThread( void * );

int main(void)
{
  pthread_t t;

  pthread_create(&t, NULL, TestThread, NULL);
  pthread_join(t, NULL);

  return 0;
}

static void * TestThread( void *not_used )
{
  switch (fork())
    {
    case -1:
      return NULL;
    case 0:
      break;
    default:
      wait (NULL);
    }

  return NULL;
}

I have attached a small patch.


2002-08-15  Thomas Pfaff  <tpfaff@gmx.net>

	* dcrt0.cc: Modified define for CYGWIN_GUARD
	(alloc_stack_hard_way): Fixed arguments for VirtualAlloc call.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CYGWIN_GUARD.patch
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20020815/94bd3f02/attachment.ksh>


More information about the Cygwin-patches mailing list