From 2eeaad2ac52a500146149a7e35f4141e50659fb7 Mon Sep 17 00:00:00 2001 From: Aaron Jomy <75925957+maximusron@users.noreply.github.com> Date: Sun, 28 Apr 2024 12:51:41 +0200 Subject: [PATCH 1/5] Try xfail on ctypes array delete to fix valgrind leak --- test/test_lowlevel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_lowlevel.py b/test/test_lowlevel.py index 55e366d0..96be3bc7 100644 --- a/test/test_lowlevel.py +++ b/test/test_lowlevel.py @@ -138,7 +138,7 @@ def test05_array_as_ref(self): f = array('f', [0]); ctd.set_float_r(f); assert f[0] == 5. f = array('d', [0]); ctd.set_double_r(f); assert f[0] == -5. - @mark.skipif(not IS_CLANG_REPL, reason="Crashes on Cling") + @mark.xfail def test06_ctypes_as_ref_and_ptr(self): """Use ctypes for pass-by-ref/ptr""" From fa42735aa1a2683829148cde29762ff1594d202a Mon Sep 17 00:00:00 2001 From: Aaron Jomy <75925957+maximusron@users.noreply.github.com> Date: Sun, 28 Apr 2024 14:56:10 +0000 Subject: [PATCH 2/5] Inspect errors on valgrind --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d801d2b..886b1e76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -298,7 +298,7 @@ jobs: valgrind --error-exitcode=1 --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v || true else echo "Running valgrind on passing tests" - valgrind --error-exitcode=1 --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v + valgrind -s --error-exitcode=1 --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v fi export RETCODE=+$? echo ::endgroup:: From 7edacfd635956781d34ec284d8f3c18d2608d5f1 Mon Sep 17 00:00:00 2001 From: Aaron Jomy <75925957+maximusron@users.noreply.github.com> Date: Sun, 28 Apr 2024 14:57:57 +0000 Subject: [PATCH 3/5] Revert "Mark valgrind failing test xfail" This PR marked an incorrect test that was not responsible for the valgrind error --- test/test_lowlevel.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_lowlevel.py b/test/test_lowlevel.py index 96be3bc7..a0b38bf9 100644 --- a/test/test_lowlevel.py +++ b/test/test_lowlevel.py @@ -108,7 +108,6 @@ def test04_python_casts(self): ptrptr = cppyy.ll.as_ctypes(s, byref=True) assert pycasts.get_deref(ptrptr) == actual - @mark.xfail def test05_array_as_ref(self): """Use arrays for pass-by-ref""" From 8e5f22deb4d1b803ac350142747067093e8caff9 Mon Sep 17 00:00:00 2001 From: Aaron Jomy <75925957+maximusron@users.noreply.github.com> Date: Mon, 29 Apr 2024 13:16:24 +0200 Subject: [PATCH 4/5] Add failure reason to test_lowlevel.py --- test/test_lowlevel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_lowlevel.py b/test/test_lowlevel.py index a0b38bf9..4822b502 100644 --- a/test/test_lowlevel.py +++ b/test/test_lowlevel.py @@ -137,7 +137,7 @@ def test05_array_as_ref(self): f = array('f', [0]); ctd.set_float_r(f); assert f[0] == 5. f = array('d', [0]); ctd.set_double_r(f); assert f[0] == -5. - @mark.xfail + @mark.xfail(reason = "Valgrind detects memory leak with invalid delete[] operator") def test06_ctypes_as_ref_and_ptr(self): """Use ctypes for pass-by-ref/ptr""" From e1b171565773f71a778599ba4d7c7e47fa4dd447 Mon Sep 17 00:00:00 2001 From: Aaron Jomy <75925957+maximusron@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:44:04 +0200 Subject: [PATCH 5/5] Show error as list at the end of valgrind run Co-authored-by: Vassil Vassilev --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 886b1e76..cf5c5744 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -298,7 +298,7 @@ jobs: valgrind --error-exitcode=1 --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v || true else echo "Running valgrind on passing tests" - valgrind -s --error-exitcode=1 --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v + valgrind --show-error-list=yes --error-exitcode=1 --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v fi export RETCODE=+$? echo ::endgroup::