cumulus13 / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

Invalid edge-case behavior: Large 32-bit flags #313

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile and run the latest memcached from the git repository.
2. Telnet into localhost 11211
3. Use the following query, which has a flags value that is 1 too large:
set he 4294967296 50 2
lo
get he
4. Memcached returns the following:
STORED
VALUE he 0 2
lo
END
5. Now try a flags value that is the largest possible value:
set he 4294967295 50 2
yo
get he
6. Memcached returns the following:
STORED
VALUE he -1 2
yo
END

What is the expected output? What do you see instead?
The expected output is CLIENT_ERROR in the first case, and the following in the 
second:
STORED
VALUE he 4294967295 2
yo
END

What version of the product are you using? On what operating system?
I'm using the latest version from the github repository on Linux Mint XFCE.

Please provide any additional information below.
I think that should be enough information to reproduce. Let me know if you have 
any questions.

Original issue reported on code.google.com by ninten...@gmail.com on 26 Mar 2013 at 4:49

GoogleCodeExporter commented 9 years ago
I just put a fix_flags branch which adjusts some of this... it's pretty 
schizofrenic in the code.

The tests pass, but now I'm worried that people are expecting the flags to come 
back negative. :/ It also still doesn't properly error for specifying large 
values, but it does end up storing them as zero.

Will have to give it further thought.

Original comment by dorma...@rydia.net on 28 Apr 2014 at 7:16

GoogleCodeExporter commented 9 years ago
Issue 391 has been merged into this issue.

Original comment by dorma...@rydia.net on 31 Dec 2014 at 6:32