Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
Linux 2.6.31-4-generic, Ruby 1.8.7, Thrift r807972
-
Patch Available
Description
When using the BinaryProtocolAccelerated in Ruby, and expecting a map<string,string> and getting something else, a segmentation fault occurs. I was able to trace the segmentation fault back to binary_protocol_accelerated.c, in r807972, the problem is in RSTRING_LEN(str) inside write_string_direct(...).
Notice that, in the Python implementation, or when using BinaryProtocol as opposed to BinaryProtocolAccelerated, an exception is raised when a value has a type other than string in a map<string, string>.
Attached is a patch that solved the problem for me, please advise on whether or not this would be the right way to solve it (it appears to work properly in different cases).
Also, attached is a set of files that can be used to reproduce the segmentation fault mentioned.