PHP 输出错误时的堆栈情况:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
#0 php_error_cb (type=1, error_filename=0x7ffff7fdbaf0 "/data3/eatmem.php", error_lineno=3, format=<value optimized out>, args=<value optimized out>) at /data3/rpmbuild/SOURCES/beebank-php5-5.5.25.1/main/main.c:1132 #1 0x00000000006ae29c in zend_error (type=1, format=0xb09580 "Allowed memory size of %ld bytes exhausted (tried to allocate %lu bytes)") at /data3/rpmbuild/SOURCES/beebank-php5-5.5.25.1/Zend/zend.c:1128 #2 0x0000000000687848 in zend_mm_safe_error (heap=0xe2f050, format=0xb09580 "Allowed memory size of %ld bytes exhausted (tried to allocate %lu bytes)", limit=1048576, size=2048001) at /data3/rpmbuild/SOURCES/beebank-php5-5.5.25.1/Zend/zend_alloc.c:1777 #3 0x00000000006884e6 in _zend_mm_alloc_int (heap=0xe2f050, size=2048001) at /data3/rpmbuild/SOURCES/beebank-php5-5.5.25.1/Zend/zend_alloc.c:1980 #4 0x000000000061195b in zif_str_repeat (ht=<value optimized out>, return_value=0x7ffff7fdb058, return_value_ptr=<value optimized out>, this_ptr=<value optimized out>, return_value_used=<value optimized out>) at /data3/rpmbuild/SOURCES/beebank-php5-5.5.25.1/ext/standard/string.c:4917 #5 0x000000000073070b in zend_do_fcall_common_helper_SPEC (execute_data=<value optimized out>) at /data3/rpmbuild/SOURCES/beebank-php5-5.5.25.1/Zend/zend_vm_execute.h:550 #6 0x0000000000721f50 in execute_ex (execute_data=0x7ffff7fa8210) at /data3/rpmbuild/SOURCES/beebank-php5-5.5.25.1/Zend/zend_vm_execute.h:363 #7 0x00000000006ad719 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /data3/rpmbuild/SOURCES/beebank-php5-5.5.25.1/Zend/zend.c:1327 #8 0x000000000064ef7a in php_execute_script (primary_file=0x7fffffffe070) at /data3/rpmbuild/SOURCES/beebank-php5-5.5.25.1/main/main.c:2525 #9 0x000000000075fdbc in do_cli (argc=6, argv=0xe2ec30) at /data3/rpmbuild/SOURCES/beebank-php5-5.5.25.1/sapi/cli/php_cli.c:994 #10 0x0000000000760558 in main (argc=6, argv=0xe2ec30) at /data3/rpmbuild/SOURCES/beebank-php5-5.5.25.1/sapi/cli/php_cli.c:1378 |
如果需要添加更多的信息,只需要在php_error_cb 函数里面添加就行了