Git 1.6.5-rc git clone unhandled exception using http protocol
I've tried Git 1.6.5 release candidates (rc1, rc2, rc3) with msysGit, and "git clone git://github.com/loudej/spark.git" it's working, but "git clone http://github.com/loudej/spark.git" crashes with an Win32 unhandled exception.
I have tried to create an empty repository and run both
"git remote-curl http://github.com/loudej/spark.git"
and "git remote-curl" , but it crashes with the same error.
How can I obtain more information about the error?
BTW, Git 1.6.4.4 is working over both protocols, on Windows Server 2008 SP2 x86, using the same msysGit (msysGit-fullinstall-1.6.4-preview20090729.exe).
Have a nice day,
A.
Hi,
Quoted 1 line · eduard stefan
How can I obtain more information about the error?
How are you executing the git commands? From the windows command line? From the msys bash shell? Could you copy and paste the output of git when cloning the repo?
How about the win32 exception? What does it say? Does it display as a dialog?
Signature · 2 lines
Cheers, Ray Chuan
Quoted 11 lines · Tay Ray Chuan
Hi,
Quoted 4 lines · eduard stefan
I attached three screenshots of the msys shell,
it doesn't matter what url is used,
and git remote-curl doesn't crash when run in a non-git repository, but as soon as I create an empty repo, it crashes just like git clone http://...that's not how you use remote-curl.
Cloning a bogus repository (http://test.com/sample.git) isn't a good idea too.
I was just trying to point that the URL used is not relevant, as long as the protocol used is URL, then it crashes.
Quoted 2 lines
Could you show me the screenshot of you cloning
http://github.com/loudej/spark.git?
Done.
Have a nice day,
A.
Hi,
Quoted 2 lines · eduard stefan
I was just trying to point that the URL used is not relevant, as long as the protocol used is URL, then it crashes.
ok.
I suspect, as you do, it's got to do with remote-curl.
Could you try this command?
echo list | git remote-curl http://github.com/loudej/spark.git
On my machine, I get
@refs/heads/master HEAD f192d3de483f2e7f38eebf84c8f1bbc8c4b5f185 refs/heads/gh-pages 2a0cd31d8706ec2d8cc5d7b49873cc24621b20af refs/heads/installers 10526926014eb2d89c2b449f1e29f4df7ab620bd refs/heads/master 7f36b2caf2f01566bd58f9304d6ad5c36ae280ce refs/heads/mono 80fc2424ebf082265c66bd6e0637c74744742b49 refs/heads/spark-1.1 62d62d5c183dd22cdf9491999291047add05c722 refs/heads/spike-1.1 d85abb61563e7f4f372c7e0418da0f20c49baf48 refs/tags/v1.0.39890-RC1 db9d3380c39284695added69edab46c2ddab2f48 refs/tags/v1.0.39917-RC2 70c418dd806a4eb7f32fa6fe710c9a5967ddef32 refs/tags/v1.0.39935
Signature · 2 lines
Cheers, Ray Chuan
Quoted 5 lines · Tay Ray Chuan
I suspect, as you do, it's got to do with remote-curl.
Could you try this command?
echo list | git remote-curl http://github.com/loudej/spark.git
Inside an empty repository it crashes the same way, without any additional information.
"git remote-curl" crashes in the same way,
but "git remote-curl --help" tries to launch the browser.
Is there any way to obtain more information from this crash? Some debug mode?
Have a nice day,
A.
Hi,
Quoted 11 lines · eduard stefan
Quoted 5 lines · Tay Ray Chuan
I suspect, as you do, it's got to do with remote-curl.
Could you try this command?
echo list | git remote-curl http://github.com/loudej/spark.git
Inside an empty repository it crashes the same way, without any additional information.
"git remote-curl" crashes in the same way,
but "git remote-curl --help" tries to launch the browser.
just to check, running
echo list | git remote-curl http://github.com/loudej/spark.git
and
git clone http://github.com/loudej/spark.git
both gives the same error message:
An unhandled win32 exception occurred in git-remote-curl.exe [5820]. Just-In-Time debugging this exception failed with the following
error: No installed debugger has Just-In-Time debugging enabled. In Visual Studio, Just-In-Time debugging can be enabled from Tools/Options/Debugging/Just-In-Time.
Check the documentation index for 'Just-in-time debugging, errors' for more information.
in a dialog?
Quoted 2 lines
Is there any way to obtain more information from this crash? Some debug mode?
I'm assuming you're using the Microsoft Visual Studio development tools to compile git from the source. I'm cc'ing this to the msysgit mailing list, perhaps someone familiar with them can advise you further.
Signature · 2 lines
Cheers, Ray Chuan
Quoted 21 lines · Tay Ray Chuan
just to check, running
echo list | git remote-curl http://github.com/loudej/spark.git
and
git clone http://github.com/loudej/spark.git
both gives the same error message:
An unhandled win32 exception occurred in git-remote-curl.exe [5820]. Just-In-Time debugging this exception failed with the following
error: No installed debugger has Just-In-Time debugging enabled. In Visual Studio, Just-In-Time debugging can be enabled from Tools/Options/Debugging/Just-In-Time.Check the documentation index for 'Just-in-time debugging, errors' for more information.
in a dialog?
Quoted 8 lines
Quoted 2 lines
Is there any way to obtain more information from this crash? Some debug mode?
I'm assuming you're using the Microsoft Visual Studio development tools to compile git from the source. I'm cc'ing this to the msysgit mailing list, perhaps someone familiar with them can advise you further.
Git was compiled with msysGit, the errors are generated inside msysGit shell, and VS2008 debugger gives this message:
"Unhandled exception at 0x00420354 in git-remote-curl.exe:
0xC0000005: Access violation reading location 0x00000000."
Have a nice day,
Eduard
Re: Git 1.6.5 git clone unhandled exception using http protocol
Quoted 5 lines
Git was compiled with msysGit, the errors are generated inside msysGit shell, and VS2008 debugger gives this message:
"Unhandled exception at
0x00420354in git-remote-curl.exe:
0xC0000005: Access violation reading location0x00000000."
As a sidenote, 1.6.5 release crashes the same way.
After applying Shawn O. Pearce "Return of smart HTTP" patch series, it no longer crashes, and "git clone http://github.com/loudej/spark.git" returns "error: Unable to get pack file
http://github.com/loudej/spark.git/objects/pack/
pack-1bc121e71e2847622f814603ddb34444bfc6a16c.pack
The requested URL returned error: 502"
which seems to be more like a GitHub problem.
OTOH, cloning a local repositor serverd with mongoose works as expected:
"git clone http://192.168.194.24/test.git/"
Have a nice day,
Eduard
2009/10/11 eduard stefan <[email protected]>:
Quoted 7 lines
Quoted 5 lines · Tay Ray Chuan
I suspect, as you do, it's got to do with remote-curl.
Could you try this command?
echo list | git remote-curl http://github.com/loudej/spark.git
Quoted 7 lines
Inside an empty repository it crashes the same way, without any additional information.
"git remote-curl" crashes in the same way,
but "git remote-curl --help" tries to launch the browser.Is there any way to obtain more information from this crash? Some debug mode?
Using the above repository, I see the same crash with msysGit at git revision 1.6.5. Using windbg as the post-mortem debugger, the following information is captured:
(a14.e8c): Access violation - code c0000005 (!!! second chance !!!) eax=00000000 ebx=00000000 ecx=ffffffff edx=0046cc00 esi=0046f98f edi=00000000
eip=00420354 esp=0022fd80 ebp=0022fda8 iopl=0 nv up ei pl zr na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010246
...and the faulting instruction is:
git_remote_curl+0x20354:
00420354 f2ae repne scas byte ptr es:[edi]
so, a NULL dereference. The initial disassembly of the function is this:
0:000> u 0042033C
git_remote_curl+0x2033c:
0042033c 55 push ebp 0042033d 89e5 mov ebp,esp 0042033f 57 push edi 00420340 56 push esi 00420341 53 push ebx 00420342 83ec1c sub esp,1Ch 00420345 8b5d08 mov ebx,dword ptr [ebp+8] 00420348 8b750c mov esi,dword ptr [ebp+0Ch] 0042034b 31c0 xor eax,eax 0042034d b9ffffffff mov ecx,0FFFFFFFFh 00420352 89df mov edi,ebx 00420354 f2ae repne scas byte ptr es:[edi] 00420356 f7d1 not ecx 00420358 8d51ff lea edx,[ecx-1] 0042035b b9ffffffff mov ecx,0FFFFFFFFh 00420360 89f7 mov edi,esi 00420362 f2ae repne scas byte ptr es:[edi] 00420364 f7d1 not ecx 00420366 49 dec ecx 00420367 7466 je git_remote_curl+0x203cf (004203cf) 00420369 85d2 test edx,edx 0042036b 0f84b1000000 je git_remote_curl+0x20422 (00420422) 00420371 89f7 mov edi,esi 00420373 89de mov esi,ebx
...
So its the first parameter that is NULL. The second parameter is:
0:000> da poi(ebp+c)
0046f98f "libexec/git-core"
I don't know how to build msysGit so that symbols are generated so I've attempted to reconstruct the source code; which ends up looking something like the following:
int some_unknown_func(char *arg1, char *arg2)
{
len1 = strlen(arg1) - 1; // <- crash here
len2 = strlen(arg2);
len3 = len2 - 1; if (len2 != 1) {
if (!len1)
return 0;
for (;;) {
x = arg1[len1 - 1];
if (x != '/' && x != '\\') {
--len1;
--len3;
if (arg1[len1] != arg2[len3])
return 0;
} else {
...
}
}
}}
Perhaps those more familiar with git's sources might recognise code that looks similar to the above sequence.
Quoted 75 lines · Michael Wookey
Using the above repository, I see the same crash with msysGit at git revision 1.6.5. Using windbg as the post-mortem debugger, the following information is captured:
(a14.e8c): Access violation - code
c0000005(!!! second chance !!!) eax=00000000 ebx=00000000 ecx=ffffffff edx=0046cc00 esi=0046f98f edi=00000000
eip=00420354 esp=0022fd80 ebp=0022fda8 iopl=0 nv up ei pl zr na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010246...and the faulting instruction is:
git_remote_curl+0x20354:
00420354 f2ae repne scas byte ptr es:[edi]so, a NULL dereference. The initial disassembly of the function is this:
0:000> u 0042033C
git_remote_curl+0x2033c:0042033c 55 push ebp 0042033d 89e5 mov ebp,esp 0042033f 57 push edi 00420340 56 push esi 00420341 53 push ebx 00420342 83ec1c sub esp,1Ch 00420345 8b5d08 mov ebx,dword ptr [ebp+8] 00420348 8b750c mov esi,dword ptr [ebp+0Ch] 0042034b 31c0 xor eax,eax 0042034d b9ffffffff mov ecx,0FFFFFFFFh 00420352 89df mov edi,ebx 00420354 f2ae repne scas byte ptr es:[edi] 00420356 f7d1 not ecx 00420358 8d51ff lea edx,[ecx-1] 0042035b b9ffffffff mov ecx,0FFFFFFFFh 00420360 89f7 mov edi,esi 00420362 f2ae repne scas byte ptr es:[edi] 00420364 f7d1 not ecx 00420366 49 dec ecx 00420367 7466 je git_remote_curl+0x203cf (004203cf) 00420369 85d2 test edx,edx 0042036b 0f84b1000000 je git_remote_curl+0x20422 (00420422) 00420371 89f7 mov edi,esi 00420373 89de mov esi,ebx...
So its the first parameter that is NULL. The second parameter is:
0:000> da poi(ebp+c)
0046f98f"libexec/git-core"I don't know how to build msysGit so that symbols are generated so I've attempted to reconstruct the source code; which ends up looking something like the following:
int some_unknown_func(char *arg1, char *arg2) { len1 = strlen(arg1) - 1; // <- crash here len2 = strlen(arg2); len3 = len2 - 1;if (len2 != 1) { if (!len1) return 0; for (;;) { x = arg1[len1 - 1]; if (x != '/' && x != '\\') { --len1; --len3; if (arg1[len1] != arg2[len3]) return 0; } else { ... } } }
Quoted 4 lines
}
Perhaps those more familiar with git's sources might recognise code that looks similar to the above sequence.
Wow, this is great work, thank you very much! The function is strip_path_suffix(). And here is a patch that fixes the crash.
--- >8 ---
From: Johannes Sixt <[email protected]>
Subject: [PATCH] remote-curl: add missing initialization of argv0_path
All programs, in particular also the stand-alone programs (non-builtins) must call git_extract_argv0_path(argv[0]) in order to help builds that derive the installation prefix at runtime, such as the MinGW build. Without this call, the program segfaults (or raises an assertion failure).
--- remote-curl.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
remote-curl.c +1 -0
@@ -82,6 +82,7 @@ int main(int argc, const char **argv)const char *url;struct walker *walker =NULL ; +git_extract_argv0_path (argv[0 ]);setup_git_directory ();if (argc <2 ) {fprintf (stderr,"Remote needed\n" );
Signature · 1 line
1.6.5.1024.g31034.dirty
Michael Wookey
Tested-by2009/10/13 Johannes Sixt <[email protected]>:
Quoted 36 lines
Quoted 4 lines · Michael Wookey
Using the above repository, I see the same crash with msysGit at git revision 1.6.5. Using windbg as the post-mortem debugger, the following information is captured:
[ ... snip ... ]Wow, this is great work, thank you very much! The function is
strip_path_suffix(). And here is a patch that fixes the crash.--- >8 ---
From: Johannes Sixt <[email protected]>
Subject: [PATCH] remote-curl: add missing initialization ofargv0_pathAll programs, in particular also the stand-alone programs (non-builtins) must call
git_extract_argv0_path(argv[0])in order to help builds that derive the installation prefix at runtime, such as the MinGW build. Without this call, the program segfaults (or raises an assertion failure).Signed-off-by Johannes Sixt <[email protected]>---
remote-curl.c | 1 +1 files changed, 1 insertions(+), 0 deletions(-)remote-curl.c +1
-1@@ -82,6 +82,7 @@ int main(int argc, const char **argv) const char *url; struct walker *walker = NULL; + git_extract_argv0_path(argv[0]); setup_git_directory(); if (argc < 2) { fprintf(stderr, "Remote needed\n"); --
Quoted 1 line
1.6.5.1024.g31034.dirty
No more crashes for me :)
Quoted 32 lines · Michael Wookey
2009/10/13 Johannes Sixt <[email protected]>:
Quoted 31 lines
Quoted 4 lines · Michael Wookey
Using the above repository, I see the same crash with msysGit at git revision 1.6.5. Using windbg as the post-mortem debugger, the following information is captured:
[ ... snip ... ]Wow, this is great work, thank you very much! The function is
strip_path_suffix(). And here is a patch that fixes the crash.--- >8 ---
From: Johannes Sixt <[email protected]>
Subject: [PATCH] remote-curl: add missing initialization ofargv0_pathAll programs, in particular also the stand-alone programs (non-builtins) must call
git_extract_argv0_path(argv[0])in order to help builds that derive the installation prefix at runtime, such as the MinGW build. Without this call, the program segfaults (or raises an assertion failure).Signed-off-by Johannes Sixt <[email protected]>---
remote-curl.c | 1 +1 files changed, 1 insertions(+), 0 deletions(-)remote-curl.c +0
-0@@ -82,6 +82,7 @@ int main(int argc, const char **argv) const char *url; struct walker *walker = NULL;
Quoted 8 lines
Quoted 6 lines
remote-curl.c +1
-1+ git_extract_argv0_path(argv[0]); setup_git_directory(); if (argc < 2) { fprintf(stderr, "Remote needed\n"); --1.6.5.1024.g31034.dirty
No more crashes for me :)
Beautiful. Thanks, both of you!