From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by sourceware.org (Postfix) with ESMTPS id DD66C3858C53 for ; Wed, 14 Jun 2023 14:48:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DD66C3858C53 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-xb34.google.com with SMTP id 3f1490d57ef6-bd5f59fb71dso770165276.3 for ; Wed, 14 Jun 2023 07:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686754132; x=1689346132; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9GhAIk7zpqRda7gpsZKTVJ1CFsIYD8yu08g4f48TeNU=; b=Bzk1ETPa6yIBAYnWRDaSBBZX9SxyuCSfSMEoht1Ko7xFo8rOj2U+43GiHrF97La6D8 2qRmBa2zZVYqg9RUMNQF7xIJWu6Q3H22vWO0E6mbaXyeV03kEHmDzg2lrUufqx3j0Wqe fv0xnNKXmNSQskPy0DuGO/KO7QImBLJ3Kip5J9tgz68VRI+6q2LdOdpJ8NkSKqrXcM2l /UzirpltrUK6KqjHkggnjMJEvkpJf91UiuaE/yDNUEiQ59SJjdioJLwaGxY+kIj+N9rr sSuNDe0wwDcOevJYiSl2rrdD5+k5bNGeWsw6iO8GdFn4qx+6MkWjKYiwe1rW2LgWHqUk WCWg== 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: From: marco atzeri Date: Wed, 14 Jun 2023 16:48:41 +0200 Message-ID: Subject: Re: fork bug in cygheap To: paolo.zambotti@tiscali.it Cc: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 List-Id: On Wed, Jun 14, 2023 at 2:20=E2=80=AFPM 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 =3D allocsize > (child_proc_info->cygheap_max); > > but I think this is wrong and it should > be > > commit_size =3D 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