Skip to content

Signal fault (11) on newest code #40

Open
@dubcanada

Description

@dubcanada

Hey,

I'm getting a single fault now when I try to do the following, which used to work.

    $repo = new Git2\Repository('/tmp/jquery.git');
    $sha = \Git2\Reference::lookup($repo,"refs/heads/master");
    $ref = $sha->resolve();

    $commit = $repo->lookup($ref->getTarget());
            if ($commit instanceof Git2\Tag) {
                $commit = $commit->getTarget();
            }

    $tree = $commit->getTree();
    $subtree = $tree->getSubTree('/src/');

    foreach($tree as $oid => $entry) {
        print "<pre><br>";
        print $entry->name;
        print " - ".$oid;
        var_dump($entry->isTree());
        var_dump($entry->isSubmodule());
        var_dump($repo->lookup($oid)); <-- This line
    }

Upon removing the var_dump($repo->lookup($oid)); it begins working again.

Btw I am using a git clone --bare jquery repo

gdb backtrace

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000040
0x000000010193a3c3 in git_object_type (obj=0x20) at object.c:260
260     return obj->type;

Regards,

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