Skip to content

Commit

Permalink
build: make Python memory allocations valgrind friendly
Browse files Browse the repository at this point in the history
When testing with

  meson test -C .build --wrap='valgrind --leak-check=full'

the Python binding will trigger 'Invalid read of size 4' warnings.
Tell Python to use malloc directly for all memory allocation which can
be properly traced by valgrind.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
  • Loading branch information
igaw committed Feb 11, 2022
1 parent 4874da7 commit 0c250e9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libnvme/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ if have_python_support
test_env = environment()
test_env.append('MALLOC_PERTURB_', '0')
test_env.append('PYTHONPATH', join_paths(meson.current_build_dir(), '..'))
test_env.append('PYTHONMALLOC', 'malloc')

# Test section
test('[Python] import libnvme', python3, args: ['-c', 'from libnvme import nvme'], env: test_env)
Expand Down

0 comments on commit 0c250e9

Please sign in to comment.