|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59328 Out of memory when using Memcached::SERIALIZER_JSON and array()
Submitted: 2010-07-29 19:27 UTC Modified: 2010-07-30 16:01 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: antennen at gmail dot com Assigned:
Status: Open Package: memcached (PECL)
PHP Version: 5.3.2 OS: Ubuntu 10.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-07-29 19:27 UTC] antennen at gmail dot com
When trying to retrieve an array from Memcached the script freezes until it dies because of no more memory.

ante@Bagheera:~/php-test$ nc localhost 11211
get a
VALUE a 6 2

Everything works fine when using something different from an array, like an integer.

Reproduce code:
$m = new Memcached;
$m->addServer("localhost", 11211, 0);
$m->setOption(Memcached::OPT_SERIALIZER, Memcached::SERIALIZER_JSON);
$m->set("a", array());

Expected result:
array(0) {

Actual result:
PHP Fatal error:  Out of memory (allocated 628883456) (tried to allocate 2513135616 bytes) in /home/ante/php-test/m.php on line 6
PHP Stack trace:
PHP   1. {main}() /home/ante/php-test/m.php:0
PHP   2. Memcached->get() /home/ante/php-test/m.php:6


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-30 16:01 UTC]
I cannot reproduce this with memcached-1.0.2 and PHP 5.3.2.
 [2011-07-05 23:59 UTC] nilsola at abc dot se
Hey, good to find smoneoe who agrees with me. GMTA.
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 04:01:26 2019 UTC