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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri May 24 19:01:29 2024 UTC