Skip to content

segfault in check_connection #859

@djberg96

Description

@djberg96

We're seeing what appears to be a segfault in the check_connection method, i.e. rb_git_remote_check_connection. The error is check_connection munmap_chunk(): invalid pointer. Near as I can tell this happens when you try free something that wasn't malloc'ed.

https://github.com/libgit2/rugged/blob/master/ext/rugged/rugged_remote.c#L503-L539

Looking at that can we confirm that the xfree is only freeing things that were xmalloced? Also, should the code only call git_remote_disconnect if the connection actually happened?

Unfortunately, we have not been able to duplicate this in a standalone script. It seems to happen when the network goes down after previously successful connections.

Here is the actual code that triggered it:

https://github.com/ManageIQ/manageiq/pull/20645/files#diff-d54d482e470404136b4b893c60065b5d743c912652d58d69820d86604e8a8983R261-R268

More information:

https://bugzilla.redhat.com/show_bug.cgi?id=1835226

cc @NickLaMuro, @d-m-u

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions