{"thread":{"id":"51990","subject":"Git Gui: Branch->create currently fails...","startedAt":"2019-10-07T22:02:12Z","lastAt":"2019-10-18T21:05:06Z","messageCount":10,"participants":["Philip Oakley","Pratyush Yadav"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"383630","messageId":"bfe78474-0eb9-fc5e-1371-3b055308169a@iee.email","threadId":"51990","inReplyTo":null,"subject":"Git Gui: Branch->create currently fails...","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-10-07T22:02:01Z","receivedAt":"2019-10-07T22:02:12Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"I'd never used the Branch:Create before (this is via mouse) and it threw \nan error, which appears to be repeatable, so I'm reporting it at the \nmoment so I don't forget ...\n(I'm chasing down other issue at the moment ;-)\n\nThis is with the version 0.21.GI git version 2.23.0.windows.1 Tcl/Tck 8.6.9\n\n\nmissing \"\nmissing \"\n     while executing\n\"list \"refs/heads/redo-v0\" [list \"\"\n     (\"eval\" body line 1)\n     invoked from within\n\"eval $line\"\n     (procedure \"_new\" line 87)\n     invoked from within\n\"_new $path 0 $title\"\n     (procedure \"::choose_rev::new\" line 2)\n     invoked from within\n\"::choose_rev::new $w.rev [mc \"Starting Revision\"]\"\n     (procedure \"branch_create::dialog\" line 35)\n     invoked from within\n\"branch_create::dialog\"\n     (menu invoke)\n\n\n-- \nPhilip\n"},{"id":"383631","messageId":"b7316273-3b91-a2a7-351e-490d920763ec@iee.email","threadId":"51990","inReplyTo":"bfe78474-0eb9-fc5e-1371-3b055308169a@iee.email","subject":"Re: Git Gui: Branch->create currently fails...","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-10-07T22:05:20Z","receivedAt":"2019-10-07T22:05:54Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 07/10/2019 23:02, Philip Oakley wrote:\n> I'd never used the Branch:Create before (this is via mouse) and it \n> threw an error, which appears to be repeatable, so I'm reporting it at \n> the moment so I don't forget ...\n> (I'm chasing down other issue at the moment ;-)\n\nForgot to mention, this was in a worktree looking at MSVC git.sln \ncompilation to the side of the main git.git repo, which may be a \npossible contributor.\n\n>\n> This is with the version 0.21.GI git version 2.23.0.windows.1 Tcl/Tck \n> 8.6.9\n>\n>\n> missing \"\n> missing \"\n>     while executing\n> \"list \"refs/heads/redo-v0\" [list \"\"\n>     (\"eval\" body line 1)\n>     invoked from within\n> \"eval $line\"\n>     (procedure \"_new\" line 87)\n>     invoked from within\n> \"_new $path 0 $title\"\n>     (procedure \"::choose_rev::new\" line 2)\n>     invoked from within\n> \"::choose_rev::new $w.rev [mc \"Starting Revision\"]\"\n>     (procedure \"branch_create::dialog\" line 35)\n>     invoked from within\n> \"branch_create::dialog\"\n>     (menu invoke)\n>\n>\n\n"},{"id":"383638","messageId":"20191008000003.qlulu5ie36eij4uq@yadavpratyush.com","threadId":"51990","inReplyTo":"bfe78474-0eb9-fc5e-1371-3b055308169a@iee.email","subject":"Re: Git Gui: Branch->create currently fails...","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2019-10-08T00:00:03Z","receivedAt":"2019-10-08T00:00:10Z","isPatch":false,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"On 07/10/19 11:02PM, Philip Oakley wrote:\n> I'd never used the Branch:Create before (this is via mouse) and it threw an\n> error, which appears to be repeatable, so I'm reporting it at the moment so\n\nI'm afraid I can't reproduce it. I tested by creating a worktree of \ngit.git by running:\n\n  git worktree add ../git-2\n\nThen I opened git-gui in the worktree and clicked the \"Create\" option \nunder the \"Branch\" menu.\n\nThe dialog opened just fine, which I assume is what your error is. But \njust to be sure, I created a branch too, and that also works pretty \nwell.\n\nSame behaviour with a \"normal\" branch, which is not inside a worktree.\n\nSo is there anything else in your setup that would cause this problem?\n\n> I don't forget ...\n> (I'm chasing down other issue at the moment ;-)\n> \n> This is with the version 0.21.GI git version 2.23.0.windows.1 Tcl/Tck 8.6.9\n> \n> \n> missing \"\n> missing \"\n>     while executing\n> \"list \"refs/heads/redo-v0\" [list \"\"\n>     (\"eval\" body line 1)\n>     invoked from within\n> \"eval $line\"\n>     (procedure \"_new\" line 87)\n>     invoked from within\n> \"_new $path 0 $title\"\n>     (procedure \"::choose_rev::new\" line 2)\n>     invoked from within\n> \"::choose_rev::new $w.rev [mc \"Starting Revision\"]\"\n>     (procedure \"branch_create::dialog\" line 35)\n>     invoked from within\n> \"branch_create::dialog\"\n>     (menu invoke)\n\nLooking at the log, the culprit seems to be the line:\n\n  set line [eval $line]\n\nover at lib/choose_rev.tcl:159. The $line comes from reading the output \nof a call to `git for-each-ref` with '--tcl' passed in. Looking at the \nman page for 'for-each-ref', the description of the option is:\n\n  --shell, --perl, --python, --tcl\n    If given, strings that substitute %(fieldname) placeholders are \n    quoted as string literals suitable for the specified host language. \n    This is meant to produce a scriptlet that\n    can directly be `eval`ed.\n\nSo this might possibly me an upstream bug.\n\nIf I had to guess a fix, I'd suggest trying to wrap the $line in \nlib/choose_rev.tcl:159 in quotes like so:\n\n  set line [eval \"$line\"] \n\nIf this doesn't fix it, see if you can find out which $line is causing \nproblem by printing the variable before 'eval'ing it by adding a:\n\n  puts \"$line\"\n\nbefore the call to eval.\n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"383974","messageId":"e0b45696-7945-4b7d-62e7-bff46eb8129a@iee.email","threadId":"51990","inReplyTo":"20191008000003.qlulu5ie36eij4uq@yadavpratyush.com","subject":"Re: Git Gui: Branch->create currently fails...","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-10-12T20:34:06Z","receivedAt":"2019-10-12T20:34:13Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Hi Pratyus,\nOn 08/10/2019 01:00, Pratyush Yadav wrote:\n> On 07/10/19 11:02PM, Philip Oakley wrote:\n>> I'd never used the Branch:Create before (this is via mouse) and it threw an\n>> error, which appears to be repeatable, so I'm reporting it at the moment so\n> I'm afraid I can't reproduce it. I tested by creating a worktree of\n> git.git by running:\n>\n>    git worktree add ../git-2\n>\n> Then I opened git-gui in the worktree and clicked the \"Create\" option\n> under the \"Branch\" menu.\n>\n> The dialog opened just fine, which I assume is what your error is. But\n> just to be sure, I created a branch too, and that also works pretty\n> well.\n>\n> Same behaviour with a \"normal\" branch, which is not inside a worktree.\n>\n> So is there anything else in your setup that would cause this problem?\n>\n>> I don't forget ...\n>> (I'm chasing down other issue at the moment ;-)\n>>\n>> This is with the version 0.21.GI git version 2.23.0.windows.1 Tcl/Tck 8.6.9\n>>\n>>\n>> missing \"\n>> missing \"\n>>      while executing\n>> \"list \"refs/heads/redo-v0\" [list \"\"\n>>      (\"eval\" body line 1)\n>>      invoked from within\n>> \"eval $line\"\n>>      (procedure \"_new\" line 87)\n>>      invoked from within\n>> \"_new $path 0 $title\"\n>>      (procedure \"::choose_rev::new\" line 2)\n>>      invoked from within\n>> \"::choose_rev::new $w.rev [mc \"Starting Revision\"]\"\n>>      (procedure \"branch_create::dialog\" line 35)\n>>      invoked from within\n>> \"branch_create::dialog\"\n>>      (menu invoke)\n> Looking at the log, the culprit seems to be the line:\n>\n>    set line [eval $line]\n>\n> over at lib/choose_rev.tcl:159. The $line comes from reading the output\n> of a call to `git for-each-ref` with '--tcl' passed in. Looking at the\n> man page for 'for-each-ref', the description of the option is:\n>\n>    --shell, --perl, --python, --tcl\n>      If given, strings that substitute %(fieldname) placeholders are\n>      quoted as string literals suitable for the specified host language.\n>      This is meant to produce a scriptlet that\n>      can directly be `eval`ed.\n>\n> So this might possibly me an upstream bug.\n>\n> If I had to guess a fix, I'd suggest trying to wrap the $line in\n> lib/choose_rev.tcl:159 in quotes like so:\n>\n>    set line [eval \"$line\"]\n>\n> If this doesn't fix it, see if you can find out which $line is causing\n> problem by printing the variable before 'eval'ing it by adding a:\n>\n>    puts \"$line\"\n>\n> before the call to eval.\n>\nI've tried both parts and seen that this looks like some form of buffer \noverrun or size limit\n\nwith the mods I ran:\n$ git gui > branch_create.txt\n\nwhich produced the 'same' error missing \", but with a slightly different \nfragment.\n\nThe branch_create.txt file is size 1.43 MB (1,502,103 bytes) (from the \nwindows explorer file properties dialog..)\nopening in Notepad++ it's 4900 lines long with the final line trucated \nat col 188 (shorter than other lines). There is an empty line 4901 (CRLF)\n\nthe last two lines are:\nlist \"refs/heads/branch-patterns\" [list \"commit\" \n\"b2453cea29b58f2ec57f9627b2456b41568ba5da\" [concat \"\" \"Philip Oakley\"] \n[reformat_date [concat \"\" \"Tue May 28 20:22:09 2019 +0100\"]] \"squash! \ndoc branch: provide examples for listing remote tracking branches\"] \n[list \"\" \"\" \"\" [reformat_date \"\"] \"\"]\nlist \"refs/heads/MSVC-README\" [list \"commit\" \n\"056fb95c8e983ec07e9f5f8baa0b119bf3d13fed\" [concat \"\" \"Philip Oakley\"] \n[reformat_date [concat \"\" \"Sun May 19 22:33:37 2019 +0100\"]] \"compat/vc\n\nthe file starts with 1018 lines of refs/tags before listing the \nrefs/remotes and finally the refs/heads.\n\nThe repo is my local Git repo with multiple remotes (git.git, G-f-W, \nggg, junio, gitster, dscho, t-b, tboeg, me), so plenty of refs there!\n\nSo it does look to be specific to repos with a large number of \nrefs/tags, refs/remotes, and refs/heads.\n\nsomething for the back-burner?\n\nPhilip\n"},{"id":"383995","messageId":"20191013185007.hogizh23jomaswzx@yadavpratyush.com","threadId":"51990","inReplyTo":"e0b45696-7945-4b7d-62e7-bff46eb8129a@iee.email","subject":"Re: Git Gui: Branch->create currently fails...","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2019-10-13T18:50:07Z","receivedAt":"2019-10-13T18:50:15Z","isPatch":false,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"On 12/10/19 09:34PM, Philip Oakley wrote:\n> Hi Pratyus,\n> On 08/10/2019 01:00, Pratyush Yadav wrote:\n> > On 07/10/19 11:02PM, Philip Oakley wrote:\n> > > I'd never used the Branch:Create before (this is via mouse) and it threw an\n> > > error, which appears to be repeatable, so I'm reporting it at the moment so\n> > I'm afraid I can't reproduce it. I tested by creating a worktree of\n> > git.git by running:\n> > \n> >    git worktree add ../git-2\n> > \n> > Then I opened git-gui in the worktree and clicked the \"Create\" option\n> > under the \"Branch\" menu.\n> > \n> > The dialog opened just fine, which I assume is what your error is. But\n> > just to be sure, I created a branch too, and that also works pretty\n> > well.\n> > \n> > Same behaviour with a \"normal\" branch, which is not inside a worktree.\n> > \n> > So is there anything else in your setup that would cause this problem?\n> > \n> > > I don't forget ...\n> > > (I'm chasing down other issue at the moment ;-)\n> > > \n> > > This is with the version 0.21.GI git version 2.23.0.windows.1 Tcl/Tck 8.6.9\n> > > \n> > > \n> > > missing \"\n> > > missing \"\n> > >      while executing\n> > > \"list \"refs/heads/redo-v0\" [list \"\"\n> > >      (\"eval\" body line 1)\n> > >      invoked from within\n> > > \"eval $line\"\n> > >      (procedure \"_new\" line 87)\n> > >      invoked from within\n> > > \"_new $path 0 $title\"\n> > >      (procedure \"::choose_rev::new\" line 2)\n> > >      invoked from within\n> > > \"::choose_rev::new $w.rev [mc \"Starting Revision\"]\"\n> > >      (procedure \"branch_create::dialog\" line 35)\n> > >      invoked from within\n> > > \"branch_create::dialog\"\n> > >      (menu invoke)\n> > Looking at the log, the culprit seems to be the line:\n> > \n> >    set line [eval $line]\n> > \n> > over at lib/choose_rev.tcl:159. The $line comes from reading the output\n> > of a call to `git for-each-ref` with '--tcl' passed in. Looking at the\n> > man page for 'for-each-ref', the description of the option is:\n> > \n> >    --shell, --perl, --python, --tcl\n> >      If given, strings that substitute %(fieldname) placeholders are\n> >      quoted as string literals suitable for the specified host language.\n> >      This is meant to produce a scriptlet that\n> >      can directly be `eval`ed.\n> > \n> > So this might possibly me an upstream bug.\n> > \n> > If I had to guess a fix, I'd suggest trying to wrap the $line in\n> > lib/choose_rev.tcl:159 in quotes like so:\n> > \n> >    set line [eval \"$line\"]\n> > \n> > If this doesn't fix it, see if you can find out which $line is causing\n> > problem by printing the variable before 'eval'ing it by adding a:\n> > \n> >    puts \"$line\"\n> > \n> > before the call to eval.\n> > \n> I've tried both parts and seen that this looks like some form of buffer\n> overrun or size limit\n\nLooks like it, but I'm not sure if that is on our end.\n \n> with the mods I ran:\n> $ git gui > branch_create.txt\n> \n> which produced the 'same' error missing \", but with a slightly different\n> fragment.\n> \n> The branch_create.txt file is size 1.43 MB (1,502,103 bytes) (from the\n> windows explorer file properties dialog..)\n> opening in Notepad++ it's 4900 lines long with the final line trucated at\n> col 188 (shorter than other lines). There is an empty line 4901 (CRLF)\n\nYeah, that's a lot of refs! On my git.git clone, I get 1299 lines, and I \nhave git.git, my fork of git.git, and gitster in my remotes.\n \n> the last two lines are:\n> list \"refs/heads/branch-patterns\" [list \"commit\"\n> \"b2453cea29b58f2ec57f9627b2456b41568ba5da\" [concat \"\" \"Philip Oakley\"]\n> [reformat_date [concat \"\" \"Tue May 28 20:22:09 2019 +0100\"]] \"squash! doc\n> branch: provide examples for listing remote tracking branches\"] [list \"\" \"\"\n> \"\" [reformat_date \"\"] \"\"]\n> list \"refs/heads/MSVC-README\" [list \"commit\"\n> \"056fb95c8e983ec07e9f5f8baa0b119bf3d13fed\" [concat \"\" \"Philip Oakley\"]\n> [reformat_date [concat \"\" \"Sun May 19 22:33:37 2019 +0100\"]] \"compat/vc\n> \n> the file starts with 1018 lines of refs/tags before listing the refs/remotes\n> and finally the refs/heads.\n> \n> The repo is my local Git repo with multiple remotes (git.git, G-f-W, ggg,\n> junio, gitster, dscho, t-b, tboeg, me), so plenty of refs there!\n> \n> So it does look to be specific to repos with a large number of refs/tags,\n> refs/remotes, and refs/heads.\n> \n> something for the back-burner?\n\nI'm not sure why or where a buffer overflow would occur. We don't store \nthe whole output directly in a variable. Instead, we store each line \nfrom the pipe coming in from `git for-each-ref` in $line, so that's a \nfew hundred characters at most. The rest of the data stays in the pipe, \nwhich the OS should handle, and I don't think a few MBs should cause \ntrouble.\n\nIf I had to guess, I'd suspect either an internal Tcl limit, or \nsomething with Tcl pipes.\n\nJust to be sure it is a git-gui/Tcl issue and not an upstream git.git \nissue, can you run:\n\n  fmt='list %(refname) [list %(objecttype) %(objectname) [concat %(taggername) %(authorname)] [reformat_date [concat %(taggerdate) %(authordate)]] %(subject)] [list %(*objecttype) %(*objectname) %(*authorname) [reformat_date %(*authordate)] %(*subject)]'\n  \n  git for-each-ref --tcl --format=\"$fmt\" --sort=-taggerdate refs/heads refs/remotes refs/tags\n\nand see if the output contains that truncated line? If it does, then \nthat means the bug is in git-for-each-ref. Note that this is bash \nsyntax, and I did a test run on Linux. Do adjust it for Windows and your \nshell if needed.\n\nOther than that, I don't really see a clear fix. So looks like something \nfor the back burner.\n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"384013","messageId":"fccde9f3-7c5c-f8fb-1af2-bd56f48f7877@iee.email","threadId":"51990","inReplyTo":"20191013185007.hogizh23jomaswzx@yadavpratyush.com","subject":"Re: Git Gui: Branch->create currently fails...","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-10-14T12:45:28Z","receivedAt":"2019-10-14T12:45:34Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Hi Pratyush,\nOn 13/10/2019 19:50, Pratyush Yadav wrote:\n>> I've tried both parts and seen that this looks like some form of buffer\n>> overrun or size limit\n> Looks like it, but I'm not sure if that is on our end.\n>   \n>> with the mods I ran:\n>> $ git gui > branch_create.txt\n>>\n>> which produced the 'same' error missing \", but with a slightly different\n>> fragment.\n>>\n>> The branch_create.txt file is size 1.43 MB (1,502,103 bytes) (from the\n>> windows explorer file properties dialog..)\n>> opening in Notepad++ it's 4900 lines long with the final line trucated at\n>> col 188 (shorter than other lines). There is an empty line 4901 (CRLF)\n> Yeah, that's a lot of refs! On my git.git clone, I get 1299 lines, and I\n> have git.git, my fork of git.git, and gitster in my remotes.\n>   \n>> the last two lines are:\n>> list \"refs/heads/branch-patterns\" [list \"commit\"\n>> \"b2453cea29b58f2ec57f9627b2456b41568ba5da\" [concat \"\" \"Philip Oakley\"]\n>> [reformat_date [concat \"\" \"Tue May 28 20:22:09 2019 +0100\"]] \"squash! doc\n>> branch: provide examples for listing remote tracking branches\"] [list \"\" \"\"\n>> \"\" [reformat_date \"\"] \"\"]\n>> list \"refs/heads/MSVC-README\" [list \"commit\"\n>> \"056fb95c8e983ec07e9f5f8baa0b119bf3d13fed\" [concat \"\" \"Philip Oakley\"]\n>> [reformat_date [concat \"\" \"Sun May 19 22:33:37 2019 +0100\"]] \"compat/vc\n>>\n>> the file starts with 1018 lines of refs/tags before listing the refs/remotes\n>> and finally the refs/heads.\n>>\n>> The repo is my local Git repo with multiple remotes (git.git, G-f-W, ggg,\n>> junio, gitster, dscho, t-b, tboeg, me), so plenty of refs there!\n>>\n>> So it does look to be specific to repos with a large number of refs/tags,\n>> refs/remotes, and refs/heads.\n>>\n>> something for the back-burner?\n> I'm not sure why or where a buffer overflow would occur. We don't store\n> the whole output directly in a variable. Instead, we store each line\n> from the pipe coming in from `git for-each-ref` in $line, so that's a\n> few hundred characters at most. The rest of the data stays in the pipe,\n> which the OS should handle, and I don't think a few MBs should cause\n> trouble.\n>\n> If I had to guess, I'd suspect either an internal Tcl limit, or\n> something with Tcl pipes.\n>\n> Just to be sure it is a git-gui/Tcl issue and not an upstream git.git\n> issue, can you run:\n>\n>    fmt='list %(refname) [list %(objecttype) %(objectname) [concat %(taggername) %(authorname)] [reformat_date [concat %(taggerdate) %(authordate)]] %(subject)] [list %(*objecttype) %(*objectname) %(*authorname) [reformat_date %(*authordate)] %(*subject)]'\n>    \n>    git for-each-ref --tcl --format=\"$fmt\" --sort=-taggerdate refs/heads refs/remotes refs/tags\n>\n> and see if the output contains that truncated line? If it does, then\n> that means the bug is in git-for-each-ref. Note that this is bash\n> syntax, and I did a test run on Linux. Do adjust it for Windows and your\n> shell if needed.\n\nran that bit of code (as distinct commands), and got (last two lines):\n\n[list \"\" \"\" \"\" [reformat_date \"\"] \"\"]\nlist \"refs/heads/branch-patterns-v2\" [list \"commit\" \n\"d5a799d8833b0ae195915eefd5365f3fc4c7c0a4\" [concat \"\" \"Philip Oakley\"] \n[reformat_date [concat \"\" \"Sat Jun 8 22:50:06 2019 +0100\"]] \n\"t3203-branch-output: test -a & -r pattern options\"] [list \"\" \"\" \"\" \n[reformat_date \"\"] \"\"]\nlist \"refs/heads/branch-patterns\" [list \"commit\" \n\"b2453cea29b58f2ec57f9627b2456b41568ba5da\" [concat \"\" \"Philip Oakley\"] \n[reformat_date [concat \"\" \"Tue May 28 20:22:09 2019 +0100\"]] \"squash! \ndoc branch: provide examples for listing remote tracking branches\"] \n[list \"\" \"\" \"\" [reformat_date \"\"] \"\"]\nlist \"refs/heads/MSVC-README\" [list \"commit\" \n\"056fb95c8e983ec07e9f5f8baa0b119bf3d13fed\" [concat \"\" \"Philip Oakley\"] \n[reformat_date [concat \"\" \"Sun May 19 22:33:37 2019 +0100\"]] \n\"compat/vcSegmentation fault\n\n\nNot exactly the same, but almost. Ends the same place, with as similar \nshort line.\nThis is run inside the bash that is started directly by the \ngit-for-windows sdk start icon. (Target: C:\\git-sdk-64\\git-bash.exe   \nStat in: C:/git-sdk-64/)\n\nso looks to be MSYS2/bash related.\n\n-- \nPhilip\n"},{"id":"384026","messageId":"20191014175747.llstv7oxba2c23qy@yadavpratyush.com","threadId":"51990","inReplyTo":"fccde9f3-7c5c-f8fb-1af2-bd56f48f7877@iee.email","subject":"Re: Git Gui: Branch->create currently fails...","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2019-10-14T17:57:48Z","receivedAt":"2019-10-14T17:58:04Z","isPatch":false,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"On 14/10/19 01:45PM, Philip Oakley wrote:\n> Hi Pratyush,\n> On 13/10/2019 19:50, Pratyush Yadav wrote:\n> > Just to be sure it is a git-gui/Tcl issue and not an upstream \n> > git.git\n> > issue, can you run:\n> > \n> >    fmt='list %(refname) [list %(objecttype) %(objectname) [concat %(taggername) %(authorname)] [reformat_date [concat %(taggerdate) %(authordate)]] %(subject)] [list %(*objecttype) %(*objectname) %(*authorname) [reformat_date %(*authordate)] %(*subject)]'\n> >    git for-each-ref --tcl --format=\"$fmt\" --sort=-taggerdate refs/heads refs/remotes refs/tags\n> > \n> > and see if the output contains that truncated line? If it does, then\n> > that means the bug is in git-for-each-ref. Note that this is bash\n> > syntax, and I did a test run on Linux. Do adjust it for Windows and your\n> > shell if needed.\n> \n> ran that bit of code (as distinct commands), and got (last two lines):\n> \n> [list \"\" \"\" \"\" [reformat_date \"\"] \"\"]\n> list \"refs/heads/branch-patterns-v2\" [list \"commit\"\n> \"d5a799d8833b0ae195915eefd5365f3fc4c7c0a4\" [concat \"\" \"Philip Oakley\"]\n> [reformat_date [concat \"\" \"Sat Jun 8 22:50:06 2019 +0100\"]]\n> \"t3203-branch-output: test -a & -r pattern options\"] [list \"\" \"\" \"\"\n> [reformat_date \"\"] \"\"]\n> list \"refs/heads/branch-patterns\" [list \"commit\"\n> \"b2453cea29b58f2ec57f9627b2456b41568ba5da\" [concat \"\" \"Philip Oakley\"]\n> [reformat_date [concat \"\" \"Tue May 28 20:22:09 2019 +0100\"]] \"squash! doc\n> branch: provide examples for listing remote tracking branches\"] [list \"\" \"\"\n> \"\" [reformat_date \"\"] \"\"]\n> list \"refs/heads/MSVC-README\" [list \"commit\"\n> \"056fb95c8e983ec07e9f5f8baa0b119bf3d13fed\" [concat \"\" \"Philip Oakley\"]\n> [reformat_date [concat \"\" \"Sun May 19 22:33:37 2019 +0100\"]]\n> \"compat/vcSegmentation fault\n> \n> \n> Not exactly the same, but almost. Ends the same place, with as similar short\n> line.\n> This is run inside the bash that is started directly by the git-for-windows\n> sdk start icon. (Target: C:\\git-sdk-64\\git-bash.exe   Stat in:\n> C:/git-sdk-64/)\n> \n> so looks to be MSYS2/bash related.\n\nAh, so it is an upstream issue. I guess we can just report it and wait \nfor them to fix it.\n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"384043","messageId":"dc8a9b93-a2e7-4fbf-0ea7-f1a855f4b926@iee.email","threadId":"51990","inReplyTo":"20191014175747.llstv7oxba2c23qy@yadavpratyush.com","subject":"Re: Git Gui: Branch->create currently fails...","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-10-14T22:11:03Z","receivedAt":"2019-10-14T22:11:09Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 14/10/2019 18:57, Pratyush Yadav wrote:\n>> list \"refs/heads/MSVC-README\" [list \"commit\"\n>> \"056fb95c8e983ec07e9f5f8baa0b119bf3d13fed\" [concat \"\" \"Philip Oakley\"]\n>> [reformat_date [concat \"\" \"Sun May 19 22:33:37 2019 +0100\"]]\n>> \"compat/vcSegmentation fault\n>>\n>>\n>> Not exactly the same, but almost. Ends the same place, with as similar short\n>> line.\n>> This is run inside the bash that is started directly by the git-for-windows\n>> sdk start icon. (Target: C:\\git-sdk-64\\git-bash.exe   Stat in:\n>> C:/git-sdk-64/)\n>>\n>> so looks to be MSYS2/bash related.\n> Ah, so it is an upstream issue. I guess we can just report it and wait\n> for them to fix it.\nI'd missed the final 'Segmentation fault' on the last line in the bash \noutput that wasn't there for the captured file.\n\nThat was repeatable in re-testing.\nBut failed if I changed the $fmt string to a plain text 500 char string \n(\"1234567890123...\").\n\nI've still to trim down the complicated $fmt string to see if I can see \nwhere that seg fault starts (i.e. some form of MVCE), so that it can be \ninvestigated.\nPossibly should check if the --tcl flag actually invokes any tcl! \nOtherwise it's fully in the Git/G-f-W zone.\n\n...\nJust rebuilt (I hope) the Windows Subsystem for Linux (WSL) with git \nv2.23.0 installed and got:\n\nlist \"refs/heads/MSVC-README\" [list \"commit\" \n\"056fb95c8e983ec07e9f5f8baa0b119bf3d13fed\" [concat \"\" \"Philip Oakley\"] \n[reformat_date [concat \"\" \"Sun May 19 22:33:37 2019 +0100\"]] \n\"compat/vcbuild/README: clean/update 'vcpkg' env for Visual Studio \nupdates\"] [list \"\" \"\" \"\" [reformat_date \"\"] \"\"]\nmunmap_chunk(): invalid pointer\nAborted (core dumped)\nroot@Philip-Win10:/mnt/c/git-sdk-64/usr/src/git#\n\n\nThat said, haven't got the gitk and git gui to work yet on the WSL \nbecause it doesn't like the tcl/tk.\n\nIt's a bit of a hole digging exercise.\n\nPhilip\n\n"},{"id":"384200","messageId":"20191016185221.hufjb4uavacumbmc@yadavpratyush.com","threadId":"51990","inReplyTo":"dc8a9b93-a2e7-4fbf-0ea7-f1a855f4b926@iee.email","subject":"Re: Git Gui: Branch->create currently fails...","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2019-10-16T18:52:21Z","receivedAt":"2019-10-16T18:52:29Z","isPatch":false,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"On 14/10/19 11:11PM, Philip Oakley wrote:\n> On 14/10/2019 18:57, Pratyush Yadav wrote:\n> > > list \"refs/heads/MSVC-README\" [list \"commit\"\n> > > \"056fb95c8e983ec07e9f5f8baa0b119bf3d13fed\" [concat \"\" \"Philip Oakley\"]\n> > > [reformat_date [concat \"\" \"Sun May 19 22:33:37 2019 +0100\"]]\n> > > \"compat/vcSegmentation fault\n> > > \n> > > \n> > > Not exactly the same, but almost. Ends the same place, with as similar short\n> > > line.\n> > > This is run inside the bash that is started directly by the git-for-windows\n> > > sdk start icon. (Target: C:\\git-sdk-64\\git-bash.exe   Stat in:\n> > > C:/git-sdk-64/)\n> > > \n> > > so looks to be MSYS2/bash related.\n> > Ah, so it is an upstream issue. I guess we can just report it and wait\n> > for them to fix it.\n> I'd missed the final 'Segmentation fault' on the last line in the bash\n> output that wasn't there for the captured file.\n> \n> That was repeatable in re-testing.\n> But failed if I changed the $fmt string to a plain text 500 char string\n> (\"1234567890123...\").\n> \n> I've still to trim down the complicated $fmt string to see if I can see\n> where that seg fault starts (i.e. some form of MVCE), so that it can be\n> investigated.\n> Possibly should check if the --tcl flag actually invokes any tcl! Otherwise\n> it's fully in the Git/G-f-W zone.\n\nA quick look tells me '--tcl' does not invoke any Tcl. It is just used \nto output properly formatted strings for Tcl. The option sets the value \nof 'format.quote_style' in for-each-ref (builtin/for-each-ref.c:33). \nThat value is later indirectly ends up being used in the function \nref_filter.c::quote_formatting.\n\nThe Tcl code we execute comes from the long $fmt string, which is built \nin git-gui/choose_rev.tcl:133-147. `for-each-ref` just fills in the \nplaceholder values, properly formatting them for use in Tcl.\n\nAs an experiment, you can try removing '--tcl' from the `for-each-ref` \ncommand that segfaults, just to be sure. It would probably output \ninvalid Tcl, but since we don't do anything with that output, it doesn't \nreally matter, and would let us know if '--tcl' is really the culprit.\n\n> ...\n> Just rebuilt (I hope) the Windows Subsystem for Linux (WSL) with git v2.23.0\n> installed and got:\n> \n> list \"refs/heads/MSVC-README\" [list \"commit\"\n> \"056fb95c8e983ec07e9f5f8baa0b119bf3d13fed\" [concat \"\" \"Philip Oakley\"]\n> [reformat_date [concat \"\" \"Sun May 19 22:33:37 2019 +0100\"]]\n> \"compat/vcbuild/README: clean/update 'vcpkg' env for Visual Studio updates\"]\n> [list \"\" \"\" \"\" [reformat_date \"\"] \"\"]\n> munmap_chunk(): invalid pointer\n\nA quick Google search tells me munmap_chunk() is probably related to an \ninvalid pointer being freed. Either a double free or a free on a pointer \nnot allocated by malloc or something similar.\n\n> Aborted (core dumped)\n> root@Philip-Win10:/mnt/c/git-sdk-64/usr/src/git#\n> \n> \n> That said, haven't got the gitk and git gui to work yet on the WSL because\n> it doesn't like the tcl/tk.\n> \n> It's a bit of a hole digging exercise.\n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"384415","messageId":"6648dd51-ab60-c462-b800-c6e68fe325a3@iee.email","threadId":"51990","inReplyTo":"20191016185221.hufjb4uavacumbmc@yadavpratyush.com","subject":"Re: Git Gui: Branch->create currently fails...","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2019-10-18T21:05:03Z","receivedAt":"2019-10-18T21:05:06Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Hi Pratyush\n\nOn 16/10/2019 19:52, Pratyush Yadav wrote:\n> On 14/10/19 11:11PM, Philip Oakley wrote:\n>> On 14/10/2019 18:57, Pratyush Yadav wrote:\n>>>> list \"refs/heads/MSVC-README\" [list \"commit\"\n>>>> \"056fb95c8e983ec07e9f5f8baa0b119bf3d13fed\" [concat \"\" \"Philip Oakley\"]\n>>>> [reformat_date [concat \"\" \"Sun May 19 22:33:37 2019 +0100\"]]\n>>>> \"compat/vcSegmentation fault\n>>>>\n>>>>\n>>>> Not exactly the same, but almost. Ends the same place, with as similar short\n>>>> line.\n>>>> This is run inside the bash that is started directly by the git-for-windows\n>>>> sdk start icon. (Target: C:\\git-sdk-64\\git-bash.exe   Stat in:\n>>>> C:/git-sdk-64/)\n>>>>\n>>>> so looks to be MSYS2/bash related.\n>>> Ah, so it is an upstream issue. I guess we can just report it and wait\n>>> for them to fix it.\n>> I'd missed the final 'Segmentation fault' on the last line in the bash\n>> output that wasn't there for the captured file.\n>>\n>> That was repeatable in re-testing.\n>> But failed if I changed the $fmt string to a plain text 500 char string\n>> (\"1234567890123...\").\n>>\n>> I've still to trim down the complicated $fmt string to see if I can see\n>> where that seg fault starts (i.e. some form of MVCE), so that it can be\n>> investigated.\n>> Possibly should check if the --tcl flag actually invokes any tcl! Otherwise\n>> it's fully in the Git/G-f-W zone.\n> A quick look tells me '--tcl' does not invoke any Tcl. It is just used\n> to output properly formatted strings for Tcl. The option sets the value\n> of 'format.quote_style' in for-each-ref (builtin/for-each-ref.c:33).\n> That value is later indirectly ends up being used in the function\n> ref_filter.c::quote_formatting.\n>\n> The Tcl code we execute comes from the long $fmt string, which is built\n> in git-gui/choose_rev.tcl:133-147. `for-each-ref` just fills in the\n> placeholder values, properly formatting them for use in Tcl.\n>\n> As an experiment, you can try removing '--tcl' from the `for-each-ref`\n> command that segfaults, just to be sure. It would probably output\n> invalid Tcl, but since we don't do anything with that output, it doesn't\n> really matter, and would let us know if '--tcl' is really the culprit.\nCommand reminder:\nfmt='list %(refname) [list %(objecttype) %(objectname) [concat \n%(taggername) %(authorname)] [reformat_date [concat %(taggerdate) \n%(authordate)]] %(subject)] [list %(*objecttype) %(*objectname) \n%(*authorname) [reformat_date %(*authordate)] %(*subject)]'\n\ngit for-each-ref --format=\"$fmt\" --sort=-taggerdate refs/heads \nrefs/remotes refs/tags\n-\nRemoving the '--tcl' still seg faults.\n\nRemoving the  --sort=-taggerdate  *stops* the segfault.\n\nRemoving instead the final 'refs/tags' (i.e. a shorter list) also \n*stops* the seg fault (still with the --sort=..)\n\nIf instead I drop the initial refs/heads (a limited number of branch \nheads!) it segfaults (still with --sort) so looks like it's a size issue.\n\nAlternative approach - trim the fmt string, dropping all the '*' types.\n$ fmt='list %(refname) [list %(objecttype) %(objectname) [concat \n%(taggername) %(authorname)] [reformat_date [concat %(taggerdate) \n%(authordate)]] %(subject)]'\n\nThe full for-each-ref command now works, BUT the last line of output is \nshort, rather than being a seg fault. (with or without the --sortdate)\n\nso all in all rather weird. Sometimes it seg faults and sometimes it \nsimply terminates early.\n>> ...\n>> Just rebuilt (I hope) the Windows Subsystem for Linux (WSL) with git v2.23.0\n>> installed and got:\n>>\n>> list \"refs/heads/MSVC-README\" [list \"commit\"\n>> \"056fb95c8e983ec07e9f5f8baa0b119bf3d13fed\" [concat \"\" \"Philip Oakley\"]\n>> [reformat_date [concat \"\" \"Sun May 19 22:33:37 2019 +0100\"]]\n>> \"compat/vcbuild/README: clean/update 'vcpkg' env for Visual Studio updates\"]\n>> [list \"\" \"\" \"\" [reformat_date \"\"] \"\"]\n>> munmap_chunk(): invalid pointer\n> A quick Google search tells me munmap_chunk() is probably related to an\n> invalid pointer being freed. Either a double free or a free on a pointer\n> not allocated by malloc or something similar.\n>\n>> Aborted (core dumped)\n>> root@Philip-Win10:/mnt/c/git-sdk-64/usr/src/git#\n>>\n>>\n>> That said, haven't got the gitk and git gui to work yet on the WSL because\n>> it doesn't like the tcl/tk.\n>>\n>> It's a bit of a hole digging exercise.\nThe hole that keeps digging...\nP.\n"}]}