memkeys
memkeys copied to clipboard
Add Binary protocol support and support multi-key get response.
This is great. I've got a few minor tweaks and then I'll merge this in. I should have time on Sunday. Thanks!
For me on RHEL6 with CouchBase, this code works for a few seconds (I can see some keys) and then segfaults with the following :
(gdb) bt
#0 0x000000000042e597 in mckeys::MemcacheCommand::parseBinaryResponse (
data=0x7f9618000902 "\201\213\333\027N\372\254'\234\224\276\232&\237&\234\070\240\030\277\242hJ\362$\237\325K\365C\021\323\240G\374\376Ҵ\303t\331\365U\245\215\316\373\267ߟ\344I~\327<p\236\262\370\256V*s\277\377\016,\333?\267\037\344C|\aR\353w\375I\355\375Et7\356N\233M'\377]\216\247n\032\037\"%\306\352\235\374\307\023\030 \017q\302ˢ̳8\277\023\247\251\227\340\254o\036\342\257.\213جbn\312~֧N\223\070\272\376\324p\326W\375>\275\066.\a\266\374\274\257\231\261\062\231\301\271\v\247\373ݮ~ۤy\276\211$\343Y\221\025uS\025U\301E\026V\277\275\033\344\346W\216\352B\260('"..., length=746, sourceAddress=<value optimized out>) at /usr/include/bits/string3.h:52
#1 0x000000000042f121 in mckeys::MemcacheCommand::makeResponse (
data=0x7f9618000902 "\201\213\333\027N\372\254'\234\224\276\232&\237&\234\070\240\030\277\242hJ\362$\237\325K\365C\021\323\240G\374\376Ҵ\303t\331\365U\245\215\316\373\267ߟ\344I~\327<p\236\262\370\256V*s\277\377\016,\333?\267\037\344C|\aR\353w\375I\355\375Et7\356N\233M'\377]\216\247n\032\037\"%\306\352\235\374\307\023\030 \017q\302ˢ̳8\277\023\247\251\227\340\254o\036\342\257.\213جbn\312~֧N\223\070\272\376\324p\326W\375>\275\066.\a\266\374\274\257\231\261\062\231\301\271\v\247\373ݮ~ۤy\276\211$\343Y\221\025uS\025U\301E\026V\277\275\033\344\346W\216\352B\260('"..., length=746, sourceAddress=<value optimized out>) at net/memcache_command.cpp:212
#2 0x000000000042f39d in mckeys::MemcacheCommand::create (pkt=<value optimized out>, captureAddress=<value optimized out>) at net/memcache_command.cpp:81
#3 0x000000000042a166 in mckeys::CaptureEngine::parse (this=0xb83c80, packet=...) at net/capture_engine.cpp:165
#4 0x000000000042b02c in mckeys::CaptureEngine::processPackets (this=0xb83c80, worker_id=1, work_queue=0xb839d0) at net/capture_engine.cpp:116
#5 0x00000037e4cb6470 in ?? () from /usr/lib64/libstdc++.so.6
#6 0x00007f962b77da51 in start_thread () from /lib64/libpthread.so.0
#7 0x00000037e3ce89ad in clone () from /lib64/libc.so.6
I tried the reddit fork since it also added binary protocol support, and that one works for me.