From: [email protected]
Operating system: FreeBSD 6.2
PHP version: 5.3CVS-2009-04-01 (CVS)
PHP Bug Type: Arrays related
Bug description: array() returns NULL
Description:
------------
Again, another bug happening in a unit test of OpenX. The problem always
happens in the same test at the same point. What happens is that a simple
array() call is returning NULL on my FreeBSD system. The same test
generates a segmentation fault when run on our Linux based continuous
integration system.
Unfortunately I can't create a self-contained test case, but I can provide
access to the system or more data.
I will also attach a backtrace of the core dump (which might even not be
happening at the same place as the FreeBSD failure).
Reproduce code:
---------------
$ids = array();
echo 'On FreeBSD: ';
var_dump($ids);
Expected result:
----------------
On FreeBSD: Array ()
Actual result:
--------------
On FreeBSD: NULL
Backtrace (Linux):
Program terminated with signal 11, Segmentation fault.
(gdb) bt full
#0 ZEND_ASSIGN_SPEC_CV_VAR_HANDLER (execute_data=0x2aaaaecf02d8) at
/usr/local/src/php-5.3.0RC1/Zend/zend_execute.c:664
opline = (zend_op *) 0x12eb418
free_op2 = {var = 0x273c0d0}
value = (zval *) 0x1
variable_ptr_ptr = (zval **) 0x2a0e848
#1 0x00000000007242fb in execute (op_array=0x10fdf40) at
/usr/local/src/php-5.3.0RC1/Zend/zend_vm_execute.h:104
ret = <value optimized out>
execute_data = (zend_execute_data *) 0x2aaaaecf02d8
nested = 1 '\001'
original_in_execution = 0 '\0'
#2 0x0000000000701306 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /usr/local/src/php-5.3.0RC1/Zend/zend.c:1188
files = {{gp_offset = 40, fp_offset = 73, overflow_arg_area =
0x7fffbdf97f10, reg_save_area = 0x7fffbdf97e20}}
i = 1
file_handle = (zend_file_handle *) 0x7fffbdf9a3e0
orig_op_array = (zend_op_array *) 0x0
orig_retval_ptr_ptr = (zval **) 0x0
#3 0x00000000006ae155 in php_execute_script (primary_file=0x7fffbdf9a3e0)
at /usr/local/src/php-5.3.0RC1/main/main.c:2157
__orig_bailout = (jmp_buf *) 0x7fffbdf9a1c0
__bailout = {{__jmpbuf = {15364672, 903771196811129754, 1, 0, 0,
0, 903771196811177402, 903720367174677233}, __mask_was_saved = 0,
__saved_mask = {__val = {48, 7, 15372768, 9416, 216135044429,
17634384, 229440404087961, 48, 7403025, 15235744, 0, 206158430215,
140736380641392, 17634352, 17634352, 140736380641392}}}}
prepend_file_p = (zend_file_handle *) 0x0
append_file_p = (zend_file_handle *) 0x8
prepend_file = {type = ZEND_HANDLE_FILENAME, filename = 0x0,
opened_path = 0x0, handle = {fd = 0, fp = 0x0, stream = {handle = 0x0,
isatty = 0, mmap = {len = 0, pos = 0, map = 0x0, buf = 0x0,
old_handle = 0x0, old_closer = 0}, reader = 0, fsizer = 0, closer
= 0}}, free_filename = 0 '\0'}
append_file = {type = ZEND_HANDLE_FILENAME, filename = 0x0,
opened_path = 0x0, handle = {fd = 0, fp = 0x0, stream = {handle = 0x0,
isatty = 0, mmap = {len = 0, pos = 0, map = 0x0, buf = 0x0,
old_handle = 0x0, old_closer = 0}, reader = 0, fsizer = 0, closer
= 0}}, free_filename = 0 '\0'}
old_cwd = 0x7fffbdf97f20 ""
retval = 0
#4 0x000000000078bcee in main (argc=10, argv=0x7fffbdf9a658) at
/usr/local/src/php-5.3.0RC1/sapi/cli/php_cli.c:1159
__bailout = {{__jmpbuf = {216132590528, 903720367176127146, 0,
140736380642896, 110, 0, 903771196811129834, 903720367173477278},
__mask_was_saved = 0, __saved_mask = {__val = {140736380642608,
140736380642416, 57, 112, 15369344, 15369328, 216135048496,
216138037600, 81, 140736380641952, 216135037715, 47, 96, 50, 216130423719,
15369344}}}}
exit_status = 0
c = <value optimized out>
file_handle = {type = ZEND_HANDLE_MAPPED, filename =
0x7fffbdf9a935 "run.php", opened_path = 0x0, handle = {fd = 17477016, fp =
0x10aad98, stream = {handle = 0x10aad98, isatty = 0, mmap = {
len = 5351, pos = 0, map = 0x2aaaaed69000, buf = 0x2aaaaed69000
"", old_handle = 0x10d10b0, old_closer = 0x715dd0
<zend_stream_stdio_closer>}, reader = 0x716390 <zend_stream_stdio_reader>,
fsizer = 0x7162d0 <zend_stream_stdio_fsizer>, closer = 0x716320
<zend_stream_mmap_closer>}}, free_filename = 0 '\0'}
behavior = 1
reflection_what = 0x0
orig_optind = 1
orig_optarg = 0x0
arg_free = 0x7fffbdf9a935 "run.php"
arg_excp = <value optimized out>
script_file = 0x7fffbdf9a935 "run.php"
interactive = 0
module_started = 1
request_started = 1
lineno = 1
exec_direct = 0x0
exec_run = 0x0
exec_begin = 0x0
exec_end = 0x0
param_error = <value optimized out>
hide_argv = 0
ini_entries_len = <value optimized out>
--
Edit bug report at http://bugs.php.net/?id=47870&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47870&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47870&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47870&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47870&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=47870&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47870&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=47870&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=47870&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=47870&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=47870&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=47870&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=47870&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=47870&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47870&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47870&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47870&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=47870&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=47870&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=47870&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=47870&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=47870&r=mysqlcfg