[issue35984] test__xxsubinterpreters leaked [3, 4, 3] memory blocks, sum=1

Alexey Izbyshev report at bugs.python.org
Wed Feb 13 16:19:23 EST 2019


Alexey Izbyshev <izbyshev at ispras.ru> added the comment:

Thank you for your introduction about _xxsubinterpreters, Eric.

This particular leak is easy: it's right in _channel_send(). I've submitted a PR.

I've also done a quick scan of neighboring code, and it seems there are other leaks as well, e.g.:

* PyThread_free_lock() is not called at https://github.com/python/cpython/blob/dcb68f47f74b0cc8a1896d4a4c5a6b83c0bbeeae/Modules/_xxsubinterpretersmodule.c#L761 (and below)

* data is not released and freed at https://github.com/python/cpython/blob/dcb68f47f74b0cc8a1896d4a4c5a6b83c0bbeeae/Modules/_xxsubinterpretersmodule.c#L1387

Do you think it'd make sense to go through the module to find and fix leaks? Or is this code in an early stage for such cleanup?

As a side note, such leaks should be easily found by static analyzers such as Coverity (assuming it understands CPython allocation functions like PyMem_NEW), so it might make sense to check out its reports on the module.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35984>
_______________________________________


More information about the Python-bugs-list mailing list