From: khad at landak dot com
Operating system: Linux 2.6
PHP version: 5.1.1
PHP Bug Type: Scripting Engine problem
Bug description: global _super global_
Description:
------------
using global on super global causing segfault or memory corruption.
I have large codes which written in nasty way ;)
see Reproduce code
it works under php 4 and pre 5.1
please helpp
Reproduce code:
---------------
<?
session_start();
$_SESSION["sss"]=1000;
$sessvar = "_SESSION";
function abc()
{
global ${$GLOBALS["sessvar"]};
$biji = ${$GLOBALS["sessvar"]};
print $biji["sss"];
}
abc();
Expected result:
----------------
no segfault
Actual result:
--------------
1000*** glibc detected *** double free or corruption (fasttop): 0x083f4748
***
Aborted
or segfault
#0 0xffffe410 in __kernel_vsyscall ()
#1 0xb7c15ef1 in raise () from /lib/tls/libc.so.6
#2 0xb7c1783b in abort () from /lib/tls/libc.so.6
#3 0xb7c4bff5 in __fsetlocking () from /lib/tls/libc.so.6
#4 0xb7c52587 in malloc_usable_size () from /lib/tls/libc.so.6
#5 0xb7c52a02 in free () from /lib/tls/libc.so.6
#6 0x081ed9a0 in shutdown_memory_manager (silent=0, full_shutdown=0) at
/BUILD/src/php-5.1.1/Zend/zend_alloc.c:512
#7 0x081ccb98 in php_request_shutdown (dummy=0x0) at
/BUILD/src/php-5.1.1/main/main.c:1287
#8 0x08289a81 in main (argc=2, argv=0xbfa77fb4) at
/BUILD/src/php-5.1.1/sapi/cli/php_cli.c:1142
--
Edit bug report at http://bugs.php.net/?id=35731&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=35731&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=35731&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=35731&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35731&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=35731&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35731&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35731&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35731&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35731&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35731&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=35731&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=35731&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35731&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35731&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35731&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35731&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35731&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35731&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35731&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35731&r=mysqlcfg