php.net |  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: 2021-06-09 11:25 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: antennen at gmail dot com Assigned: cmb (profile)
Status: Closed Package: memcached (PECL)
PHP Version: 5.3.2 OS: Ubuntu 10.04
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: antennen at gmail dot com
New email:
PHP Version: OS:

 

 [2010-07-29 19:27 UTC] antennen at gmail dot com
Description:
------------
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:
---------------
<?php
$m = new Memcached;
$m->addServer("localhost", 11211, 0);
$m->setOption(Memcached::OPT_SERIALIZER, Memcached::SERIALIZER_JSON);
$m->set("a", array());
var_dump($m->get("a"));

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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-30 16:01 UTC] andrei@php.net
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.
 [2021-06-09 11:25 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-06-09 11:25 UTC] cmb@php.net
The memcached bug tracker is now on Github[1].  If this is still
an issue with the current memcached version, please report there.

[1] <https://github.com/php-memcached-dev/php-memcached/issues>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 23:01:28 2024 UTC