|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-06-04 14:15 UTC] mikael at synd dot info
[2007-06-04 15:40 UTC] tony2001 at phpclub dot net
[2007-06-07 07:23 UTC] hans at parse dot nl
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 22:00:01 2025 UTC |
Description: ------------ The memcache-serialization code makes the php code double free memory; which causes a crash. Serializing 'by hand' or when $block is not returned the bug can be avoided Reproduce code: --------------- class block { var $waa = 'meukee'; function __sleep() { return array('waa'); } } function cache_failure() { $block = new block(); $GLOBALS['cache']->set('block', $block); return $block; } $cache = new memcache; $cache->connect('localhost', '11211'); cache_failure(); Expected result: ---------------- No double-free crash Actual result: -------------- Breakpoint 2 at 0x40803c81 (gdb) bt #0 0x40803c81 in kill () from /lib/libc.so.6 #1 0x408038e5 in raise () from /lib/libc.so.6 #2 0x40804f00 in abort () from /lib/libc.so.6 #3 0x408376ce in __libc_message () from /lib/libc.so.6 #4 0x4083dcae in _int_free () from /lib/libc.so.6 #5 0x4083e076 in free () from /lib/libc.so.6 #6 0x081c741d in shutdown_memory_manager (silent=0, clean_cache=0) at /usr/src/php-4.4.7/Zend/zend_alloc.c:514 #7 0x081a9d73 in php_request_shutdown (dummy=0x0) at /usr/src/php-4.4.7/main/main.c:1015 #8 0x081ef4e3 in main (argc=2, argv=0xbfffe644) at /usr/src/php-4.4.7/sapi/cli/php_cli.c:889