Bugs in python backend
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 408
- Avg merge
- 2d 57m
- Merged PRs (30d)
- 7
Description
I am creating an issue rather than a PR because I have not been able to create a working Odb or Refdb backend, but I have found several bugs. Please let me know if I am completely misunderstanding this code.
I believe the issues I cannot get past come from threading in libgit2. I have found that, at times, calling threading.get_ident will cause a segfault. I have tried wrapping all C->python code in PyGILState_Ensure and PyGILState_Release, but this did not work.
I have found the following possible errors:
- https://github.com/libgit2/pygit2/blob/e012bb5bc9e0bdb68ac79f9c12e3f59e3513328a/src/odb_backend.c#L244 Calls
exists_prefixnotrefresh. - https://github.com/libgit2/pygit2/blob/e012bb5bc9e0bdb68ac79f9c12e3f59e3513328a/src/refdb_backend.c#L134
globmay be null - https://github.com/libgit2/pygit2/blob/e012bb5bc9e0bdb68ac79f9c12e3f59e3513328a/src/refdb_backend.c#L134
git_reference* _refwill double free - https://github.com/libgit2/pygit2/blob/e012bb5bc9e0bdb68ac79f9c12e3f59e3513328a/src/refdb_backend.c#L409
PyIter_Checkshould be a check for__iter__not if the object is currently an iterator.
In my experience, problems like this mean that I am misusing something. Let me know if these appear to be real bugs and I will see if I can at least create test cases to expose them. I don't seem to have a good grasp on the threading segfaults though.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the cited sections of src/odb_backend.c and src/refdb_backend.c, then reproduce the Odb and Refdb backend problems, including the reported libgit2 threading and GIL-related segfault. Done means each suspected bug is confirmed or ruled out with reproducible coverage and the findings are resolved or clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100