Skip to content
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

Fix A/V thrown from while reading the git pack index #894

Merged
merged 1 commit into from
Feb 14, 2023

Conversation

AArnott
Copy link
Collaborator

@AArnott AArnott commented Feb 14, 2023

We had been mapping only parts of the index into memory, and shifting the mapped window with each call to GetSpan. The problem was the caller would use GetSpan more than once, and hold each result such that it had a pointer/span into both windows when only one existed at any given point.

This fixes a regression made in #892 (395dfa7). In that change, I tried to reduce the mapped file from the whole file to just a window. That was as part of fixing an OutOfMemoryException, but ultimately I believe that was due to a memory leak, which that PR also fixed. So in this change I keep the memory leak fix (by releasing the acquired pointer) but revert the smaller, moving window code change.

We had been mapping only parts of the index into memory, and shifting the mapped window with each call to `GetSpan`. The problem was the caller would use `GetSpan` more than once, and hold each result such that it had a pointer/span into both windows when only one existed at any given point.

This fixes a regression made in #892 (395dfa7).
In that change, I tried to reduce the mapped file from the whole file to just a window. That was as part of fixing an `OutOfMemoryException`, but ultimately I believe that was due to a memory leak, which that PR also fixed. So in this change I keep the memory leak fix (by releasing the acquired pointer) but revert the smaller, moving window code change.
@AArnott AArnott added this to the v3.6 milestone Feb 14, 2023
@AArnott AArnott merged commit 5b56c63 into main Feb 14, 2023
@AArnott AArnott deleted the dev/andarno/fixAV branch February 14, 2023 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant