目前我的 Symfony2 应用程序有问题,使用 Doctrine PHPCR 包。在尝试显示 Sonata 管理员帖子列表时,我们遇到了分段错误:
[Thu Aug 01 12:33:11 2013] [notice] child pid 4239 exit signal Segmentation fault (11)
由于我们收到了很多帖子,我们将它们分片以获得正确的性能。这样,我们的帖子路径类似于:“/blog/economics/2014/02/10/my-awesome-post”。我们的节点及其对应的类是:
|_ Blog (Generic)
|_ Economics (Section)
|_ 2014 (Shard)
|_ 02 (Shard)
|_ 10 (Shard)
|_ my-awesome-post (Post)
我的管理员列表如下所示:
/**
* @param FormMapper $formMapper
*/
protected function configureListFields(ListMapper $listMapper)
{
$listMapper
// ...
->add('parentTitle', 'string', array('sortable' => true))
// ...
;
}
现在,两个相关的文档方法:
/**
* 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;
}
摸索了一会儿,我注意到这两种方法中的一种出现了分段错误。不确定具体在哪里。如果我在 中返回一个硬写的字符串getParentTitle
,则一切正常。然而,一旦我调用getSectionParent
,就会发生分段错误。
我尝试用 调试它gdb
,这是我找到的最精确的堆栈:
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.
不确定所有这些数据是否足够(我是段错误调试的新手)。
我试图用谷歌搜索这条消息,但我没有找到任何结论。然而,通过zend.enable_gc = 0
工程禁用垃圾收集器。但是,出于内存消耗微不足道的原因,我不会在生产中传递它。
任何想法?
编辑
从头开始重新安装我的机器后,我仍然遇到了问题。然而,从默认的 Debian PHP 版本 (5.4.4) 到 DotDeb 版本 (5.4.25) 解决了这个问题。但是,在同一个地方出现了另一个段错误:
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
我还需要一些帮助。:)