libgit2 / php-git

PHP bindings for libgit2
http://libgit2.github.com
MIT License
565 stars 118 forks source link

Signal fault (11) on newest code #40

Open dubcanada opened 11 years ago

dubcanada commented 11 years ago

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,