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. > PS. No idea how ASan blames your series for this. Yeah maybe memory > layout and stuff. But it does spot a real problem. I don't doubt this is a problem. We'll definitely want to fix it before the release, since if I see it in development, somebody will likely see it in production. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204
Attachment:
signature.asc
Description: PGP signature