git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git write-tree segfault with core.untrackedCache true and nonexistent index

From
Joey Hess <id@joeyh.name>
Date
Jul 22, 2022, 17:24 UTC
Message-ID
<YtrdPguYs3a3xekv@kitenet.net>
	joey@darkstar:/tmp>git init emptyrepo
	Initialized empty Git repository in /tmp/emptyrepo/.git/
	joey@darkstar:/tmp>cd emptyrepo/
	joey@darkstar:/tmp/emptyrepo>git config core.untrackedCache true
	joey@darkstar:/tmp/emptyrepo>git write-tree
	Segmentation fault

I'm seeing this with git 2.37, 2.37.1, and HEAD. 2.36.1 does not have the problem.

Note that the index file does not exist prior to git write-tree in the above test case. When the index does exist, it doesn't segfault. Before, it would just generate the empty tree when the index did not exist.

Bisecting, e6a653554bb49c26d105f3b478cbdbb1c0648f65 is the first bad commit
commit e6a653554bb49c26d105f3b478cbdbb1c0648f65
Author: Tao Klerks <tao@klerks.biz>
Date:   Thu Mar 31 16:02:15 2022 +0000
    untracked-cache: support '--untracked-files=all' if configured
-- 
see shy jo
Next: Martin Ågren
Message 1 of 6 in “git write-tree segfault with core.untrackedCache true and nonexistent index”
  1. Joey HessJul 22, 2022
  2. Martin ÅgrenJul 22, 2022
  3. Junio C HamanoJul 22, 2022
  4. read-cache: make `do_read_index()` always set up `istate->repo`Martin Ågren, Jul 22, 2022
  5. Junio C HamanoJul 22, 2022
  6. Martin ÅgrenJul 22, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.