Chandler May created THRIFT-3765:
------------------------------------

             Summary: memory leak in python compact protocol extension
                 Key: THRIFT-3765
                 URL: https://issues.apache.org/jira/browse/THRIFT-3765
             Project: Thrift
          Issue Type: Bug
          Components: Python - Library
    Affects Versions: 0.10.0
            Reporter: Chandler May


There is a memory leak in the compact protocol encoder extension module 
introduced in THRIFT-3612.  This leak is significant enough to prevent us from 
using the extension in practice.

Example output from valgrind:
{code}
==18238== 4,177,472 bytes in 96,403 blocks are definitely lost in loss record 
3,534 of 3,534
==18238==    at 0x4C29BFD: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==18238==    by 0x4EBD49C: PyObject_Malloc (in /usr/lib64/libpython2.7.so.1.0)
==18238==    by 0x4EC6381: PyString_FromStringAndSize (in 
/usr/lib64/libpython2.7.so.1.0)
==18238==    by 0x4EE9669: PyUnicodeUCS4_EncodeUTF8 (in 
/usr/lib64/libpython2.7.so.1.0)
==18238==    by 0x143D0CC7: 
apache::thrift::py::ProtocolBase<apache::thrift::py::CompactProtocol>::encodeValue(_object*,
 apache::thrift::py::TType, _object*) (protocol.tcc:422)
==18238==    by 0x143D085B: writeField (compact.h:100)
==18238==    by 0x143D085B: 
apache::thrift::py::ProtocolBase<apache::thrift::py::CompactProtocol>::encodeValue(_object*,
 apache::thrift::py::TType, _object*) (protocol.tcc:531)
==18238==    by 0x143D0F71: 
apache::thrift::py::ProtocolBase<apache::thrift::py::CompactProtocol>::encodeValue(_object*,
 apache::thrift::py::TType, _object*) (protocol.tcc:459)
==18238==    by 0x143D085B: writeField (compact.h:100)
==18238==    by 0x143D085B: 
apache::thrift::py::ProtocolBase<apache::thrift::py::CompactProtocol>::encodeValue(_object*,
 apache::thrift::py::TType, _object*) (protocol.tcc:531)
==18238==    by 0x143D085B: writeField (compact.h:100)
==18238==    by 0x143D085B: 
apache::thrift::py::ProtocolBase<apache::thrift::py::CompactProtocol>::encodeValue(_object*,
 apache::thrift::py::TType, _object*) (protocol.tcc:531)
==18238==    by 0x143D085B: writeField (compact.h:100)
==18238==    by 0x143D085B: 
apache::thrift::py::ProtocolBase<apache::thrift::py::CompactProtocol>::encodeValue(_object*,
 apache::thrift::py::TType, _object*) (protocol.tcc:531)
==18238==    by 0x143D0F71: 
apache::thrift::py::ProtocolBase<apache::thrift::py::CompactProtocol>::encodeValue(_object*,
 apache::thrift::py::TType, _object*) (protocol.tcc:459)
==18238==    by 0x143D085B: writeField (compact.h:100)
==18238==    by 0x143D085B: 
apache::thrift::py::ProtocolBase<apache::thrift::py::CompactProtocol>::encodeValue(_object*,
 apache::thrift::py::TType, _object*) (protocol.tcc:531)
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to