git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Philip Oakley <philipoakley@iee.email>
To: Pratyush Yadav <me@yadavpratyush.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: Git Gui: Branch->create currently fails...
Date: Mon, 14 Oct 2019 13:45:28 +0100	[thread overview]
Message-ID: <fccde9f3-7c5c-f8fb-1af2-bd56f48f7877@iee.email> (raw)
In-Reply-To: <20191013185007.hogizh23jomaswzx@yadavpratyush.com>

Hi Pratyush,
On 13/10/2019 19:50, Pratyush Yadav wrote:
>> I've tried both parts and seen that this looks like some form of buffer
>> overrun or size limit
> Looks like it, but I'm not sure if that is on our end.
>   
>> with the mods I ran:
>> $ git gui > branch_create.txt
>>
>> which produced the 'same' error missing ", but with a slightly different
>> fragment.
>>
>> The branch_create.txt file is size 1.43 MB (1,502,103 bytes) (from the
>> windows explorer file properties dialog..)
>> opening in Notepad++ it's 4900 lines long with the final line trucated at
>> col 188 (shorter than other lines). There is an empty line 4901 (CRLF)
> Yeah, that's a lot of refs! On my git.git clone, I get 1299 lines, and I
> have git.git, my fork of git.git, and gitster in my remotes.
>   
>> the last two lines are:
>> list "refs/heads/branch-patterns" [list "commit"
>> "b2453cea29b58f2ec57f9627b2456b41568ba5da" [concat "" "Philip Oakley"]
>> [reformat_date [concat "" "Tue May 28 20:22:09 2019 +0100"]] "squash! doc
>> branch: provide examples for listing remote tracking branches"] [list "" ""
>> "" [reformat_date ""] ""]
>> list "refs/heads/MSVC-README" [list "commit"
>> "056fb95c8e983ec07e9f5f8baa0b119bf3d13fed" [concat "" "Philip Oakley"]
>> [reformat_date [concat "" "Sun May 19 22:33:37 2019 +0100"]] "compat/vc
>>
>> the file starts with 1018 lines of refs/tags before listing the refs/remotes
>> and finally the refs/heads.
>>
>> The repo is my local Git repo with multiple remotes (git.git, G-f-W, ggg,
>> junio, gitster, dscho, t-b, tboeg, me), so plenty of refs there!
>>
>> So it does look to be specific to repos with a large number of refs/tags,
>> refs/remotes, and refs/heads.
>>
>> something for the back-burner?
> I'm not sure why or where a buffer overflow would occur. We don't store
> the whole output directly in a variable. Instead, we store each line
> from the pipe coming in from `git for-each-ref` in $line, so that's a
> few hundred characters at most. The rest of the data stays in the pipe,
> which the OS should handle, and I don't think a few MBs should cause
> trouble.
>
> If I had to guess, I'd suspect either an internal Tcl limit, or
> something with Tcl pipes.
>
> Just to be sure it is a git-gui/Tcl issue and not an upstream git.git
> issue, can you run:
>
>    fmt='list %(refname) [list %(objecttype) %(objectname) [concat %(taggername) %(authorname)] [reformat_date [concat %(taggerdate) %(authordate)]] %(subject)] [list %(*objecttype) %(*objectname) %(*authorname) [reformat_date %(*authordate)] %(*subject)]'
>    
>    git for-each-ref --tcl --format="$fmt" --sort=-taggerdate refs/heads refs/remotes refs/tags
>
> and see if the output contains that truncated line? If it does, then
> that means the bug is in git-for-each-ref. Note that this is bash
> syntax, and I did a test run on Linux. Do adjust it for Windows and your
> shell if needed.

ran that bit of code (as distinct commands), and got (last two lines):

[list "" "" "" [reformat_date ""] ""]
list "refs/heads/branch-patterns-v2" [list "commit" 
"d5a799d8833b0ae195915eefd5365f3fc4c7c0a4" [concat "" "Philip Oakley"] 
[reformat_date [concat "" "Sat Jun 8 22:50:06 2019 +0100"]] 
"t3203-branch-output: test -a & -r pattern options"] [list "" "" "" 
[reformat_date ""] ""]
list "refs/heads/branch-patterns" [list "commit" 
"b2453cea29b58f2ec57f9627b2456b41568ba5da" [concat "" "Philip Oakley"] 
[reformat_date [concat "" "Tue May 28 20:22:09 2019 +0100"]] "squash! 
doc branch: provide examples for listing remote tracking branches"] 
[list "" "" "" [reformat_date ""] ""]
list "refs/heads/MSVC-README" [list "commit" 
"056fb95c8e983ec07e9f5f8baa0b119bf3d13fed" [concat "" "Philip Oakley"] 
[reformat_date [concat "" "Sun May 19 22:33:37 2019 +0100"]] 
"compat/vcSegmentation fault


Not exactly the same, but almost. Ends the same place, with as similar 
short line.
This is run inside the bash that is started directly by the 
git-for-windows sdk start icon. (Target: C:\git-sdk-64\git-bash.exe   
Stat in: C:/git-sdk-64/)

so looks to be MSYS2/bash related.

-- 
Philip

  reply	other threads:[~2019-10-14 12:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 22:02 Git Gui: Branch->create currently fails Philip Oakley
2019-10-07 22:05 ` Philip Oakley
2019-10-08  0:00 ` Pratyush Yadav
2019-10-12 20:34   ` Philip Oakley
2019-10-13 18:50     ` Pratyush Yadav
2019-10-14 12:45       ` Philip Oakley [this message]
2019-10-14 17:57         ` Pratyush Yadav
2019-10-14 22:11           ` Philip Oakley
2019-10-16 18:52             ` Pratyush Yadav
2019-10-18 21:05               ` Philip Oakley

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=fccde9f3-7c5c-f8fb-1af2-bd56f48f7877@iee.email \
    --to=philipoakley@iee.email \
    --cc=git@vger.kernel.org \
    --cc=me@yadavpratyush.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).