'How to get python backtraces for python in valgrind

I'm trying to find a file descriptor leak in python code with valgrind but the backtraces look like this:

==2169309== Open file descriptor 11:
==2169309==    at 0x497648B: eventfd (syscall-template.S:78)
==2169309==    by 0x5AF6E4D: ??? (in /usr/lib/x86_64-linux-gnu/libzmq.so.5.2.2)
==2169309==    by 0x5B208C3: ??? (in /usr/lib/x86_64-linux-gnu/libzmq.so.5.2.2)
==2169309==    by 0x5AFAC96: ??? (in /usr/lib/x86_64-linux-gnu/libzmq.so.5.2.2)
==2169309==    by 0x5B244CD: ??? (in /usr/lib/x86_64-linux-gnu/libzmq.so.5.2.2)
==2169309==    by 0x5AEFB19: ??? (in /usr/lib/x86_64-linux-gnu/libzmq.so.5.2.2)
==2169309==    by 0x5B21646: ??? (in /usr/lib/x86_64-linux-gnu/libzmq.so.5.2.2)
==2169309==    by 0x5AE4A8B: ??? (in /usr/lib/x86_64-linux-gnu/libzmq.so.5.2.2)
==2169309==    by 0x6143577: ??? (in /usr/lib/python3/dist-packages/zmq/backend/cython/socket.cpython-38-x86_64-linux-gnu.so)
==2169309==    by 0x50218A: ??? (in /usr/bin/python3.8)
==2169309==    by 0x5F57ED: PyObject_Call (in /usr/bin/python3.8)
==2169309==    by 0x56CBFA: _PyEval_EvalFrameDefault (in /usr/bin/python3.8)

I know I need the libzmq-dbg to get better backtraces for that part. But how do I get anything useful for the python part? PyObject_Call doesn't tell me where in the python code the call was made.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source