Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3765

memory leak in python compact protocol extension

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.10.0
    • 0.10.0
    • Python - Library
    • None

    Description

      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:

      ==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)
      

      Attachments

        Activity

          People

            cjmay Chandler May
            cjmay Chandler May
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: