Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>2019-03-26 19:38:36 +0300
committerCorinna Vinschen <corinna@vinschen.de>2019-03-28 12:09:53 +0300
commit023c107a22ebd2f540fa3f4888535aad32839fe2 (patch)
treefdbec6491255d696928b83a0ebcd2831fb608ba4 /winsup/cygwin/dcrt0.cc
parente0fd15c91b206ff788148b8dd2a37a80c8cad175 (diff)
Cygwin: fork: reserve dynloaded dll areas earlier
In dll_crt0_0, both threadinterface->Init and sigproc_init allocate windows object handles using unpredictable memory regions, which may collide with dynamically loaded dlls when they were relocated.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r--winsup/cygwin/dcrt0.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 11edcdf0d..fb726a739 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -632,6 +632,12 @@ child_info_fork::handle_fork ()
if (fixup_mmaps_after_fork (parent))
api_fatal ("recreate_mmaps_after_fork_failed");
+
+ /* We need to occupy the address space for dynamically loaded dlls
+ before we allocate any dynamic object, or we may end up with
+ error "address space needed by <dll> is already occupied"
+ for no good reason (seen with some relocated dll). */
+ dlls.reserve_space ();
}
bool