X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF26C38582B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1686754148; bh=T0nU/7ZTRnZIT0Js61oA0GZJdDiKe784xLCA8JiCp4s=; h=References:In-Reply-To:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=keDlHkTZTnvpz6YelweWuXRUlb/tx+9SYYMXS4ZI8BoagN2SLN+tZLylaoFwaVeMQ UM1Y2LD3aqWMEatSxO0+bJv4w2TIgMPgCL8t/8/YaZjITiXICHmLDqcqsM7T9SeOh/ ImC2pPPDcK0bhHnMwTtfPBZu0DvjwW6nImF7/YkM= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DD66C3858C53 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686754132; x=1689346132; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9GhAIk7zpqRda7gpsZKTVJ1CFsIYD8yu08g4f48TeNU=; b=iYcWm1CTd0J+RSmaJmRxkXVO46ahQkkspFTYMj8wDFvVyr3bBHRZ1lT4Pxh4YAX7n2 Xbc9WSWOzifncdDFyPIgew9UlE+po1Wm6OBic9H19EyYNAAfg3/L4+L/bAjlHfXLt99J 8sVtOJC5DN46ImQHR+a9p9dgM8azlJjBn3s72FwG5/L2OZV+2bJeZOxjk6KZIc+OIc6M ceaZud6JatKD4O7Aw/WOaf+w2HJ8UZvbyuNLgnw7eyMbN2qDfAbD+pKTwc+hzF7TFXov WRVWQOvEqa+dH3HlsKXXW4vi8jYkhQav9YuNuRTqwVMXsJp+7rkJU+UYtclcdhJXRPB9 CHpw== X-Gm-Message-State: AC+VfDzjaU8Q0JCAIT087roIqwmmJUEyk5lW1jqVhierdK/t+Ef0eFly 8UsPR0izTqw2Mo2rhhGQYYR9gXNNNQKm59SYoDU= X-Google-Smtp-Source: ACHHUZ4bs5urZB51+yYQo54eQAqAfoB1GMhVcPRDf4JDrcGfIKvoWZQMYk0jEvSs47BiT9ApmcqnaJMX4cVL0LEchiI= X-Received: by 2002:a0d:cbc4:0:b0:55a:5ce4:aff2 with SMTP id n187-20020a0dcbc4000000b0055a5ce4aff2mr1761455ywd.39.1686754132227; Wed, 14 Jun 2023 07:48:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 14 Jun 2023 16:48:41 +0200 Message-ID: Subject: Re: fork bug in cygheap To: paolo DOT zambotti AT tiscali DOT it Cc: cygwin AT cygwin DOT com X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: marco atzeri via Cygwin Reply-To: marco atzeri Content-Type: text/plain; charset="utf-8" Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 35EEnX9p003199 On Wed, Jun 14, 2023 at 2:20 PM Paolo via Cygwin wrote: > > Hi all, > > I just found a bug (I think) in cygheap_fixup_in_child > function (cygheap.cc). > the effect is that, sometimes a command from a > script ends with the following error message > > 0 [main] openssl (17784) > child_copy: cygheap read copy failed, 0x0..0x8003D8538, done 0, windows > pid 17784, Win32 error 299 > > Digging a little bit in the code I found > that commit_size in cygheap_fixup_in_child is wrongly calculated if the > condition (child_proc_info->cygheap_max > (void *) > CYGHEAP_STORAGE_INITIAL) is met. > > Currently, in that case, its value is > evaluated as > > commit_size = allocsize > (child_proc_info->cygheap_max); > > but I think this is wrong and it should > be > > commit_size = allocsize (child_proc_info->cygheap_max) - > CYGHEAP_STORAGE_LOW; > > The wrong value avoids the successful execution of > the following second VirtualAlloc and the the error in child_copy > function. > > I tried to recompile the cygwin dll with the above change and > indeed the error disappears. > > I'm I correct? > Paolo. > it looks like https://cygwin.com/pipermail/cygwin-developers/2023-April/012620.html -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple