Re: NT 4.0 fixup_mmaps_after_fork() patch

2003-01-16 Thread Corinna Vinschen
On Wed, Jan 15, 2003 at 02:19:19PM -0500, Jason Tishler wrote:
 It appears that ReadProcessMemory() can fail with ERROR_NOACCESS under
 NT 4.0.  See attached patch.

Applied.  Thanks!

 BTW, my mmap-test test case works under NT 4.0 without this patch.
 However, vsFTPd does not.  Go figure!

Details?

Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Developermailto:[EMAIL PROTECTED]
Red Hat, Inc.



Re: NT 4.0 fixup_mmaps_after_fork() patch

2003-01-16 Thread Jason Tishler
Corinna,

On Thu, Jan 16, 2003 at 03:11:35PM +0100, Corinna Vinschen wrote:
 On Wed, Jan 15, 2003 at 02:19:19PM -0500, Jason Tishler wrote:
  It appears that ReadProcessMemory() can fail with ERROR_NOACCESS
  under NT 4.0.  See attached patch.
 
 Applied.  Thanks!

You are welcome.

  BTW, my mmap-test test case works under NT 4.0 without this patch.
  However, vsFTPd does not.  Go figure!
 
 Details?

Um... Er... Cockpit error.  I still had the mprotect() calls commented
out.

Thanks,
Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6



NT 4.0 fixup_mmaps_after_fork() patch

2003-01-15 Thread Jason Tishler
It appears that ReadProcessMemory() can fail with ERROR_NOACCESS under
NT 4.0.  See attached patch.

BTW, my mmap-test test case works under NT 4.0 without this patch.
However, vsFTPd does not.  Go figure!

Thanks,
Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Index: mmap.cc
===
RCS file: /cvs/src/src/winsup/cygwin/mmap.cc,v
retrieving revision 1.68
diff -u -p -r1.68 mmap.cc
--- mmap.cc 15 Jan 2003 10:21:23 -  1.68
+++ mmap.cc 15 Jan 2003 18:51:30 -
@@ -986,9 +986,11 @@ fixup_mmaps_after_fork (HANDLE parent)
   getpagesize (), NULL))
  {
DWORD old_prot;
+   DWORD last_error = GetLastError ();
 
-   if (GetLastError () != ERROR_PARTIAL_COPY ||
-   !wincap.virtual_protect_works_on_shared_pages ())
+   if (last_error != ERROR_PARTIAL_COPY
+last_error != ERROR_NOACCESS
+   || !wincap.virtual_protect_works_on_shared_pages ())
  {
system_printf (ReadProcessMemory failed for 
   MAP_PRIVATE address %p, %E,

2003-01-15  Jason Tishler  [EMAIL PROTECTED]

* mmap.cc (fixup_mmaps_after_fork): Add ERROR_NOACCESS to the list of
ReadProcessMemory() error codes that trigger a retry with temporary
PAGE_READONLY access.  Note that this can occur on NT 4.0.