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

Re: [PATCH 0/2] fast-import input string handling bugs

From
Elijah Newren <newren@gmail.com>
Date
Aug 26, 2019, 19:18 UTC
Message-ID
<CABPp-BHAweswaAV+Qv_=SCQk7fr2s5fH=cEqzuz5N8OMD8=mOA@mail.gmail.com>
In-Reply-To
<20190825080640.GA31453@sigill.intra.peff.net>
On Sun, Aug 25, 2019 at 1:06 AM Jeff King <peff@peff.net> wrote:
Show 15 quoted lines
>
> On Sun, Aug 25, 2019 at 02:57:48AM -0400, Jeff King wrote:
>
> > And I think this is actually a real bug in the current code! We keep a
> > pointer to the encoding string, which survives because of the history.
> > But that history is bounded, and we could have an indefinite number of
> > changed files in the middle. If I modify t9300 like this:
>
> Here are two patches. The first fixes the existing bug with "encoding",
> and the second uses the approach I suggested to fix the leak you
> noticed.
>
> The second one does carry a greater risk of regression than your patch,
> but I think it's worth it for the fact that it makes any other bugs
> (like the "encoding" one) more obvious.

I agree, both patches look good to me, and I particularly appreciate some extra help to avoid making the same mistake again. :-)

Just for good measure, I also went and tested these patches by running the git filter-repo testsuite and by re-running the filter-repo timing cases at https://public-inbox.org/git/CABPp-BGOz8nks0+Tdw5GyGqxeYR-3FF6FT5JcgVqZDYVRQ6qog@mail.gmail.com/.

While filter-repo only uses a subset of fast-export functionality, it tests it with a variety of weird and unusual tiny test repos. And the timing cases run on three real-world repositories (git, rails, and linux). Everything looks good on all of these testcases.

Previous: Junio C HamanoNext: René Scharfe
Message 14 of 15 in “fast-import: Reinitialize command_buf rather than detach it.”
  1. fast-import: Reinitialize command_buf rather than detach it.Mike Hommey, Aug 25, 2019
  2. Jeff KingAug 25, 2019
  3. Mike HommeyAug 25, 2019
  4. Jeff KingAug 25, 2019
  5. 0/2 fast-import input string handling bugsJeff King, Aug 25, 2019
  6. 1/2 fast-import: duplicate parsed encoding stringJeff King, Aug 25, 2019
  7. Elijah NewrenAug 26, 2019
  8. Jeff KingAug 26, 2019
  9. 2/2 fast-import: duplicate into history rather than passing ownershipJeff King, Aug 25, 2019
  10. Mike HommeyAug 25, 2019
  11. René ScharfeAug 25, 2019
  12. Jeff KingAug 26, 2019
  13. Junio C HamanoAug 26, 2019
  14. Elijah NewrenAug 26, 2019
  15. René ScharfeAug 25, 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.