{"action":"created","issue":{"url":"https://api.github.com/repos/openresty/lua-resty-redis/issues/87","repository_url":"https://api.github.com/repos/openresty/lua-resty-redis","labels_url":"https://api.github.com/repos/openresty/lua-resty-redis/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/openresty/lua-resty-redis/issues/87/comments","events_url":"https://api.github.com/repos/openresty/lua-resty-redis/issues/87/events","html_url":"https://github.com/openresty/lua-resty-redis/issues/87","id":158021675,"number":87,"title":"corrupted result from redis:get","user":{"login":"ethnext","id":6799137,"avatar_url":"https://avatars.githubusercontent.com/u/6799137?v=3","gravatar_id":"","url":"https://api.github.com/users/ethnext","html_url":"https://github.com/ethnext","followers_url":"https://api.github.com/users/ethnext/followers","following_url":"https://api.github.com/users/ethnext/following{/other_user}","gists_url":"https://api.github.com/users/ethnext/gists{/gist_id}","starred_url":"https://api.github.com/users/ethnext/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethnext/subscriptions","organizations_url":"https://api.github.com/users/ethnext/orgs","repos_url":"https://api.github.com/users/ethnext/repos","events_url":"https://api.github.com/users/ethnext/events{/privacy}","received_events_url":"https://api.github.com/users/ethnext/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-01T22:31:03Z","updated_at":"2016-06-02T22:48:57Z","closed_at":null,"body":"my code looks something like\r\n\r\n```lua\r\n  local redis = redis_connection:get_redis()\r\n  local result_json = redis:get(self.params.uuid)\r\n  local result = cjson.decode(result_json)\r\n  ...\r\n```\r\n\r\nintermittently, the `redis:get` call will return a string in which the beginning is replaced by a substring that appears later in the string. that is, if the correct result is:\r\n`one two three four five six seven eight nine ten`\r\nthe corrupted result might look like:\r\n`six seven eight nineive six seven eight nine ten`\r\nthe resulting string is the same length as the correct string.\r\n\r\nthe actual result is much longer than this conceptual example. in the instance I have been able to concretely debug, the size of the result is 10078 bytes. the first 4076 bytes have been replaced by a duplicate of bytes 4084 to 8159 of the correct result. bytes 4076 to the end (10077) are correct. \r\n\r\nI am not certain how generally this description holds. I will try to gather more data from corrupted calls. the intermittent nature of this complicates things slightly."},"comment":{"url":"https://api.github.com/repos/openresty/lua-resty-redis/issues/comments/223445583","html_url":"https://github.com/openresty/lua-resty-redis/issues/87#issuecomment-223445583","issue_url":"https://api.github.com/repos/openresty/lua-resty-redis/issues/87","id":223445583,"user":{"login":"agentzh","id":56241,"avatar_url":"https://avatars.githubusercontent.com/u/56241?v=3","gravatar_id":"","url":"https://api.github.com/users/agentzh","html_url":"https://github.com/agentzh","followers_url":"https://api.github.com/users/agentzh/followers","following_url":"https://api.github.com/users/agentzh/following{/other_user}","gists_url":"https://api.github.com/users/agentzh/gists{/gist_id}","starred_url":"https://api.github.com/users/agentzh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agentzh/subscriptions","organizations_url":"https://api.github.com/users/agentzh/orgs","repos_url":"https://api.github.com/users/agentzh/repos","events_url":"https://api.github.com/users/agentzh/events{/privacy}","received_events_url":"https://api.github.com/users/agentzh/received_events","type":"User","site_admin":false},"created_at":"2016-06-02T22:48:57Z","updated_at":"2016-06-02T22:48:57Z","body":"@ethnext Are you using any 3rd-party Lua C modules or 3rd-party nginx C modules that are not maintained by OpenResty? It seems like a memory corruption of Lua string objects.\r\n\r\nAlso, please ensure you are using the latest OpenResty version."}}
{"actor":{"display_login":"agentzh"}}