Subject: [test failure] Re: t4114 binary file becomes symlink

From: Nicolas Sebrecht <[email-masked]>
Date: Sat, 18 Jul 2009 16:16:58 +0200

The 18/07/09, Jeff King wrote:
> On Sat, Jul 18, 2009 at 03:45:51PM +0200, Nicolas Sebrecht wrote:
> 
> > Running 'sh t4114-apply-typechange.sh --verbose --debug' fails since its
> > introduction by b67b9612e1a90ae093445abeaeff930e9f4cf936 with this
> > output:
> > 
> > 
> >    * expecting success: 
> >    	git checkout -f foo-becomes-binary &&
> >    	git diff-tree -p --binary HEAD foo-symlinked-to-bar > patch &&
> >    	git apply --index < patch
> >    	
> >    ./test-lib.sh: line 234: 26816 Segmentation fault      git checkout -f
> >    foo-becomes-binary
> 
> Sorry, I can't reproduce here (I tried v1.6.3 and the current
> 'next'). The tests pass just fine with --debug (which, IIRC, doesn't
> actually do much). What is the exact commit you're seeing it fail on?

It fails on:
  - next
  - v1.6.3
  - b67b9612e1a90ae093445abeaeff930e9f4cf936
  - (other I don't remember, but does it really matter?)

> Can you try running it under gdb to get a stack trace? If you have
> valgrind installed, can you run the test script with --valgrind?

$ sh t4114-apply-typechange.sh --valgrind

<snip>

* expecting success: 
	git checkout -f foo-becomes-binary &&
	git diff-tree -p --binary HEAD foo-symlinked-to-bar > patch &&
	git apply --index < patch
	
==10807== Invalid read of size 1
==10807==    at 0x4C22349: strlen (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
==10807==    by 0x5616ED6: vfprintf (in /lib64/libc-2.8.so)
==10807==    by 0x563C159: vsnprintf (in /lib64/libc-2.8.so)
==10807==    by 0x495E90: git_vsnprintf (snprintf.c:38)
==10807==    by 0x48917B: strbuf_addf (strbuf.c:203)
==10807==    by 0x412AA0: cmd_checkout (builtin-checkout.c:364)
==10807==    by 0x404222: handle_internal_command (git.c:243)
==10807==    by 0x404466: main (git.c:483)
==10807==  Address 0x1 is not stack'd, malloc'd or (recently) free'd
{
   <insert a suppression name here>
   Memcheck:Addr1
   fun:strlen
   fun:vfprintf
   fun:vsnprintf
   fun:git_vsnprintf
   fun:strbuf_addf
   fun:cmd_checkout
   fun:handle_internal_command
   fun:main
}
==10807== 
==10807== Process terminating with default action of signal 11 (SIGSEGV)
==10807==  Access not within mapped region at address 0x1
==10807==    at 0x4C22349: strlen (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
==10807==    by 0x5616ED6: vfprintf (in /lib64/libc-2.8.so)
==10807==    by 0x563C159: vsnprintf (in /lib64/libc-2.8.so)
==10807==    by 0x495E90: git_vsnprintf (snprintf.c:38)
==10807==    by 0x48917B: strbuf_addf (strbuf.c:203)
==10807==    by 0x412AA0: cmd_checkout (builtin-checkout.c:364)
==10807==    by 0x404222: handle_internal_command (git.c:243)
==10807==    by 0x404466: main (git.c:483)
==10807==  If you believe this happened as a result of a stack overflow in your
==10807==  program's main thread (unlikely but possible), you can try to increase
==10807==  the size of the main thread stack using the --main-stacksize= flag.
==10807==  The main thread stack size used in this run was 8388608.
* FAIL 8: binary file becomes symlink

<snip>

$

-- 
Nicolas Sebrecht