public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: marco atzeri <marco.atzeri@gmail.com>
To: paolo.zambotti@tiscali.it
Cc: cygwin@cygwin.com
Subject: Re: fork bug in cygheap
Date: Wed, 14 Jun 2023 16:48:41 +0200	[thread overview]
Message-ID: <CAB8Xom8c6V5cc-54a5tjxxGaR-CO4nTCs23yo3KkUPWTJrO8sg@mail.gmail.com> (raw)
In-Reply-To: <b7a37aeabe4ce0df6b33f55088a28150@tiscali.it>

On Wed, Jun 14, 2023 at 2:20 PM Paolo via Cygwin <cygwin@cygwin.com> 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

      reply	other threads:[~2023-06-14 14:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14 12:20 paolo.zambotti
2023-06-14 14:48 ` marco atzeri [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAB8Xom8c6V5cc-54a5tjxxGaR-CO4nTCs23yo3KkUPWTJrO8sg@mail.gmail.com \
    --to=marco.atzeri@gmail.com \
    --cc=cygwin@cygwin.com \
    --cc=paolo.zambotti@tiscali.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).