-
Notifications
You must be signed in to change notification settings - Fork 2.4k
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Segmentation fault or other errors when reading splitIndex #4857
Comments
A cursory look at the index code seems to confirm that split indexes are indeed not supported (here's where the error comes from, and here's the index extension handling). As to the segfault, I can't reproduce — I've checked against an empty repo with split index enabled, and I'm getting the aforementioned error message. |
OK, that's still pretty helpful, thanks! |
I will take this |
git_allocator_global_init is not being called and git_allocator is used in git_buf_try_grow while all the stored methods are NULL. I don't know where it should be initialized |
On Wed, Oct 23, 2019 at 08:04:12PM -0700, grantfar wrote:
git_allocator_global_init is not being called and git_allocator
is used in git_buf_try_grow while all the stored methods are
NULL.
I don't know where it should be initialized
This only happens when you didn't yet call `git_libgit2_init()`
yet. Otherwise, the allocator should've been initialized via
`git_allocator_global_init`.
|
Random idea: can we set up the allocator to a function that: |
Random idea: can we set up the allocator to a function that: git_error_set(..., "libgit2 has not been initialized"); return NULL; until such time as it's actually initialized? Nice idea. Do we also want to re-set the struct to these error functions when calling @tiennou: by the way, should this bug still exist in theory? I'm asking because of your #4858, which has in the meantime been merged. We sure still lack support for the split index itself, but at least we hopefully shouldn't crash. |
@pks-t git_libgit2_init() not being called is why the segfault is happening. |
Heh, funny how I haven't noticed before, but that's probably it. Thanks a lot for diving into the issue! I'm closing this ticket -- if anybody sees crashes with split index, please feel free to reopen it. |
Does libgit2 support repositories with the
core.splitIndex
feature turned on?Reproduction steps
These steps are based on #4234.
Try to open the index with libgit2:
Expected behavior
No output (i.e. success)
Actual behavior
Segmentation fault
Version of libgit2 (release number or SHA1)
0.26.6
Operating system(s) tested
NixOS unstable
Additional notes
I'm actually trying to debug an issue where cargo refuses to build code in a large repo (where I have turned on
splitIndex
). There, I get cryptic errors like "error: invalid data in index - extension is truncated; class=Index (10)". It may be that the two issues are related, in which case you may not get a seg fault but some other error.The text was updated successfully, but these errors were encountered: