public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: paolo.zambotti@tiscali.it
To: <cygwin@cygwin.com>
Subject: fork bug in cygheap
Date: Wed, 14 Jun 2023 14:20:02 +0200	[thread overview]
Message-ID: <b7a37aeabe4ce0df6b33f55088a28150@tiscali.it> (raw)

[-- Attachment #1: Type: text/plain, Size: 1299 bytes --]

  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. 



VOUCHER CONNETTIVITÀ per P.IVA e PMI: internet a canone 0 per 48 mesi. ATTIVA ORA
 https://casa.tiscali.it/promo/?u=https://promozioni.tiscali.it/voucher_business/?r=TS00000A00025&dm=link&p=tiscali&utm_source=tiscali&utm_medium=link&utm_campaign=voucherbusiness&wt_np=tiscali.link.footermail.voucherbusiness.btb..


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

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

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=b7a37aeabe4ce0df6b33f55088a28150@tiscali.it \
    --to=paolo.zambotti@tiscali.it \
    --cc=cygwin@cygwin.com \
    /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).