|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-12-19 10:15 UTC] tony2001@php.net
[2005-12-19 13:46 UTC] khad at landak dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 19:00:01 2025 UTC |
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