Re: Segmentation fault within git read-tree

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

 



On Sun, Jan 15, 2023 at 12:53:25PM +0100, Christian Couder wrote:

> From a very quick look, it seems that in setup_traverse_info() in
> tree-walk.c we do:
> 
>     static struct traverse_info dummy;
> ...
>     if (pathlen)
>         info->prev = &dummy;
> 
> but then later in debug_path() in unpack-trees.c we check
> *info->prev->name which segfaults.
> 
> I am not very familiar with this code and don't have much time right
> now, so I think I will leave it to others to investigate this further.

I'm not sure if Frédéric is seeing another segfault in practice (when
not using --debug-unpack), but yeah, it is very easy to trigger this
segfault. It does not even have to do with sparse checkouts, etc. Here's
an even more minimal example:

  git init repo
  cd repo
  touch file
  git add file
  git commit -m added
  git read-tree --debug-unpack --prefix=subtree HEAD

I was going to bisect, but it looks like it was broken all the way back
to Junio's ba655da537 (read-tree --debug-unpack, 2009-09-14).

-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