git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 3/4] mingw: spawned processes need to inherit only standard handles
Date: Fri, 29 Nov 2019 23:37:17 +0100
Message-ID: <653e0604-3fd0-235d-564e-8f8a5900a0ae@kdbg.org> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.1911291036320.31080@tvgsbejvaqbjf.bet>

Am 29.11.19 um 14:52 schrieb Johannes Schindelin:
> On Thu, 28 Nov 2019, Johannes Sixt wrote:
>> Am 22.11.19 um 15:41 schrieb Johannes Schindelin via GitGitGadget:
>>> +		    !getenv("SUPPRESS_HANDLE_INHERITANCE_WARNING")) {
>>
>> ... and the variable isn't set, so we continue here. (But I don't think
>> it is important.)

It's actually not that unimportant because ...

>>
>>> +			DWORD fl = 0;
>>> +			int i;
>>> +
>>> +			setenv("SUPPRESS_HANDLE_INHERITANCE_WARNING", "1", 1);
>>> +
>>> +			for (i = 0; i < stdhandles_count; i++) {
>>> +				HANDLE h = stdhandles[i];
>>> +				strbuf_addf(&buf, "handle #%d: %p (type %lx, "
>>> +					    "handle info (%d) %lx\n", i, h,
>>> +					    GetFileType(h),
>>> +					    GetHandleInformation(h, &fl),
>>> +					    fl);

... ERANGE happens here in the second iteration, in particular, when
strbuf_vaddf needs to grow the buffer. vsnprintf generates it.

>>> +			}
>>> +			strbuf_addstr(&buf, "\nThis is a bug; please report it "
>>> +				      "at\nhttps://github.com/git-for-windows/"
>>> +				      "git/issues/new\n\n"
>>> +				      "To suppress this warning, please set "
>>> +				      "the environment variable\n\n"
>>> +				      "\tSUPPRESS_HANDLE_INHERITANCE_WARNING=1"
>>> +				      "\n");
>>> +		}

-- Hannes

  parent reply index

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22 14:41 [PATCH 0/4] On Windows, limit which file handles are inherited by spawned child processes Johannes Schindelin via GitGitGadget
2019-11-22 14:41 ` [PATCH 1/4] mingw: demonstrate that all file handles are inherited by " Johannes Schindelin via GitGitGadget
2019-11-22 14:41 ` [PATCH 2/4] mingw: work around incorrect standard handles Johannes Schindelin via GitGitGadget
2019-11-22 14:41 ` [PATCH 3/4] mingw: spawned processes need to inherit only " Johannes Schindelin via GitGitGadget
2019-11-28 21:48   ` Johannes Sixt
2019-11-29 13:52     ` Johannes Schindelin
2019-11-29 20:40       ` Johannes Schindelin
2019-11-29 22:19       ` Johannes Sixt
2019-11-29 22:37       ` Johannes Sixt [this message]
2019-11-30 22:10         ` Johannes Schindelin
2019-11-22 14:41 ` [PATCH 4/4] mingw: restrict file handle inheritance only on Windows 7 and later Johannes Schindelin via GitGitGadget
2019-11-25  5:42 ` [PATCH 0/4] On Windows, limit which file handles are inherited by spawned child processes Junio C Hamano
2019-11-25 16:29   ` Johannes Schindelin

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=653e0604-3fd0-235d-564e-8f8a5900a0ae@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.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

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git