新写得PHP扩展程序运行就报段错误,看不到详细的信息[root@localhost demo]# /usr/local/php5/bin/php road.php
Segmentation fault (core dumped)
可以使用gdb来调试[root@localhost demo]# gdb /usr/local/php5/bin/php(gdb) set args road.php(gdb) rStarting program: /usr/local/php5/bin/php road.php
[Thread debugging using libthread_db enabled]
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff17893e7 in zval_isref_p (pz=0x21f00000078) at /usr/local/php5/include/php/Zend/zend.h:413
413return pz->is_ref__gc;(gdb) bt
#0 0x00007ffff17893e7 in zval_isref_p (pz=0x21f00000078) at /usr/local/php5/include/php/Zend/zend.h:413
#1 0x00007ffff17897f5 in zim_road_deal (ht=1, return_value=0x7ffff79abb20, return_value_ptr=0x0, this_ptr=0x7ffff79aab70, return_value_used=0) at /root/Downloads/php-5.5.32/ext/demo/road.c:157
#2 0x0000000000884f82 in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff796e4c0) at /root/Downloads/php-5.5.32/Zend/zend_vm_execute.h:550
#3 0x0000000000885755 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0x7ffff796e4c0) at /root/Downloads/php-5.5.32/Zend/zend_vm_execute.h:685
#4 0x000000000088467a in execute_ex (execute_data=0x7ffff796e4c0) at /root/Downloads/php-5.5.32/Zend/zend_vm_execute.h:363
#5 0x00000000008846fd in zend_execute (op_array=0x7ffff79a4470) at /root/Downloads/php-5.5.32/Zend/zend_vm_execute.h:388
#6 0x0000000000843ed7 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /root/Downloads/php-5.5.32/Zend/zend.c:1327
#7 0x00000000007ac630 in php_execute_script (primary_file=0x7fffffffe190) at /root/Downloads/php-5.5.32/main/main.c:2525
#8 0x00000000008f72b5 in do_cli (argc=2, argv=0x1006b80) at /root/Downloads/php-5.5.32/sapi/cli/php_cli.c:994
#9 0x00000000008f834a in main (argc=2, argv=0x1006b80) at /root/Downloads/php-5.5.32/sapi/cli/php_cli.c:1378