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

Re: t5702 failing under ASan on master

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jan 30, 2019, 11:40 UTC
Message-ID
<20190130114016.GD24387@genre.crustytoothpaste.net>
In-Reply-To
<CACsJy8AVoETLkB5rLft27Rz7V9xPFN9fk=8g9-fCR61fVi4vjw@mail.gmail.com>
On Wed, Jan 30, 2019 at 05:07:20PM +0700, Duy Nguyen wrote:
Show 6 quoted lines
> 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.

Show 8 quoted lines
> 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
Previous: Duy NguyenNext: Junio C Hamano
Message 3 of 13 in “t5702 failing under ASan on master”
  1. brian m. carlsonJan 30, 2019
  2. Duy NguyenJan 30, 2019
  3. brian m. carlsonJan 30, 2019
  4. Junio C HamanoJan 31, 2019
  5. fetch-pack: clear alternate shallow when completebrian m. carlson, Feb 4, 2019
  6. Duy NguyenFeb 4, 2019
  7. Jonathan TanFeb 5, 2019
  8. brian m. carlsonFeb 6, 2019
  9. fetch-pack: clear alternate shallow when completebrian m. carlson, Feb 6, 2019
  10. Duy NguyenFeb 7, 2019
  11. Junio C HamanoFeb 7, 2019
  12. Junio C HamanoFeb 7, 2019
  13. brian m. carlsonFeb 7, 2019

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.