Symfony2 and Doctrine PHPCR: segmentation fault

990 Views Asked by At

I currently have an issue with my Symfony2 application, using the Doctrine PHPCR bundle. When trying to display a Sonata admin list of posts, we got a segmentation fault:

[Thu Aug 01 12:33:11 2013] [notice] child pid 4239 exit signal Segmentation fault (11)

As we got a lot of posts, we sharded them to have correct performances. This way, our post path are similar to: "/blog/economics/2014/02/10/my-awesome-post". Our nodes are, with their corresponding classes:

|_ Blog (Generic)
    |_ Economics (Section)
        |_ 2014 (Shard)
            |_ 02 (Shard)
               |_ 10 (Shard)
                   |_ my-awesome-post (Post)

My admin list looks like:

/**
 * @param FormMapper $formMapper
 */
protected function configureListFields(ListMapper $listMapper)
{
    $listMapper
        // ...
        ->add('parentTitle', 'string', array('sortable' => true))
        // ...
    ;
}

And now, the two related document method:

/**
 * Return document section name or "/" by default
 *
 * @return string
 */
public function getParentTitle()
{
    $parent = $this->getSectionParent();

    if ($parent instanceof Section) {
        return $parent->getTitle();
    }

    return '/';
}

public function getSectionParent()
{
    $parent = $this->getParent();
    while ($parent instanceof Shard) {
        $parent = $parent->getParent();
    }

    return $parent;
}

After gropping a while, I noticed the segmentation fault occured in one of these two methods. Not sure exactly where. If I return a hard-written string in getParentTitle, all is working fine. Yet, as soon as I am calling the getSectionParent, the segmentation fault occurs.

I tried to debug it with gdb, and here is the most precise stack I found:

Core was generated by `/usr/sbin/apache2 -k start'.
Program terminated with signal 11, Segmentation fault.
#0  zval_mark_grey (pz=0xd0b48751b7bc) at /usr/src/php5/source/php-5.4.25/Zend/zend_gc.c:426
426     /usr/src/php5/source/php-5.4.25/Zend/zend_gc.c: Aucun fichier ou dossier de ce type.

Not sure if all these data are sufficient (I am pretty newbie in segfault debugging).

I tried to Google this message, but I did not find anything concluding. Yet, disabling the garbage collector through a zend.enable_gc = 0 works. However, I won't pass it in production, for memory consumption trivial reasons.

Any idea?

EDIT

After reinstalling from scratch my machine, I still got the issue. Yet, passing from default Debian PHP version (5.4.4) to DotDeb one (5.4.25) solved the issue. However, another segfault appeared, at the same place:

Core was generated by `/usr/sbin/apache2 -k start'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f09371c774b in timelib_timezone_db_data_builtin () from /usr/lib/apache2/modules/libphp5.so

I still need some help. :)

0

There are 0 best solutions below