[issue43145] Leak of locks from multiprocessing.Process

2021-02-10 Thread Boris Staletic
Boris Staletic added the comment: The `multiprocessing.Process`, on Linux, ends up doing something like this: pid = os.fork() if pid == 0: os._exit() Translated to C: int main() { Py_Initialize(); PyOS_BeforeFork(); pid_t pid = fork(); if (pid == 0

[issue43145] Leak of locks in a subprocess

2021-02-06 Thread Boris Staletic
Boris Staletic added the comment: Slightly simpler C example: #include int main() { Py_Initialize(); PyObject* multiprocessing = PyImport_ImportModule("multiprocessing"); PyObject* Process = PyObject_GetAttrString(multiprocessing, "Process");

[issue43145] Leak of locks in a subprocess

2021-02-06 Thread Boris Staletic
New submission from Boris Staletic : The following C code leaks 7 locks allocated with PyThread_allocate_lock: #include int main() { Py_Initialize(); PyObject* multiprocessing = PyImport_ImportModule("multiprocessing"); PyObject* Process = PyObject_Get

[issue42961] Use-after-free (of a heap type) during finalization

2021-01-19 Thread Boris Staletic
Boris Staletic added the comment: Oops... I uploaded (and pasted) the wrong file. The /correct/ example can be found here: https://github.com/pybind/pybind11/pull/2797/#pullrequestreview-570541151 However, I have just realized that the example doesn't really need the embedded module

[issue42961] Use-after-free (of a heap type) during finalization

2021-01-18 Thread Boris Staletic

[issue42176] Valgrind reports "Conditional jump or move depends on uninitialised value(s)" in `PyUnicode_AsEncodedString` and `PyUnicode_Decode`

2020-10-28 Thread Boris Staletic
Boris Staletic added the comment: Thanks for looking into this. > Looks like a bug in valgrind. That actually explains why I wasn't able to reproduce this problem on my local machine. Ubuntu 20.04 comes with valgrind 3.15.0, while my local machine has 3.16.1. Upgrading valgrind on Ubu

[issue42176] Valgrind reports "Conditional jump or move depends on uninitialised value(s)" in `PyUnicode_AsEncodedString` and `PyUnicode_Decode`

2020-10-27 Thread Boris Staletic
Boris Staletic added the comment: I can also reproduce the same problem with the ubuntu packaged python3, which is 3.8.5 on Ubuntu 20.04. The only problem is that, with a stripped library, you don't get line numbers in valgrind's output. Steps to repro: 1. apt install valgrind gcc python3

[issue42176] Valgrind reports "Conditional jump or move depends on uninitialised value(s)" in `PyUnicode_AsEncodedString` and `PyUnicode_Decode`

2020-10-27 Thread Boris Staletic
New submission from Boris Staletic : When running valgrind on a C code that calls `PyUnicode_AsEncodedString` and `PyUnicode_Decode`, valgrind reports that there's a conditional jump based on uninitialized variable, if the encoding is "latin1". I am able to replicate the