Using the pygit2.Remote.push method on the current version in Portage (0.22.0), I receive this segfault: Program received signal SIGSEGV, Segmentation fault. git_refspec__parse (refspec=refspec@entry=0x1b3f240, input=input@entry=0x7f9900746967 <error: Cannot access memory at address 0x7f9900746967>, is_fetch=is_fetch@entry=false) at /var/tmp/portage/dev-libs/libgit2-0.22.3/work/libgit2-0.22.3/src/refspec.c:32 32 /var/tmp/portage/dev-libs/libgit2-0.22.3/work/libgit2-0.22.3/src/refspec.c: No such file or directory. (gdb) bt #0 git_refspec__parse (refspec=refspec@entry=0x1b3f240, input=input@entry=0x7f9900746967 <error: Cannot access memory at address 0x7f9900746967>, is_fetch=is_fetch@entry=false) at /var/tmp/portage/dev-libs/libgit2-0.22.3/work/libgit2-0.22.3/src/refspec.c:32 #1 0x00007f991b351f58 in parse_refspec (str=0x7f9900746967 <error: Cannot access memory at address 0x7f9900746967>, spec=<synthetic pointer>, push=0x1b3df80) at /var/tmp/portage/dev-libs/libgit2-0.22.3/work/libgit2-0.22.3/src/push.c:138 #2 git_push_add_refspec (push=push@entry=0x1b3df80, refspec=0x7f9900746967 <error: Cannot access memory at address 0x7f9900746967>) at /var/tmp/portage/dev-libs/libgit2-0.22.3/work/libgit2-0.22.3/src/push.c:163 #3 0x00007f991b3b56ea in git_remote_upload (remote=remote@entry=0x1a21760, refspecs=refspecs@entry=0x7f991ab92d60, opts=opts@entry=0x0) at /var/tmp/portage/dev-libs/libgit2-0.22.3/work/libgit2-0.22.3/src/remote.c:2352 #4 0x00007f991b3b5733 in git_remote_push (remote=0x1a21760, refspecs=0x7f991ab92d60, opts=0x0, signature=0x0, reflog_message=0x0) at /var/tmp/portage/dev-libs/libgit2-0.22.3/work/libgit2-0.22.3/src/remote.c:2391 #5 0x00007f991a9be4ab in _cffi_f_git_remote_push (self=<optimized out>, args=<optimized out>) at pygit2/__pycache__/pygit2_cffi_1b714a1x5470904.c:5613 This is due to unsafe string handling which is fixed upstream in commit 0ba17a5b4608706f696c2212315ea0bb301db209, which is present in v0.22.1 (current release). The ebuild needs no changes, just a simple copy of 0.22.0-r1 to 0.22.1 suffices. Reproducible: Always Steps to Reproduce: import pygit2 from getpass import getpass repo = pygit2.Repository("/path/to/some/repo/.git") remote = repo.remotes['origin'] remote.credentials = pygit2.Keypair('git', 'some_id.pub', 'some_id', getpass()) remote.url = 'git@domain:path/repo.git' remote.push(['refs/heads/master:refs/heads/master']) Actual Results: Program received signal SIGSEGV, Segmentation fault. Expected Results: Pushed new code (if any) to the Git repository. I can verify from putting a 0.22.1 ebuild in an overlay that a version bump does resolve the crash.
+ 01 Aug 2015; Patrick Lauer <patrick@gentoo.org> +pygit2-0.22.1.ebuild, + -pygit2-0.22.0-r1.ebuild: + Bump for #556390