-
Notifications
You must be signed in to change notification settings - Fork 323
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
\x0a in key passed to get() and set() locks up connection and triggers a fatal timeout error #339
Comments
Hmm, behaviour is a little weird. A)
B)
C)
Keys can be up to 250 bytes. Can't contain: Side note, the value you are trying to set, an array, would not be valid. Argument 2 of I was using 3.0.2 php-memcached. STAT version 1.4.35 / STAT libevent 2.1.8-stable |
It would make sense to me that the client library should validate keys that are documented as being invalid in memcached, so I will look into adding the necessary code.
|
Ok, I see the problem: the code that checks the validity of the keys is not null-safe, whereas the code that places the keys into the protocol stream is null-safe. |
I was finally able to reproduce the problem - the unit test for key validity was actually enabling libmemcached to do its own key checks, using In the short term, you can add |
FYI: after I had accidentally added binary data to the key value, I discovered that the value passed to get() and set() are allowed to contain data that can trigger a fatal error (memcache timeout after X seconds). This only affects the running PHP script.
See this short example below.
Interestingly, it does not happen if the get() is commented out. It has to be get() first before set() hangs.
The text was updated successfully, but these errors were encountered: