git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Git Gui: Branch->create currently fails...
@ 2019-10-07 22:02 Philip Oakley
  2019-10-07 22:05 ` Philip Oakley
  2019-10-08  0:00 ` Pratyush Yadav
  0 siblings, 2 replies; 10+ messages in thread
From: Philip Oakley @ 2019-10-07 22:02 UTC (permalink / raw)
  To: Git List; +Cc: Pratyush Yadav

I'd never used the Branch:Create before (this is via mouse) and it threw 
an error, which appears to be repeatable, so I'm reporting it at the 
moment so I don't forget ...
(I'm chasing down other issue at the moment ;-)

This is with the version 0.21.GI git version 2.23.0.windows.1 Tcl/Tck 8.6.9


missing "
missing "
     while executing
"list "refs/heads/redo-v0" [list ""
     ("eval" body line 1)
     invoked from within
"eval $line"
     (procedure "_new" line 87)
     invoked from within
"_new $path 0 $title"
     (procedure "::choose_rev::new" line 2)
     invoked from within
"::choose_rev::new $w.rev [mc "Starting Revision"]"
     (procedure "branch_create::dialog" line 35)
     invoked from within
"branch_create::dialog"
     (menu invoke)


-- 
Philip

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Gui: Branch->create currently fails...
  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
  1 sibling, 0 replies; 10+ messages in thread
From: Philip Oakley @ 2019-10-07 22:05 UTC (permalink / raw)
  To: Git List; +Cc: Pratyush Yadav

On 07/10/2019 23:02, Philip Oakley wrote:
> I'd never used the Branch:Create before (this is via mouse) and it 
> threw an error, which appears to be repeatable, so I'm reporting it at 
> the moment so I don't forget ...
> (I'm chasing down other issue at the moment ;-)

Forgot to mention, this was in a worktree looking at MSVC git.sln 
compilation to the side of the main git.git repo, which may be a 
possible contributor.

>
> This is with the version 0.21.GI git version 2.23.0.windows.1 Tcl/Tck 
> 8.6.9
>
>
> missing "
> missing "
>     while executing
> "list "refs/heads/redo-v0" [list ""
>     ("eval" body line 1)
>     invoked from within
> "eval $line"
>     (procedure "_new" line 87)
>     invoked from within
> "_new $path 0 $title"
>     (procedure "::choose_rev::new" line 2)
>     invoked from within
> "::choose_rev::new $w.rev [mc "Starting Revision"]"
>     (procedure "branch_create::dialog" line 35)
>     invoked from within
> "branch_create::dialog"
>     (menu invoke)
>
>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Gui: Branch->create currently fails...
  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
  1 sibling, 1 reply; 10+ messages in thread
From: Pratyush Yadav @ 2019-10-08  0:00 UTC (permalink / raw)
  To: Philip Oakley; +Cc: Git List

On 07/10/19 11:02PM, Philip Oakley wrote:
> I'd never used the Branch:Create before (this is via mouse) and it threw an
> error, which appears to be repeatable, so I'm reporting it at the moment so

I'm afraid I can't reproduce it. I tested by creating a worktree of 
git.git by running:

  git worktree add ../git-2

Then I opened git-gui in the worktree and clicked the "Create" option 
under the "Branch" menu.

The dialog opened just fine, which I assume is what your error is. But 
just to be sure, I created a branch too, and that also works pretty 
well.

Same behaviour with a "normal" branch, which is not inside a worktree.

So is there anything else in your setup that would cause this problem?

> I don't forget ...
> (I'm chasing down other issue at the moment ;-)
> 
> This is with the version 0.21.GI git version 2.23.0.windows.1 Tcl/Tck 8.6.9
> 
> 
> missing "
> missing "
>     while executing
> "list "refs/heads/redo-v0" [list ""
>     ("eval" body line 1)
>     invoked from within
> "eval $line"
>     (procedure "_new" line 87)
>     invoked from within
> "_new $path 0 $title"
>     (procedure "::choose_rev::new" line 2)
>     invoked from within
> "::choose_rev::new $w.rev [mc "Starting Revision"]"
>     (procedure "branch_create::dialog" line 35)
>     invoked from within
> "branch_create::dialog"
>     (menu invoke)

Looking at the log, the culprit seems to be the line:

  set line [eval $line]

over at lib/choose_rev.tcl:159. The $line comes from reading the output 
of a call to `git for-each-ref` with '--tcl' passed in. Looking at the 
man page for 'for-each-ref', the description of the option is:

  --shell, --perl, --python, --tcl
    If given, strings that substitute %(fieldname) placeholders are 
    quoted as string literals suitable for the specified host language. 
    This is meant to produce a scriptlet that
    can directly be `eval`ed.

So this might possibly me an upstream bug.

If I had to guess a fix, I'd suggest trying to wrap the $line in 
lib/choose_rev.tcl:159 in quotes like so:

  set line [eval "$line"] 

If this doesn't fix it, see if you can find out which $line is causing 
problem by printing the variable before 'eval'ing it by adding a:

  puts "$line"

before the call to eval.

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Gui: Branch->create currently fails...
  2019-10-08  0:00 ` Pratyush Yadav
@ 2019-10-12 20:34   ` Philip Oakley
  2019-10-13 18:50     ` Pratyush Yadav
  0 siblings, 1 reply; 10+ messages in thread
From: Philip Oakley @ 2019-10-12 20:34 UTC (permalink / raw)
  To: Pratyush Yadav; +Cc: Git List

Hi Pratyus,
On 08/10/2019 01:00, Pratyush Yadav wrote:
> On 07/10/19 11:02PM, Philip Oakley wrote:
>> I'd never used the Branch:Create before (this is via mouse) and it threw an
>> error, which appears to be repeatable, so I'm reporting it at the moment so
> I'm afraid I can't reproduce it. I tested by creating a worktree of
> git.git by running:
>
>    git worktree add ../git-2
>
> Then I opened git-gui in the worktree and clicked the "Create" option
> under the "Branch" menu.
>
> The dialog opened just fine, which I assume is what your error is. But
> just to be sure, I created a branch too, and that also works pretty
> well.
>
> Same behaviour with a "normal" branch, which is not inside a worktree.
>
> So is there anything else in your setup that would cause this problem?
>
>> I don't forget ...
>> (I'm chasing down other issue at the moment ;-)
>>
>> This is with the version 0.21.GI git version 2.23.0.windows.1 Tcl/Tck 8.6.9
>>
>>
>> missing "
>> missing "
>>      while executing
>> "list "refs/heads/redo-v0" [list ""
>>      ("eval" body line 1)
>>      invoked from within
>> "eval $line"
>>      (procedure "_new" line 87)
>>      invoked from within
>> "_new $path 0 $title"
>>      (procedure "::choose_rev::new" line 2)
>>      invoked from within
>> "::choose_rev::new $w.rev [mc "Starting Revision"]"
>>      (procedure "branch_create::dialog" line 35)
>>      invoked from within
>> "branch_create::dialog"
>>      (menu invoke)
> Looking at the log, the culprit seems to be the line:
>
>    set line [eval $line]
>
> over at lib/choose_rev.tcl:159. The $line comes from reading the output
> of a call to `git for-each-ref` with '--tcl' passed in. Looking at the
> man page for 'for-each-ref', the description of the option is:
>
>    --shell, --perl, --python, --tcl
>      If given, strings that substitute %(fieldname) placeholders are
>      quoted as string literals suitable for the specified host language.
>      This is meant to produce a scriptlet that
>      can directly be `eval`ed.
>
> So this might possibly me an upstream bug.
>
> If I had to guess a fix, I'd suggest trying to wrap the $line in
> lib/choose_rev.tcl:159 in quotes like so:
>
>    set line [eval "$line"]
>
> If this doesn't fix it, see if you can find out which $line is causing
> problem by printing the variable before 'eval'ing it by adding a:
>
>    puts "$line"
>
> before the call to eval.
>
I've tried both parts and seen that this looks like some form of buffer 
overrun or size limit

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)

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?

Philip

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Gui: Branch->create currently fails...
  2019-10-12 20:34   ` Philip Oakley
@ 2019-10-13 18:50     ` Pratyush Yadav
  2019-10-14 12:45       ` Philip Oakley
  0 siblings, 1 reply; 10+ messages in thread
From: Pratyush Yadav @ 2019-10-13 18:50 UTC (permalink / raw)
  To: Philip Oakley; +Cc: Git List

On 12/10/19 09:34PM, Philip Oakley wrote:
> Hi Pratyus,
> On 08/10/2019 01:00, Pratyush Yadav wrote:
> > On 07/10/19 11:02PM, Philip Oakley wrote:
> > > I'd never used the Branch:Create before (this is via mouse) and it threw an
> > > error, which appears to be repeatable, so I'm reporting it at the moment so
> > I'm afraid I can't reproduce it. I tested by creating a worktree of
> > git.git by running:
> > 
> >    git worktree add ../git-2
> > 
> > Then I opened git-gui in the worktree and clicked the "Create" option
> > under the "Branch" menu.
> > 
> > The dialog opened just fine, which I assume is what your error is. But
> > just to be sure, I created a branch too, and that also works pretty
> > well.
> > 
> > Same behaviour with a "normal" branch, which is not inside a worktree.
> > 
> > So is there anything else in your setup that would cause this problem?
> > 
> > > I don't forget ...
> > > (I'm chasing down other issue at the moment ;-)
> > > 
> > > This is with the version 0.21.GI git version 2.23.0.windows.1 Tcl/Tck 8.6.9
> > > 
> > > 
> > > missing "
> > > missing "
> > >      while executing
> > > "list "refs/heads/redo-v0" [list ""
> > >      ("eval" body line 1)
> > >      invoked from within
> > > "eval $line"
> > >      (procedure "_new" line 87)
> > >      invoked from within
> > > "_new $path 0 $title"
> > >      (procedure "::choose_rev::new" line 2)
> > >      invoked from within
> > > "::choose_rev::new $w.rev [mc "Starting Revision"]"
> > >      (procedure "branch_create::dialog" line 35)
> > >      invoked from within
> > > "branch_create::dialog"
> > >      (menu invoke)
> > Looking at the log, the culprit seems to be the line:
> > 
> >    set line [eval $line]
> > 
> > over at lib/choose_rev.tcl:159. The $line comes from reading the output
> > of a call to `git for-each-ref` with '--tcl' passed in. Looking at the
> > man page for 'for-each-ref', the description of the option is:
> > 
> >    --shell, --perl, --python, --tcl
> >      If given, strings that substitute %(fieldname) placeholders are
> >      quoted as string literals suitable for the specified host language.
> >      This is meant to produce a scriptlet that
> >      can directly be `eval`ed.
> > 
> > So this might possibly me an upstream bug.
> > 
> > If I had to guess a fix, I'd suggest trying to wrap the $line in
> > lib/choose_rev.tcl:159 in quotes like so:
> > 
> >    set line [eval "$line"]
> > 
> > If this doesn't fix it, see if you can find out which $line is causing
> > problem by printing the variable before 'eval'ing it by adding a:
> > 
> >    puts "$line"
> > 
> > before the call to eval.
> > 
> 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.

Other than that, I don't really see a clear fix. So looks like something 
for the back burner.

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Gui: Branch->create currently fails...
  2019-10-13 18:50     ` Pratyush Yadav
@ 2019-10-14 12:45       ` Philip Oakley
  2019-10-14 17:57         ` Pratyush Yadav
  0 siblings, 1 reply; 10+ messages in thread
From: Philip Oakley @ 2019-10-14 12:45 UTC (permalink / raw)
  To: Pratyush Yadav; +Cc: Git List

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Gui: Branch->create currently fails...
  2019-10-14 12:45       ` Philip Oakley
@ 2019-10-14 17:57         ` Pratyush Yadav
  2019-10-14 22:11           ` Philip Oakley
  0 siblings, 1 reply; 10+ messages in thread
From: Pratyush Yadav @ 2019-10-14 17:57 UTC (permalink / raw)
  To: Philip Oakley; +Cc: Git List

On 14/10/19 01:45PM, Philip Oakley wrote:
> Hi Pratyush,
> On 13/10/2019 19:50, Pratyush Yadav wrote:
> > 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.

Ah, so it is an upstream issue. I guess we can just report it and wait 
for them to fix it.

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Gui: Branch->create currently fails...
  2019-10-14 17:57         ` Pratyush Yadav
@ 2019-10-14 22:11           ` Philip Oakley
  2019-10-16 18:52             ` Pratyush Yadav
  0 siblings, 1 reply; 10+ messages in thread
From: Philip Oakley @ 2019-10-14 22:11 UTC (permalink / raw)
  To: Pratyush Yadav; +Cc: Git List

On 14/10/2019 18:57, Pratyush Yadav wrote:
>> 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.
> Ah, so it is an upstream issue. I guess we can just report it and wait
> for them to fix it.
I'd missed the final 'Segmentation fault' on the last line in the bash 
output that wasn't there for the captured file.

That was repeatable in re-testing.
But failed if I changed the $fmt string to a plain text 500 char string 
("1234567890123...").

I've still to trim down the complicated $fmt string to see if I can see 
where that seg fault starts (i.e. some form of MVCE), so that it can be 
investigated.
Possibly should check if the --tcl flag actually invokes any tcl! 
Otherwise it's fully in the Git/G-f-W zone.

...
Just rebuilt (I hope) the Windows Subsystem for Linux (WSL) with git 
v2.23.0 installed and got:

list "refs/heads/MSVC-README" [list "commit" 
"056fb95c8e983ec07e9f5f8baa0b119bf3d13fed" [concat "" "Philip Oakley"] 
[reformat_date [concat "" "Sun May 19 22:33:37 2019 +0100"]] 
"compat/vcbuild/README: clean/update 'vcpkg' env for Visual Studio 
updates"] [list "" "" "" [reformat_date ""] ""]
munmap_chunk(): invalid pointer
Aborted (core dumped)
root@Philip-Win10:/mnt/c/git-sdk-64/usr/src/git#


That said, haven't got the gitk and git gui to work yet on the WSL 
because it doesn't like the tcl/tk.

It's a bit of a hole digging exercise.

Philip


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Gui: Branch->create currently fails...
  2019-10-14 22:11           ` Philip Oakley
@ 2019-10-16 18:52             ` Pratyush Yadav
  2019-10-18 21:05               ` Philip Oakley
  0 siblings, 1 reply; 10+ messages in thread
From: Pratyush Yadav @ 2019-10-16 18:52 UTC (permalink / raw)
  To: Philip Oakley; +Cc: Git List

On 14/10/19 11:11PM, Philip Oakley wrote:
> On 14/10/2019 18:57, Pratyush Yadav wrote:
> > > 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.
> > Ah, so it is an upstream issue. I guess we can just report it and wait
> > for them to fix it.
> I'd missed the final 'Segmentation fault' on the last line in the bash
> output that wasn't there for the captured file.
> 
> That was repeatable in re-testing.
> But failed if I changed the $fmt string to a plain text 500 char string
> ("1234567890123...").
> 
> I've still to trim down the complicated $fmt string to see if I can see
> where that seg fault starts (i.e. some form of MVCE), so that it can be
> investigated.
> Possibly should check if the --tcl flag actually invokes any tcl! Otherwise
> it's fully in the Git/G-f-W zone.

A quick look tells me '--tcl' does not invoke any Tcl. It is just used 
to output properly formatted strings for Tcl. The option sets the value 
of 'format.quote_style' in for-each-ref (builtin/for-each-ref.c:33). 
That value is later indirectly ends up being used in the function 
ref_filter.c::quote_formatting.

The Tcl code we execute comes from the long $fmt string, which is built 
in git-gui/choose_rev.tcl:133-147. `for-each-ref` just fills in the 
placeholder values, properly formatting them for use in Tcl.

As an experiment, you can try removing '--tcl' from the `for-each-ref` 
command that segfaults, just to be sure. It would probably output 
invalid Tcl, but since we don't do anything with that output, it doesn't 
really matter, and would let us know if '--tcl' is really the culprit.

> ...
> Just rebuilt (I hope) the Windows Subsystem for Linux (WSL) with git v2.23.0
> installed and got:
> 
> list "refs/heads/MSVC-README" [list "commit"
> "056fb95c8e983ec07e9f5f8baa0b119bf3d13fed" [concat "" "Philip Oakley"]
> [reformat_date [concat "" "Sun May 19 22:33:37 2019 +0100"]]
> "compat/vcbuild/README: clean/update 'vcpkg' env for Visual Studio updates"]
> [list "" "" "" [reformat_date ""] ""]
> munmap_chunk(): invalid pointer

A quick Google search tells me munmap_chunk() is probably related to an 
invalid pointer being freed. Either a double free or a free on a pointer 
not allocated by malloc or something similar.

> Aborted (core dumped)
> root@Philip-Win10:/mnt/c/git-sdk-64/usr/src/git#
> 
> 
> That said, haven't got the gitk and git gui to work yet on the WSL because
> it doesn't like the tcl/tk.
> 
> It's a bit of a hole digging exercise.

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Git Gui: Branch->create currently fails...
  2019-10-16 18:52             ` Pratyush Yadav
@ 2019-10-18 21:05               ` Philip Oakley
  0 siblings, 0 replies; 10+ messages in thread
From: Philip Oakley @ 2019-10-18 21:05 UTC (permalink / raw)
  To: Pratyush Yadav; +Cc: Git List

Hi Pratyush

On 16/10/2019 19:52, Pratyush Yadav wrote:
> On 14/10/19 11:11PM, Philip Oakley wrote:
>> On 14/10/2019 18:57, Pratyush Yadav wrote:
>>>> 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.
>>> Ah, so it is an upstream issue. I guess we can just report it and wait
>>> for them to fix it.
>> I'd missed the final 'Segmentation fault' on the last line in the bash
>> output that wasn't there for the captured file.
>>
>> That was repeatable in re-testing.
>> But failed if I changed the $fmt string to a plain text 500 char string
>> ("1234567890123...").
>>
>> I've still to trim down the complicated $fmt string to see if I can see
>> where that seg fault starts (i.e. some form of MVCE), so that it can be
>> investigated.
>> Possibly should check if the --tcl flag actually invokes any tcl! Otherwise
>> it's fully in the Git/G-f-W zone.
> A quick look tells me '--tcl' does not invoke any Tcl. It is just used
> to output properly formatted strings for Tcl. The option sets the value
> of 'format.quote_style' in for-each-ref (builtin/for-each-ref.c:33).
> That value is later indirectly ends up being used in the function
> ref_filter.c::quote_formatting.
>
> The Tcl code we execute comes from the long $fmt string, which is built
> in git-gui/choose_rev.tcl:133-147. `for-each-ref` just fills in the
> placeholder values, properly formatting them for use in Tcl.
>
> As an experiment, you can try removing '--tcl' from the `for-each-ref`
> command that segfaults, just to be sure. It would probably output
> invalid Tcl, but since we don't do anything with that output, it doesn't
> really matter, and would let us know if '--tcl' is really the culprit.
Command reminder:
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 --format="$fmt" --sort=-taggerdate refs/heads 
refs/remotes refs/tags
-
Removing the '--tcl' still seg faults.

Removing the  --sort=-taggerdate  *stops* the segfault.

Removing instead the final 'refs/tags' (i.e. a shorter list) also 
*stops* the seg fault (still with the --sort=..)

If instead I drop the initial refs/heads (a limited number of branch 
heads!) it segfaults (still with --sort) so looks like it's a size issue.

Alternative approach - trim the fmt string, dropping all the '*' types.
$ fmt='list %(refname) [list %(objecttype) %(objectname) [concat 
%(taggername) %(authorname)] [reformat_date [concat %(taggerdate) 
%(authordate)]] %(subject)]'

The full for-each-ref command now works, BUT the last line of output is 
short, rather than being a seg fault. (with or without the --sortdate)

so all in all rather weird. Sometimes it seg faults and sometimes it 
simply terminates early.
>> ...
>> Just rebuilt (I hope) the Windows Subsystem for Linux (WSL) with git v2.23.0
>> installed and got:
>>
>> list "refs/heads/MSVC-README" [list "commit"
>> "056fb95c8e983ec07e9f5f8baa0b119bf3d13fed" [concat "" "Philip Oakley"]
>> [reformat_date [concat "" "Sun May 19 22:33:37 2019 +0100"]]
>> "compat/vcbuild/README: clean/update 'vcpkg' env for Visual Studio updates"]
>> [list "" "" "" [reformat_date ""] ""]
>> munmap_chunk(): invalid pointer
> A quick Google search tells me munmap_chunk() is probably related to an
> invalid pointer being freed. Either a double free or a free on a pointer
> not allocated by malloc or something similar.
>
>> Aborted (core dumped)
>> root@Philip-Win10:/mnt/c/git-sdk-64/usr/src/git#
>>
>>
>> That said, haven't got the gitk and git gui to work yet on the WSL because
>> it doesn't like the tcl/tk.
>>
>> It's a bit of a hole digging exercise.
The hole that keeps digging...
P.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-10-18 21:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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