"brian m. carlson" <sandals@xxxxxxxxxxxxxxxxxxxx> writes: > On Wed, Jan 30, 2019 at 05:07:20PM +0700, Duy Nguyen wrote: >> If I understand ASan report correctly alternate_shallow_file memory is >> already gone after the first fetch, when we update the shallow file. >> But we're doing two fetches in the same process (the tag backfill >> thingy), the second fetch reuses the dangling alternate_shallow_file >> pointer and ASan caught it. Resetting the variable seems like the >> right way to go. > > Ah, I think I was missing the fact that we're doing a tag backfill. That > explains a lot. > >> But should we reset it to an empty string? We would pass >> "--shallow-file=" to "git index-pack", which is treated as "no shallow >> file" (i.e. complete repo). This sounds wrong because this is still a >> shallow repository. >> >> I suppose setting alternate_shallow_file to NULL would be ok. "git >> index-pack" will just go back to reading $GIT_DIR/info/shallow, which >> has been updated and contains correct info. > > Yeah, that sounds like a better choice. I'll send a complete patch which > does this. Thanks, both.