php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59542 Memcache returning incorrect values
Submitted: 2010-12-18 13:56 UTC Modified: 2011-03-10 21:59 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: daedalusvx at gmail dot com Assigned:
Status: No Feedback Package: memcache (PECL)
PHP Version: 5.3.2 OS: Ubuntu Lucid 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: daedalusvx at gmail dot com
New email:
PHP Version: OS:

 

 [2010-12-18 13:56 UTC] daedalusvx at gmail dot com
Description:
------------
https://launchpad.net/ubuntu/lucid/amd64/php5-memcache/3.0.4-2build1

Note: The latest build in Lucid for this is 3.0.4-2build1 and I'm not seeing a fix for the issue I'm experiencing in the changelog, so I figure I'd post here.

When I request the value for a key that was never set, it appears that memcache is returning an entirely different value for a different key.

Reproduce code:
---------------
$memcache->get( '2fa0669ba9eb40cf2f266fc07cf4fac2::HardCache::blog::index::OUTPUT' );



Expected result:
----------------
Should not return anything as nothing was ever set to that key

Actual result:
--------------
The value for the key '2fa0669ba9eb40cf2f266fc07cf4fac2::XHTMLXML2ArrayDispatcherNodes'

Array
(
    [aboutindex] => Array
        (
            [about] => Array
                (
                    [index] => Array
                        (
                            [Localizations] => Array
                                (
                                    [0] => Array
                                        (
                                            [countryCode] => 
                                            [languageCode] => 
                                            [variesOnUserAgent] => 
                                            [dispatchPath] => AboutIndex.tpl
                                        )

                                )

                            [path] => About
                        )

                )

        )

    [blogindex] => Array
        (
            [about] => Array
                (
                    [index] => Array
                        (
                            [Localizations] => Array
                                (
                                    [0] => Array
                                        (
                                            [countryCode] => 
                                            [languageCode] => 
                                            [variesOnUserAgent] => 
                                            [dispatchPath] => AboutIndex.tpl
                                        )

                                )

                            [path] => About
                        )

                )

            [blog] => Array
                (
                    [index] => Array
                        (
                            [Localizations] => Array
                                (
                                    [0] => Array
                                        (
                                            [countryCode] => 
                                            [languageCode] => 
                                            [variesOnUserAgent] => 
                                            [dispatchPath] => BlogIndex.tpl
                                        )

                                )

                            [path] => Blog
                        )

                )

        )

    [contactindex] => Array
        (
            [about] => Array
                (
                    [index] => Array
                        (
                            [Localizations] => Array
                                (
                                    [0] => Array
                                        (
                                            [countryCode] => 
                                            [languageCode] => 
                                            [variesOnUserAgent] => 
                                            [dispatchPath] => AboutIndex.tpl
                                        )

                                )

                            [path] => About
                        )

                )

            [blog] => Array
                (
                    [index] => Array
                        (
                            [Localizations] => Array
                                (
                                    [0] => Array
                                        (
                                            [countryCode] => 
                                            [languageCode] => 
                                            [variesOnUserAgent] => 
                                            [dispatchPath] => BlogIndex.tpl
                                        )

                                )

                            [path] => Blog
                        )

                )

            [contact] => Array
                (
                    [index] => Array
                        (
                            [Localizations] => Array
                                (
                                    [0] => Array
                                        (
                                            [countryCode] => 
                                            [languageCode] => 
                                            [variesOnUserAgent] => 
                                            [dispatchPath] => ContactIndex.tpl
                                        )

                                )

                            [path] => Contact
                        )

                )

        )
)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-19 01:28 UTC] hradtke@php.net
I am unable to reproduce this with the following script:

$memcache_obj = memcache_connect('localhost', 11211);

$key = '2fa0669ba9eb40cf2f266fc07cf4fac2::XHTMLXML2ArrayDispatcherNodes';
memcache_set($memcache_obj, $key, 'foo');

$key = '2fa0669ba9eb40cf2f266fc07cf4fac2::HardCache::blog::index::OUTPUT';
$ret = memcache_get($memcache_obj, $key);
var_dump($ret);
 [2011-03-10 21:59 UTC] hradtke@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2017-03-07 00:15 UTC] malberts at zynga dot com
I may have a similar issue.  The symptoms are not identical.  

Content
 - php56 - 5.6.29 (5.6.29-1.131.amzn1)
 - php56-pecl-memcache - 3.0.8 (3.0.8-6.17.amzn1)
 - amazon linux - 3.14.35-28.38.amzn1.x86_64 #1 SMP Wed Mar 11 22:50:37 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
 - mpm prefork
 - httpd 2.4 - (2.4.25-1.68.amzn1 )

I'm noticing stale data on read. It's not 100%, fairly low volume, ~25 per hour with a request volume of 50 million per hour.

I'm able to detect the issue by either
 1. processing a netcat execution from within the script
 2. processing a secondary read

Data Context
 - key - ZAPI_IDMAPPER_72752798226
 - value on first read - {"zapi_identity_player_result_72752798226":"{\\"i\\":{\\"72613683383\\":\\"24\\",\\"72752798226\\":\\"1\\"},\\"n2p\\":{\\"72613683383\\":{\\"5003043\\":\\"72613683383\\"}}}"}
 - value on second read - {"ZAPI_IDMAPPER_72752798226":"{\\"72613683383\\":\\"24\\",\\"72752798226\\":\\"1\\"}"}
 - value on netcat - ["VALUE ZAPI_IDMAPPER_72752798226 0 38","{\\"72613683383\\":\\"24\\",\\"72752798226\\":\\"1\\"}","END"]

Notice NetCat and the secondary read returned the same value, which is the correct value ... which is not that value returned on the initial read.

I cant provide another example that mirrors the report

 - key - zapi_playerid_mapping|n2p|72752798226
 - value on first read - {"ZAPI_IDMAPPER_72752798226":"{\\"72613683383\\":\\"24\\",\\"72752798226\\":\\"1\\"}"}
 - value on second read - []
 - value on netcat - [END] 

In both cases the value returned on the first read is a value that would have been returned on a lookup at an earlier stage in the execution.  In fact, in both cases, when the value returned is incorrect, the incorrect value would have been the result of the get preceding this one in the call stack (e.g. it appears to be returning stale data from the previous call to get).
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 08 13:03:41 2021 UTC