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

Fatal Python error: none_dealloc: deallocating None when getting commit author #1161

Closed
siscia opened this issue Oct 1, 2022 · 3 comments
Closed

Comments

@siscia
Copy link
Contributor

siscia commented Oct 1, 2022

Hello everybody, and thanks for maintaining this repository.

I am reporting a runtime error Fatal Python error: none_dealloc: deallocating None

I am iterating over commits of a repository and getting information about the commiter:

import pygit2 # type: ignore

# this is a git clone of
# git@github.com:facebook/react.git
repo_path = "tests/react"

repo = pygit2.Repository(repo_path)

commits = repo.walk(repo.head.target, pygit2.GIT_SORT_REVERSE)

# we are missing what is happening at the first commit
for commit in commits:
    author = commit.author
    print(f"{commit.id=}")
    print(f"{author=}")

The execution terminates with:

... more logs line...
commit.id=eb056fcf5d12f100e4f8df700b634d3c4cc5f9ba
author=pygit2.Signature('Paul O’Shannessy', 'paul@oshannessy.com', 1439962431, 4294966876, None)
commit.id=ec9b866bc0fa4118f0b3750589e26ed851ef97bd
author=pygit2.Signature('Paul O’Shannessy', 'paul@oshannessy.com', 1439946313, 4294966876, None)
commit.id=50adfeb4217a6086fe7d9c4be5d9db732614106e
author=pygit2.Signature('Paul O’Shannessy', 'paul@oshannessy.com', 1440001562, 4294966876, None)
commit.id=1e10bb5923b32ab3b6c86c65c7ed18f693056da5
Fatal Python error: none_dealloc: deallocating None
Python runtime state: initialized

Current thread 0x00007f423d6f21c0 (most recent call first):
  File "/home/simo/projects/codedigger/repro.py", line 14 in <module>

Extension modules: pygit2._pygit2, _cffi_backend (total: 2)
Aborted (core dumped)

It is not deterministic when it terminates, and it always terminates at a different commit.

@siscia
Copy link
Contributor Author

siscia commented Oct 3, 2022

It is not super clear to me this call

encoding = Py_None;

As I would expect that we need to increase the reference counting for that none.

@siscia
Copy link
Contributor Author

siscia commented Oct 3, 2022

Yep, it was that!

Preparing PR

@jdavid
Copy link
Member

jdavid commented Oct 4, 2022

Fixed with #1162

@jdavid jdavid closed this as completed Oct 4, 2022
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

No branches or pull requests

2 participants