Skip to content

0.23.3 fails to compile on Fedora 23 i686 #597

Closed

Description

@pypingou

I have recently been trying to update the Fedora package in F23 to 0.23.3 since Fedora already have libgit2 0.23.4 I thought this should work fine.

Build on x86_64 is fine, but i686 fails to build, or rather fails on the unit-tests, I would appreciate some help to figure out what's going on.

The build is at: http://koji.fedoraproject.org/koji/taskinfo?taskID=13024033
The log for i686 is at: https://kojipkgs.fedoraproject.org//work/tasks/4036/13024036/build.log

There is apparently something odd going on with encoding and somehow -dirty becomes \x08. No idea why though.

Activity

  1. pypingou commented on Feb 22, 2016

    @pypingou
    Author

    Note the code was added commit 57507982 and line which might be responsible may be: 99dfce9#diff-57507982bc2ad39925ca8f387e172b29R720 but I don't see anything wrong w/ it, so I wonder if the problem isn't lower down the stack, no idea.

  2. carlosmn commented on Feb 22, 2016

    @carlosmn
    Member

    It looks like the string might not be kept alive long enough, so libgit2 ends up reading nonsense. This looks like a dupe of #592 though.

  3. pypingou commented on Feb 22, 2016

    @pypingou
    Author

    Indeed it's a dupe, should I close this one or do we prefer to close the other one?

  4. pypingou commented on Feb 23, 2016

    @pypingou
    Author

    Any idea on how we could help debugging this?

  5. carlosmn commented on Feb 23, 2016

    @carlosmn
    Member

    There's looking at the code to see if we make sure we keep a reference to the unmanaged string. Then there's also a way to build python so it doesn't pool allocations and you can throw valgrind and friends at it.

  6. carlosmn commented on Feb 23, 2016

    @carlosmn
    Member

    This should keep the pointer alive.

    diff --git a/pygit2/repository.py b/pygit2/repository.py
    index f8a6cad..d7ca58e 100644
    --- a/pygit2/repository.py
    +++ b/pygit2/repository.py
    @@ -716,8 +716,10 @@ class Repository(_Repository):
                     format_options.abbreviated_size = abbreviated_size
                 if always_use_long_format is not None:
                     format_options.always_use_long_format = always_use_long_format
    +            dirty_ptr = None
                 if dirty_suffix:
    -                format_options.dirty_suffix = ffi.new('char[]', to_bytes(dirty_suffix))
    +                dirty_ptr = ffi.new('char[]', to_bytes(dirty_suffix))
    +                format_options.dirty_suffix = dirty_ptr
    
                 buf = ffi.new('git_buf *', (ffi.NULL, 0))
  7. pypingou commented on Feb 24, 2016

    @pypingou
    Author

    thanks I'll test this patch :)

  8. pypingou commented on Feb 24, 2016

    @pypingou
    Author
  9. pypingou commented on Feb 24, 2016

    @pypingou
    Author

    So as far as I am concerned this can be closed as fixed, I could build 0.23.3 for Fedora 23, 24 and rawhide successfully on all arches (i686, x86_64 and arm).

    If you submit the patch for inclusion, I can vouch that it fixed the unit-tests for us.

    Many thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions