Re: [PATCH] diff: avoid segfault with freed entries
From: Kristoffer Haugsbakk <hidden>
Date: 2025-12-30 16:11:30
On Mon, Dec 29, 2025, at 22:44, Derrick Stolee via GitGitGadget wrote:
From: Derrick Stolee <redacted> [snip] The more elaborate explanation is that within diffcore_std(), we may skip the initial prefetch due to the output format (--name-only in the test) and go straight to diffcore_skip_stat_unmatch(). In that method, the index entries that have been invalidated by path changes show up as entries but may be deleted because they are not actually content diffs and only newer timestamps than expected. As those entries are deleted, later entries are checked with diff_filespec_check_stat_unmatch(), which uses diff_queued_diff_prefetch() as the missing_object_cb in its diff options. That can trigger downloading missing objects if the appropriate scenario occurs to trigger a call to diff_popoulate_filespec(). It's
s/diff_popoulate_filespec/diff_populate_filespec/
finally within that callback to diff_queued_diff_prefetch() that the segfault occurs. [snip]