php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35731 global _super global_
Submitted: 2005-12-19 10:08 UTC Modified: 2005-12-19 13:46 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: khad at landak dot com Assigned:
Status: Closed Package: Session related
PHP Version: 5.1.1 OS: Linux 2.6
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: khad at landak dot com
New email:
PHP Version: OS:

 

 [2005-12-19 10:08 UTC] khad at landak dot com
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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-19 10:15 UTC] 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

Can't reproduce.
 [2005-12-19 13:46 UTC] khad at landak dot com
work using latest snapshot
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 12:01:36 2025 UTC