dsa1234569 2013-09-26 12:23
浏览 61

由于PHP的Apache段错误

When running a particular piece of PHP code I am getting a segmentation fault in Apache2. The exact error is Program terminated with signal 11, Segmentation fault. After enabling core dumps and using sudo gdb apache2 -core /tmp/apache2-gdb-dump/core to analyze the core dump I got the result which can be obtained here http://pastebin.com/WetihWU0. Apparently something goes wrong with spl_array.c.

I narrowed it down to a piece of PHP code which uses a method generated by Propel 1.7. The piece of code removes a crossreference entry of a particular class:

foreach($record->getCrossReferences() as $crossReference) {
    $record->removeCrossReference($crossReference);
}

The error does not occur if I call removeCrossReference() outside the loop. Weird eh?

Since PHP crashes on some c code I find it hard to obtain a minimal code sample which produces the segfault. Does anyone happen to know what causes the segfault? Or maybe give me some pointers towards getting a minimal code sample? I don't think the guys at PHP.org accept a bug report without a minimal code sample.

Versions I use:

$ php -v
PHP 5.3.10-1ubuntu3.8 with Suhosin-Patch (cli) (built: Sep  4 2013 20:05:42) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
    with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans

$ /usr/sbin/apache2 -v
Server version: Apache/2.2.22 (Ubuntu)
Server built:   Jul 12 2013 13:38:21

Propel version 1.7.0-dev

Interesting fact is that I also have an Arch machine with newer versions of Apache and PHP. On this machine the fault does not occur. But I don't know if this is due to newer versions or different configurations between the Arch and Ubuntu machine.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥60 求一个简单的网页(标签-安全|关键词-上传)
    • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
    • ¥15 基于卷积神经网络的声纹识别
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP