Re: [BUG REPORT] git fetch --prefetch with incorrect options hangs with 2.47.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 11, 2024 at 10:15:44PM +0000, Eric Mills wrote:

> What did you do before the bug happened? (Steps to reproduce your issue)
> I ran `git fetch --prefetch origin main` with git 2.47 on both my
> Windows machine (2.47.windows.2) and my Mac (2.47.0) and it hangs.
> 
> When I downgrade, same command succeeds on
> 2.46.2.Windows.1 / 2.46.2 (macOS).
> [...]
> On Windows, I don't get an error. It hangs indefinitely.
> On macOS, after a few seconds I got the following:
> 
> git(84051,0x20171cf40) malloc: *** error for object 0x600001978390:
> pointer being freed was not allocated
> 
> git(84051,0x20171cf40) malloc: *** set a breakpoint in
> malloc_error_break to debug

Thanks for the report. I see similar heap corruption problems on Linux.
Building with ASan shows a double-free:

  ==646934==ERROR: AddressSanitizer: attempting double-free on 0x502000002450 in thread T0:
      #0 0x7f9ab1cf3918 in free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:52
      #1 0x557a1d8082c2 in refspec_clear /home/peff/compile/git/refspec.c:228
      #2 0x557a1ce92a08 in fetch_one builtin/fetch.c:2136
      #3 0x557a1ce9889d in cmd_fetch builtin/fetch.c:2443
      #4 0x557a1cd2e1ca in run_builtin /home/peff/compile/git/git.c:483
      #5 0x557a1cd2f2d8 in handle_builtin /home/peff/compile/git/git.c:749
      #6 0x557a1cd2fb3a in run_argv /home/peff/compile/git/git.c:819
      #7 0x557a1cd30e66 in cmd_main /home/peff/compile/git/git.c:954
      #8 0x557a1d1370c1 in main /home/peff/compile/git/common-main.c:64
      #9 0x7f9ab1233d67 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
      #10 0x7f9ab1233e24 in __libc_start_main_impl ../csu/libc-start.c:360
      #11 0x557a1cd27290 in _start (/home/peff/compile/git/git+0x129d290) (BuildId: cca88fc4d05f503e4aecc54e9437a56865d5eca1)

Bisecting on:

  make SANITIZE=address &&
  bin-wrappers/git fetch --prefetch origin master

turns up my ea4780307c (fetch: free "raw" string when shrinking refspec,
2024-09-24). I'll see if I can figure out what's going on.

-Peff




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux