Bug #49617 [Ver->Fbk]: Problem with references
Edit report at http://bugs.php.net/bug.php?id=49617&edit=1
ID: 49617
Updated by: mike@php.net
Reported by: mstf at mstf dot name dot tr
Summary: Problem with references
-Status: Verified
+Status: Feedback
Type: Bug
Package: Reproducible crash
Operating System: *
PHP Version: 5.3, 6 (2009-09-22)
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2009-09-22 09:45:00] jani@php.net
# build/php_5_2/sapi/cli/php -n t.php
Fatal error: Cannot create references to/from string offsets nor
overloaded objects in /home/jani/src/t.php on line 8
# build/php_5_3/sapi/cli/php -n t.php
Segmentation fault
# build/php_6/sapi/cli/php -n t.php
Segmentation fault
------------------------------------------------------------------------
[2009-09-22 09:30:11] sjoerd@php.net
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x00470df9 in ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER
(execute_data=0xb68040) at zend_vm_execute.h:23568
23568 Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
(gdb) bt
#0 0x00470df9 in ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER
(execute_data=0xb68040) at zend_vm_execute.h:23568
#1 0x003ec80e in execute (op_array=0xa109f0) at zend_vm_execute.h:104
#2 0x003bd57a in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /Users/sjoerd/Sources/php-src-5.3/Zend/zend.c:1188
#3 0x0034193d in php_execute_script (primary_file=0xbffff7fc) at
/Users/sjoerd/Sources/php-src-5.3/main/main.c:2213
#4 0x0049650f in main (argc=4, argv=0xbffff8e8) at
/Users/sjoerd/Sources/php-src-5.3/sapi/cli/php_cli.c:1190
(gdb)
------------------------------------------------------------------------
[2009-09-22 01:18:48] mstf at mstf dot name dot tr
Description:
------------
Pointers problem.
Reproduce code:
---------------
$a = array('a' => array('b' => 'c'));
$b = &$a;
$b = &$b['a'];
$b = &$b['b'];
$b = &$b['c'];
echo $b;
Expected result:
----------------
NULL
Actual result:
--------------
Apache "Send Error Report"
Apache error.log:
[Sat Aug 22 04:11:34 2009] [notice] Child 3408: Child process is
running
[Sat Aug 22 04:11:34 2009] [notice] Child 3408: Acquired the start
mutex.
[Sat Aug 22 04:11:34 2009] [notice] Child 3408: Starting 150 worker
threads.
[Sat Aug 22 04:11:34 2009] [notice] Child 3408: Starting thread to
listen on port 80.
[Sat Aug 22 04:11:34 2009] [notice] Child 3408: Starting thread to
listen on port 443.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=49617&edit=1
Thread (6 messages)