[
https://issues.apache.org/jira/browse/THRIFT-3765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15214122#comment-15214122
]
ASF GitHub Bot commented on THRIFT-3765:
----------------------------------------
Github user nsuke commented on a diff in the pull request:
https://github.com/apache/thrift/pull/970#discussion_r57564975
--- Diff: lib/py/src/ext/protocol.tcc ---
@@ -431,6 +433,7 @@ bool ProtocolBase<Impl>::encodeValue(PyObject* value,
TType type, PyObject* type
}
--- End diff --
It shouldn't be...
The value is either null-checked or passed to `Py_INCREF` that does not
accept null.
The intention here is to simply reject too long string values.
If you experienced null value here, we'll need to investigate on that
matter too.
> 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)