]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: cygheap: fix fork error after heap has grown
authorDavid McFarland <corngood@gmail.com>
Tue, 18 Apr 2023 00:41:55 +0000 (21:41 -0300)
committerCorinna Vinschen <corinna@vinschen.de>
Tue, 18 Apr 2023 08:12:43 +0000 (10:12 +0200)
commit6fbca24f33c2430b51c5413a7b4c85f4784b4d4c
tree9ae31967a8be1414385914b150ed42f7eb5d0fde
parent595fcb21ffc01b3469dad6484c11ebfd263d7f3c
Cygwin: cygheap: fix fork error after heap has grown

2f9b8ff0 introduced a problem where forks would sometimes fail with:

child_copy: cygheap read copy failed, 0x0..0x80044C750, done 0, windows pid 14032, Win32 error 299

When cygheap_max was > CYGHEAP_STORAGE_INITIAL, commit_size would be set to
allocsize(cygheap_max), which is an address, not a size.  VirtualAlloc would be
called to commit commit_size bytes, which would fail, and then child_copy would
be called with zero as the base address.

Fixes: 2f9b8ff00cce ("Cygwin: decouple cygheap from Cygwin DLL")
Signed-off-by: David McFarland <corngood@gmail.com>
winsup/cygwin/mm/cygheap.cc
This page took 0.028772 seconds and 5 git commands to generate.