#46873 [Asn]: Bus error: 10 (core dumped) in zend_hash.c
ID: 46873
Updated by: felipe@php.net
Reported By: christian at enovo dot dk
Status: Assigned
Bug Type: Reproducible crash
Operating System: *
PHP Version: 5.*-CVS (2008-12-16)
Assigned To: lbarnaud
New Comment:
*Arnaud
I suppose
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.58&r2=1.308.2.21.2.59
(Fixed bugs #44181 & #44182 (extract() and references))
Previous Comments:
------------------------------------------------------------------------
[2008-12-26 11:53:31] felipe@php.net
Hi Arnald, that patch broken this.
------------------------------------------------------------------------
[2008-12-17 11:14:20] bjori@php.net
I can't reproduce this using 5.3 from today:
bjori@jessica:/usr/src/php/5.3$ sapi/cli/php t.php
PHP Warning: Invalid argument supplied for foreach() in
/usr/src/php/5.3/t.php on line 12
------------------------------------------------------------------------
[2008-12-16 18:03:35] jani@php.net
Output with reduced test script:
# src/build/php_5_2/sapi/cli/php t.php
Segmentation fault
# src/build/php_5_3/sapi/cli/php t.php
Segmentation fault
# src/build/php_6/sapi/cli/php t.php
Warning: Invalid argument supplied for foreach() in /home/jani/t.php on
line 12
So it seems the bug is only in PHP_5* branches.
------------------------------------------------------------------------
[2008-12-16 03:08:53] crrodriguez at opensuse dot org
reduced test case
<?php
$data = array (
'level0' => array(
'level1'
)
);
$flattened = flatten($data);
function flatten($data, $separator = array()) {
extract($separator, EXTR_OVERWRITE);
foreach ($data as $key => $val) {
flatten($val, array('separator' => $separator));
}
}
?>
------------------------------------------------------------------------
[2008-12-15 23:05:56] crrodriguez at opensuse dot org
VERIFIED in 5_3
gdb) bt
#0 0x00000000007f59b7 in zend_hash_get_current_data_ex (ht=0xfd6bf0,
pData=0x7fff96781c68, pos=0x7fff96781c48)
at /home/cristian/php5/Zend/zend_hash.c:1163
#1 0x00000000006c313b in zif_extract (ht=2, return_value=0xfd5590,
return_value_ptr=0x0, this_ptr=0x0, return_value_used=0)
at /home/cristian/php5/ext/standard/array.c:1287
#2 0x0000000000814959 in zend_do_fcall_common_helper_SPEC
(execute_data=0x7f598e5fa6e0) at
/home/cristian/php5/Zend/zend_vm_execute.h:313
#3 0x000000000081a050 in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0x7f598e5fa6e0) at
/home/cristian/php5/Zend/zend_vm_execute.h:1564
#4 0x0000000000813a47 in execute (op_array=0xfd9298) at
/home/cristian/php5/Zend/zend_vm_execute.h:104
#5 0x00000000007e4089 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /home/cristian/php5/Zend/zend.c:1197
#6 0x0000000000766aa1 in php_execute_script
(primary_file=0x7fff96784440) at /home/cristian/php5/main/main.c:2080
#7 0x000000000088336b in main (argc=2, argv=0x7fff96784698) at
/home/cristian/php5/sapi/cli/php_cli.c:1126
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/46873
--
Edit this bug report at http://bugs.php.net/?id=46873&edit=1
Thread (9 messages)