-
Notifications
You must be signed in to change notification settings - Fork 164
sparse-index: copy dir_hash in ensure_full_index() #1017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Copy the 'index_state->dir_hash' back to the real istate after expanding a sparse index. A crash was observed in 'git status' during some hashmap lookups with corrupted hashmap entries. During an index expansion, new cache-entries are added to the 'index_state->name_hash' and the 'dir_hash' in a temporary 'index_state' variable 'full'. However, only the 'name_hash' hashmap from this temp variable was copied back into the real 'istate' variable. The original copy of the 'dir_hash' was incorrectly preserved. If the table in the 'full->dir_hash' hashmap were realloced, the stale version (in 'istate') would be corrupted. The test suite does not operate on index sizes sufficiently large to trigger this reallocation, so they do not cover this behavior. Increasing the test suite to cover such scale is fragile and likely wasteful. Signed-off-by: Jeff Hostetler <[email protected]> Signed-off-by: Derrick Stolee <[email protected]>
|
/submit |
|
Submitted as [email protected] To fetch this version into To fetch this version to local tag |
|
On the Git mailing list, Derrick Stolee wrote (reply to this): |
|
On the Git mailing list, Johannes Schindelin wrote (reply to this): |
|
User |
|
On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this): |
|
User |
|
On the Git mailing list, Elijah Newren wrote (reply to this): |
|
On the Git mailing list, Jeff Hostetler wrote (reply to this): |
|
On the Git mailing list, Derrick Stolee wrote (reply to this): |
|
This branch is now known as |
|
This patch series was integrated into seen via git@e71d489. |
|
There was a status update in the "New Topics" section about the branch The sparse-index support can corrupt the index structure by storing a stale and/or uninitialized data, which has been corrected. Will merge to 'next'. |
|
This patch series was integrated into seen via git@2cc2237. |
|
This patch series was integrated into seen via git@2b0051d. |
|
This patch series was integrated into next via git@5ee2615. |
This fix is an issue we discovered in our first experimental release of the sparse index in the microsoft/git fork. We fixed it in the latest experimental release [1] and then I almost forgot about it until we started rebasing sparse-index work on top of the 2.33.0 release candidates.
[1] https://github.com/microsoft/git/releases/tag/v2.32.0.vfs.0.102.exp
This is a change that can be taken anywhere since 4300f8 (sparse-index: implement ensure_full_index(), 2021-03-30), but this version is based on v2.33.0-rc2.
While the bug is alarming for users who hit it (seg fault) it requires sufficient scale and use of the optional sparse index feature. We are not recommending wide adoption of the sparse index yet because we don't have a sufficient density of integrated commands. For that reason, I don't think this should halt progress towards the full v2.33.0 release. I did want to send this as soon as possible so that could be at the discretion of the maintainer.
Thanks,
-Stolee
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
cc: Johannes Schindelin [email protected]
cc: Ævar Arnfjörð Bjarmason [email protected]