Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storing array bizarre key error #35

Closed
kowach opened this issue Aug 13, 2013 · 9 comments
Closed

storing array bizarre key error #35

kowach opened this issue Aug 13, 2013 · 9 comments

Comments

@kowach
Copy link

kowach commented Aug 13, 2013

When storing array some keys are scrambled to some random value same length as previous key.

$apc_data = array(
    'test'=>'123', 
    'data'=>'test123456');
$apc_key = 'abc';
apc_store($apc_key, $apc_data);
  • in same request apc_fetch returns ok keys
  • on next request(s) apc_fetch returns something like this
Array
(
    [@��b] => 123
    [`��b] => test123456
)

PHP 5.5.1
APCu 4.0.2
Apache 2.2.15
CentOS release 6.4 x86_64

@krakjoe
Copy link
Owner

krakjoe commented Aug 13, 2013

Not able to reproduce with the code you provided, does this exact code shows errors for you ??

Looks as if the memory that was allocated for keys was free'd, don't see where this might happen ...

@kowach
Copy link
Author

kowach commented Aug 13, 2013

There is no error in log. I'm runnig it under my test (virtual) machine. Maybe there is conflict with some other extension. I have lots of stuff there...

I have installed fresh centos and it seams everything ok.

@arjenschol
Copy link

I've see this too under PHP 5.4.x and ArchLinux. Unfortunately, I was not able to create a stand-alone testcase although it was repeatable.

@krakjoe
Copy link
Owner

krakjoe commented Aug 15, 2013

I'm not able to reproduce under apache, someone said they could reproduce with fpm, so I'll try that when I've some time to setup ...

@kowach
Copy link
Author

kowach commented Aug 16, 2013

I tried to debug line by line, sometimes it retrieves array keys ok, sometimes not. I could not find the pattern, only that it happens on more complex php scripts and/or after certain time of doing nothing. I have case where one script repairs the state of key and other script scrambles it.

@dhardtke
Copy link

I got the same problem, but can't reproduce it..

@gxs85
Copy link

gxs85 commented Aug 26, 2013

Corruption seemed to disappear after changing apc.serializer ini setting to "php".

krakjoe added a commit that referenced this issue Aug 26, 2013
@krakjoe
Copy link
Owner

krakjoe commented Aug 26, 2013

can someone else confirm ...

@kowach
Copy link
Author

kowach commented Aug 26, 2013

Confirmed. Bug is in default apc serializer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants