This is the mail archive of the cygwin-patches@cygwin.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]
Other format: [Raw text]

[PATCH] Fixed CYGWIN_GUARD


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.

Attachment: CYGWIN_GUARD.patch
Description: Text document


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