I am trying to debug a C extension I made using CFFI. I am using Python 3.11 and Valgrind 3.18.1.
As far as I can tell from the docs the only setup needed is setting the PYTHONMALLOC=malloc
environment variable, but for some reason, valgrind just refuses to report any errors with or without it being set.
For example:
# test.py
from myproj._myproj import lib
lib.func_that_calls_malloc()
$ PYTHONMALLOC=malloc valgrind --show-leak-kinds=definite --leak-check=full python test.py
==2880771== Memcheck, a memory error detector
==2880771== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2880771== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==2880771== Command: /home/user/.pyenv/shims/python test.py
==2880771==
$ valgrind --show-leak-kinds=definite --leak-check=full python test.py
==2881962== Memcheck, a memory error detector
==2881962== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2881962== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==2881962== Command: /home/user/.pyenv/shims/python test.py
==2881962==
What am I doing wrong?