From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 6622F3858D1E; Tue, 18 Apr 2023 08:14:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6622F3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1681805652; bh=LwsC79jjqV7ZEihNMeI8A4ZtBqbzKJdOwSKBYb5XgHc=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=OerwnYW9ur2UX9cINpqwjU8HpiM0WuTjEJPRNB4oPUI/mZzZOYX0RQd13YHThJyWJ FeJ0a+4kFCXFoZ+cCj9ZeP+QG13eaJu9A8OxBbzpvC2SRQQ6JE7ajGNPybduLOndy9 xtzGZalSm7MZwVDFT7uGQFOsMz82hQHZPMsI/32U= Received: by calimero.vinschen.de (Postfix, from userid 500) id B5D7FA808C0; Tue, 18 Apr 2023 10:14:10 +0200 (CEST) Date: Tue, 18 Apr 2023 10:14:10 +0200 From: Corinna Vinschen To: David McFarland Cc: cygwin-developers@cygwin.com Subject: Re: [PATCH] Cygwin: cygheap: fix fork error after heap has grown Message-ID: Reply-To: cygwin-developers@cygwin.com Mail-Followup-To: David McFarland , cygwin-developers@cygwin.com References: <87bkjm6nos.fsf@gmail.com> <20230418004155.56163-1-corngood@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230418004155.56163-1-corngood@gmail.com> List-Id: Hi David, On Apr 17 21:41, David McFarland wrote: > 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 > --- > winsup/cygwin/mm/cygheap.cc | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Patch pushed. Thanks, Corinna