|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-01-21 04:57 UTC] rasmus@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: gopalv
[2012-01-21 04:57 UTC] rasmus@php.net
[2012-01-23 14:46 UTC] uw@php.net
[2013-02-18 00:35 UTC] pecl-dev at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 14:00:01 2025 UTC |
Description: ------------ APC: pecl/svn - trunk (Revision 322504) PHP: 5_4, svn - PHP 5.4.0RC7-dev Static build: ./configure --enable-apc --enable-debug --enable-maintainer-zts The APC user cache returns corrupted hashes. Hash keys are not preserved. arKey is not copied when duplicating a Bucket to be returned to the user. This can be fixed, for example, like this: nixnutz@linux-0v4u:~/php-src/branches/PHP_5_4/ext/apc> svn diff Index: apc_compile.c =================================================================== --- apc_compile.c (Revision 322504) +++ apc_compile.c (Arbeitskopie) @@ -901,6 +901,7 @@ } else { CHECK((newp = (Bucket*) apc_pmemcpy(curr, (sizeof(Bucket) + curr->nKeyLength), pool TSRMLS_CC))); newp->arKey = ((char*)newp) + sizeof(Bucket); + memcpy(newp->arKey, curr->arKey, curr->nKeyLength); } #else CHECK((newp = (Bucket*) apc_pmemcpy(curr, Test script: --------------- php -d apc.enable_cli=1 -r '$tmp = array("foo" => "bar"); apc_add("tmp", $tmp); var_dump(apc_fetch("tmp")); ' array(1) { [""]=> string(3) "bar" } Expected result: ---------------- (Result with patch) nixnutz@linux-0v4u:~/php-src/branches/PHP_5_4> sapi/cli/php -d apc.enable_cli=1 -r '$tmp = array("foo" => "bar"); apc_add("tmp", $tmp); var_dump(apc_fetch("tmp")); ' array(1) { ["foo"]=> string(3) "bar" }