Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #35559 : Use of global crashes PHP
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 29th April 19:04
php-bugs
External User
 
Posts: 1
Default #35559 : Use of global crashes PHP



From: alexei at nfsrm dot com
Operating system: SuSE 9.3
PHP version: 5.1.1
PHP Bug Type: Scripting Engine problem
Bug description: Use of global crashes PHP

Description:
------------
Trying to access global variables using ${varname} syntax crashes PHP
5.1.x. This worked fine in previous version PHP 4.x and 5.0.x

Reproduce code:
---------------
$var = '12346789';
$a['b'] = 'var';

function test()
{
global $a, ${$a['b']};
echo ${$a['b']};
}

test();

Expected result:
----------------
12346789

Actual result:
--------------
#0 0x082b79c5 in zend_inline_hash_func (arKey=0x0, nKeyLength=1515870811)
at zend_hash.h:252
252 hash = ((hash << 5) + hash) + *arKey++;
(gdb) bt
#0 0x082b79c5 in zend_inline_hash_func (arKey=0x0, nKeyLength=1515870811)
at zend_hash.h:252
#1 0x082b67e7 in zend_hash_find (ht=0x860005c, arKey=0x0,
nKeyLength=1515870811, pData=0xbfffc3d0) at
/usr/local/src/php-5.1.1/Zend/zend_hash.c:849
#2 0x082e47f8 in zend_fetch_var_address_helper_SPEC_VAR (type=0,
execute_data=0xbfffc4d0) at zend_vm_execute.h:6700
#3 0x082e4b2e in ZEND_FETCH_R_SPEC_VAR_HANDLER (execute_data=0xbfffc4d0)
at zend_vm_execute.h:6763
#4 0x082d53af in execute (op_array=0x85ff0b0) at zend_vm_execute.h:88
#5 0x082d5837 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfffc630) at zend_vm_execute.h:222
#6 0x082d8448 in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0xbfffc630) at zend_vm_execute.h:1578
#7 0x082d53af in execute (op_array=0x85f9494) at zend_vm_execute.h:88
#8 0x082acfd4 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
at /usr/local/src/php-5.1.1/Zend/zend.c:1090
#9 0x08269796 in php_execute_script (primary_file=0xbfffea70) at
/usr/local/src/php-5.1.1/main/main.c:1704
#10 0x0831bcb2 in main (argc=3, argv=0xbfffeb54) at
/usr/local/src/php-5.1.1/sapi/cli/php_cli.c:1039

--
Edit bug report at http://bugs.php.net/?id=35559&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35559&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35559&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35559&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35559&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35559&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35559&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35559&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35559&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35559&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35559&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=35559&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=35559&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35559&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35559&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35559&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35559&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35559&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35559&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35559&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35559&r=mysqlcfg
  Reply With Quote


  sponsored links


2 29th April 19:04
External User
 
Posts: 1
Default #35559 : Use of global crashes PHP



ID: 35559
Updated by: tony2001@php.net
Reported By: alexei at nfsrm dot com
-Status: Open
+Status: Feedback
Bug Type: Scripting Engine problem
Operating System: SuSE 9.3
PHP Version: 5.1.1
New Comment:

Please try using this CVS snapshot:

http://snaps.php.net/php5.1-latest.tar.gz

For Windows:

http://snaps.php.net/win32/php5.1-win32-latest.zip


Previous Comments:
------------------------------------------------------------------------

[2005-12-05 17:23:13] alexei at nfsrm dot com

Description:
------------
Trying to access global variables using ${varname} syntax crashes PHP
5.1.x. This worked fine in previous version PHP 4.x and 5.0.x

Reproduce code:
---------------
$var = '12346789';
$a['b'] = 'var';

function test()
{
global $a, ${$a['b']};
echo ${$a['b']};
}

test();

Expected result:
----------------
12346789

Actual result:
--------------
#0 0x082b79c5 in zend_inline_hash_func (arKey=0x0,
nKeyLength=1515870811) at zend_hash.h:252
252 hash = ((hash << 5) + hash) + *arKey++;
(gdb) bt
#0 0x082b79c5 in zend_inline_hash_func (arKey=0x0,
nKeyLength=1515870811) at zend_hash.h:252
#1 0x082b67e7 in zend_hash_find (ht=0x860005c, arKey=0x0,
nKeyLength=1515870811, pData=0xbfffc3d0) at
/usr/local/src/php-5.1.1/Zend/zend_hash.c:849
#2 0x082e47f8 in zend_fetch_var_address_helper_SPEC_VAR (type=0,
execute_data=0xbfffc4d0) at zend_vm_execute.h:6700
#3 0x082e4b2e in ZEND_FETCH_R_SPEC_VAR_HANDLER
(execute_data=0xbfffc4d0) at zend_vm_execute.h:6763
#4 0x082d53af in execute (op_array=0x85ff0b0) at zend_vm_execute.h:88
#5 0x082d5837 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfffc630) at zend_vm_execute.h:222
#6 0x082d8448 in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0xbfffc630) at zend_vm_execute.h:1578
#7 0x082d53af in execute (op_array=0x85f9494) at zend_vm_execute.h:88
#8 0x082acfd4 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /usr/local/src/php-5.1.1/Zend/zend.c:1090
#9 0x08269796 in php_execute_script (primary_file=0xbfffea70) at
/usr/local/src/php-5.1.1/main/main.c:1704
#10 0x0831bcb2 in main (argc=3, argv=0xbfffeb54) at
/usr/local/src/php-5.1.1/sapi/cli/php_cli.c:1039


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=35559&edit=1
  Reply With Quote
3 29th April 19:04
php-bugs
External User
 
Posts: 1
Default #35559 : Use of global crashes PHP


ID: 35559
User updated by: alexei at nfsrm dot com
Reported By: alexei at nfsrm dot com
-Status: Feedback
+Status: Open
Bug Type: Scripting Engine problem
Operating System: SuSE 9.3
PHP Version: 5.1.1
New Comment:

It works fine in the latest snapshot .

Thanks


Previous Comments:
------------------------------------------------------------------------

[2005-12-05 17:31:11] tony2001@php.net

Please try using this CVS snapshot:

http://snaps.php.net/php5.1-latest.tar.gz

For Windows:

http://snaps.php.net/win32/php5.1-win32-latest.zip

------------------------------------------------------------------------

[2005-12-05 17:23:13] alexei at nfsrm dot com

Description:
------------
Trying to access global variables using ${varname} syntax crashes PHP
5.1.x. This worked fine in previous version PHP 4.x and 5.0.x

Reproduce code:
---------------
$var = '12346789';
$a['b'] = 'var';

function test()
{
global $a, ${$a['b']};
echo ${$a['b']};
}

test();

Expected result:
----------------
12346789

Actual result:
--------------
#0 0x082b79c5 in zend_inline_hash_func (arKey=0x0,
nKeyLength=1515870811) at zend_hash.h:252
252 hash = ((hash << 5) + hash) + *arKey++;
(gdb) bt
#0 0x082b79c5 in zend_inline_hash_func (arKey=0x0,
nKeyLength=1515870811) at zend_hash.h:252
#1 0x082b67e7 in zend_hash_find (ht=0x860005c, arKey=0x0,
nKeyLength=1515870811, pData=0xbfffc3d0) at
/usr/local/src/php-5.1.1/Zend/zend_hash.c:849
#2 0x082e47f8 in zend_fetch_var_address_helper_SPEC_VAR (type=0,
execute_data=0xbfffc4d0) at zend_vm_execute.h:6700
#3 0x082e4b2e in ZEND_FETCH_R_SPEC_VAR_HANDLER
(execute_data=0xbfffc4d0) at zend_vm_execute.h:6763
#4 0x082d53af in execute (op_array=0x85ff0b0) at zend_vm_execute.h:88
#5 0x082d5837 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfffc630) at zend_vm_execute.h:222
#6 0x082d8448 in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0xbfffc630) at zend_vm_execute.h:1578
#7 0x082d53af in execute (op_array=0x85f9494) at zend_vm_execute.h:88
#8 0x082acfd4 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /usr/local/src/php-5.1.1/Zend/zend.c:1090
#9 0x08269796 in php_execute_script (primary_file=0xbfffea70) at
/usr/local/src/php-5.1.1/main/main.c:1704
#10 0x0831bcb2 in main (argc=3, argv=0xbfffeb54) at
/usr/local/src/php-5.1.1/sapi/cli/php_cli.c:1039


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=35559&edit=1
  Reply With Quote
4 29th April 19:04
External User
 
Posts: 1
Default #35559 : Use of global crashes PHP


ID: 35559
Updated by: iliaa@php.net
Reported By: alexei at nfsrm dot com
-Status: Open
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: SuSE 9.3
PHP Version: 5.1.1
New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

Thank you for the report, and for helping us make PHP better.


Previous Comments:
------------------------------------------------------------------------

[2005-12-05 17:54:54] alexei at nfsrm dot com

It works fine in the latest snapshot .

Thanks

------------------------------------------------------------------------

[2005-12-05 17:31:11] tony2001@php.net

Please try using this CVS snapshot:

http://snaps.php.net/php5.1-latest.tar.gz

For Windows:

http://snaps.php.net/win32/php5.1-win32-latest.zip

------------------------------------------------------------------------

[2005-12-05 17:23:13] alexei at nfsrm dot com

Description:
------------
Trying to access global variables using ${varname} syntax crashes PHP
5.1.x. This worked fine in previous version PHP 4.x and 5.0.x

Reproduce code:
---------------
$var = '12346789';
$a['b'] = 'var';

function test()
{
global $a, ${$a['b']};
echo ${$a['b']};
}

test();

Expected result:
----------------
12346789

Actual result:
--------------
#0 0x082b79c5 in zend_inline_hash_func (arKey=0x0,
nKeyLength=1515870811) at zend_hash.h:252
252 hash = ((hash << 5) + hash) + *arKey++;
(gdb) bt
#0 0x082b79c5 in zend_inline_hash_func (arKey=0x0,
nKeyLength=1515870811) at zend_hash.h:252
#1 0x082b67e7 in zend_hash_find (ht=0x860005c, arKey=0x0,
nKeyLength=1515870811, pData=0xbfffc3d0) at
/usr/local/src/php-5.1.1/Zend/zend_hash.c:849
#2 0x082e47f8 in zend_fetch_var_address_helper_SPEC_VAR (type=0,
execute_data=0xbfffc4d0) at zend_vm_execute.h:6700
#3 0x082e4b2e in ZEND_FETCH_R_SPEC_VAR_HANDLER
(execute_data=0xbfffc4d0) at zend_vm_execute.h:6763
#4 0x082d53af in execute (op_array=0x85ff0b0) at zend_vm_execute.h:88
#5 0x082d5837 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfffc630) at zend_vm_execute.h:222
#6 0x082d8448 in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0xbfffc630) at zend_vm_execute.h:1578
#7 0x082d53af in execute (op_array=0x85f9494) at zend_vm_execute.h:88
#8 0x082acfd4 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /usr/local/src/php-5.1.1/Zend/zend.c:1090
#9 0x08269796 in php_execute_script (primary_file=0xbfffea70) at
/usr/local/src/php-5.1.1/main/main.c:1704
#10 0x0831bcb2 in main (argc=3, argv=0xbfffeb54) at
/usr/local/src/php-5.1.1/sapi/cli/php_cli.c:1039


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=35559&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666