From 5ec14fe40ae1a6b11d27b975feca1b20de435467 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 21 Oct 2002 01:00:58 +0000 Subject: Change _function() to function() throughout. * cygwin.din: Remove last vestiges (?) of newlib wrappers. * cygthread.cc (cygthread::detach): Always wait for event or suffer an apparently inavoidable race. * dcrt0.cc (dll_crt0_1): Allocate threads after stack has been relocated. * debub.cc (lock_debug): Don't acquire lock on exit. * fork.cc (fork_child): Recreate mmaps before doing anything else since Windows has a habit of using blocks of memory in the child that could previously have been occupied by shared memory in the parent. * mmap.cc (fhandler_disk_file::fixup_mmap_after_fork): Issue error here and provide some details about what went wrong. (fixup_mmaps_after_fork): Remove error message. * shared.cc (open_shared): Move warning message so that more detail is possible. * sigproc.cc (sigproc_init): Initialize sync_proc_subproc to avoid a race. (sigproc_terminate): Specifically wait for process thread to terminate. --- winsup/cygwin/mmap.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'winsup/cygwin/mmap.cc') diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index cb0d47647..19c8e087d 100644 --- a/winsup/cygwin/mmap.cc +++ b/winsup/cygwin/mmap.cc @@ -868,6 +868,13 @@ fhandler_disk_file::fixup_mmap_after_fork (HANDLE h, DWORD access, DWORD offset, { /* Re-create the MapViewOfFileEx call */ void *base = MapViewOfFileEx (h, access, 0, offset, size, address); + if (base != address) + { + MEMORY_BASIC_INFORMATION m; + (void) VirtualQuery (address, &m, sizeof (m)); + system_printf ("requested %p != %p mem alloc base %p, state %p, size %d, %E", + address, base, m.AllocationBase, m.State, m.RegionSize); + } return base == address; } @@ -961,11 +968,7 @@ fixup_mmaps_after_fork (HANDLE parent) rec->free_fh (fh); if (!ret) - { - system_printf ("base address fails to match requested address %p", - rec->get_address ()); - return -1; - } + return -1; if (rec->get_access () == FILE_MAP_COPY) { for (char *address = rec->get_address (); -- cgit v1.2.3