Binary package hint: php5
Program received signal SIGSEGV, Segmentation fault.
preg_replace_impl (ht=5, return_value=0xb9a72214, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, is_callable_replace=1 '\001')
at /build/buildd/php5-5.2.6.dfsg.1/Zend/zend_variables.h:32
32 /build/buildd/php5-5.2.6.dfsg.1/Zend/zend_variables.h: No such file or directory.
in /build/buildd/php5-5.2.6.dfsg.1/Zend/zend_variables.h
(gdb) backtrace
#0 preg_replace_impl (ht=5, return_value=0xb9a72214, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, is_callable_replace=1 '\001')
at /build/buildd/php5-5.2.6.dfsg.1/Zend/zend_variables.h:32
#1 0xb733cc03 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfdd00b8) at /build/buildd/php5-5.2.6.dfsg.1/Zend/zend_vm_execute.h:200
#2 0xb732809b in execute (op_array=0xb978347c) at /build/buildd/php5-5.2.6.dfsg.1/Zend/zend_vm_execute.h:92
#3 0xb733c4c6 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfdd0278) at /build/buildd/php5-5.2.6.dfsg.1/Zend/zend_vm_execute.h:234
#4 0xb732809b in execute (op_array=0xb97888d0) at /build/buildd/php5-5.2.6.dfsg.1/Zend/zend_vm_execute.h:92
#5 0xb733c4c6 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfdd0618) at /build/buildd/php5-5.2.6.dfsg.1/Zend/zend_vm_execute.h:234
#6 0xb732809b in execute (op_array=0xb9788ea4) at /build/buildd/php5-5.2.6.dfsg.1/Zend/zend_vm_execute.h:92
#7 0xb733c4c6 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfdd1158) at /build/buildd/php5-5.2.6.dfsg.1/Zend/zend_vm_execute.h:234
#8 0xb732809b in execute (op_array=0xb9721148) at /build/buildd/php5-5.2.6.dfsg.1/Zend/zend_vm_execute.h:92
#9 0xb732d868 in ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER (execute_data=0xbfdd1338) at /build/buildd/php5-5.2.6.dfsg.1/Zend/zend_vm_execute.h:4612
#10 0xb732809b in execute (op_array=0xb9719ec4) at /build/buildd/php5-5.2.6.dfsg.1/Zend/zend_vm_execute.h:92
#11 0xb732ade9 in ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER (execute_data=0xbfdd1db8) at /build/buildd/php5-5.2.6.dfsg.1/Zend/zend_vm_execute.h:20047
#12 0xb732809b in execute (op_array=0xb9718434) at /build/buildd/php5-5.2.6.dfsg.1/Zend/zend_vm_execute.h:92
#13 0xb7302710 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /build/buildd/php5-5.2.6.dfsg.1/Zend/zend.c:1215
#14 0xb72b6fba in php_execute_script (primary_file=0xbfdd4078) at /build/buildd/php5-5.2.6.dfsg.1/main/main.c:2028
#15 0xb737a8c0 in php_handler (r=0xb97600e0) at /build/buildd/php5-5.2.6.dfsg.1/sapi/apache2handler/sapi_apache2.c:648
php --version 5.2.6.dfsg.1-3ubuntu4.1 (jaunty-updates, jaunty-security)
Was working in Intrepid, upgraded to Jaunty - stopped working. I could have introduced an error but it shouldn't segfault anyway I guess.
Can you provide the PHP code which causes this segfault?
I tried the following example code, and managed to run preg_replace_ callback( ) just fine on both an i386 and an amd64 running jaunty.
<?php 1].($matches[ 2]+1); callback(
"| (\d{2}/ \d{2}/) (\d{4}) |",
"next_ year",
// this text was used in 2002
// we want to get this up to date for 2003
$text = "April fools day is 04/01/2002\n";
$text.= "Last christmas was 12/24/2001\n";
// the callback function
function next_year($matches)
{
// as usual: $matches[0] is the complete match
// $matches[1] the match for the first subpattern
// enclosed in '(...)' and so on
return $matches[
}
echo preg_replace_
$text);
?>
(Taken from http:// www.php. net/manual/ en/function. preg-replace- callback. php)