This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Semantics of fork() wrt windows heaps?
- From: Ryan Johnson <ryan dot johnson at cs dot utoronto dot ca>
- To: cygwin-developers at cygwin dot com
- Date: Tue, 26 Apr 2011 09:25:24 -0400
- Subject: Semantics of fork() wrt windows heaps?
Hi all,
Analyzing process address space layouts, I've noticed that the windows
heaps don't usually end up in the same place for the parent and child,
and some processes create and use heaps besides the default process
heap. Emacs, for example, has 9 active heaps out of the box (no .emacs
file); I suspect some of the many dlls it loads create private heaps for
themselves.
I assume (hope?) that cygwin doesn't actually use these heaps directly,
but is there still a risk that these structures could cause problems in
a child which doesn't exec()? Even if the dll never exposed
internally-allocated memory to the outside world, it seems like the
.bss/.data sections copied from the parent could easily reference some
heap which moved or no longer exists...
The same goes for other "private" memory allocations which don't belong
to any heap.
Thoughts?
Ryan