diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a4a1689..142929b6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,7 +33,7 @@ jobs: - name: ubu24-analyzers os: ubuntu-24.04 coverage: true - extra_cmake_flags: -DCMAKE_BUILD_TYPE=Debug + debug: on micromamba_shell_init: bash - name: ubu22 os: ubuntu-22.04 @@ -41,6 +41,10 @@ jobs: - name: ubu22-arm os: ubuntu-22.04-arm micromamba_shell_init: bash + - name: ubu22-arm-valgrind + os: ubuntu-22.04-arm + debug: on + micromamba_shell_init: bash - name: osx15-x86 os: macos-15-intel micromamba_shell_init: bash @@ -77,6 +81,9 @@ jobs: if: ${{ runner.os != 'windows' }} run: | os="${{ matrix.os }}" + if [[ "${{ matrix.debug }}" == "on" ]]; then + echo "BUILD_TYPE=Debug" >> $GITHUB_ENV + fi if [[ "${os}" == "macos"* ]]; then echo "ncpus=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV else @@ -114,7 +121,7 @@ jobs: -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ -DXEUS_CPP_ENABLE_CODE_COVERAGE=${{ matrix.coverage }} \ -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \ - ${{ matrix.extra_cmake_flags }} + -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} - name: build, run C++ tests & install if: ${{ runner.os == 'windows' }} @@ -133,6 +140,21 @@ jobs: cd build make install -j ${{ env.ncpus }} make -j ${{ env.ncpus }} check-xeus-cpp + if [[ "${{ matrix.os }}" != "macos"* && "${{ matrix.debug }}" == "on" ]]; then + sudo apt update + sudo apt install libc6-dbg + micromamba install -c conda-forge valgrind + if [[ "${{ matrix.os }}" == *"arm"* ]]; then + SUPPRESSION_FILE="${{ github.workspace }}/etc/xeus-cpp-valgrind_arm.supp" + else + SUPPRESSION_FILE="${{ github.workspace }}/etc/xeus-cpp-valgrind_x86.supp" + fi + valgrind --show-error-list=yes --track-origins=yes --error-exitcode=1 \ + --show-leak-kinds=definite,possible \ + --gen-suppressions=all \ + --suppressions="${SUPPRESSION_FILE}" \ + test/test_xeus_cpp + fi - name: Python tests Unix Systems if: ${{ runner.os != 'windows' }} diff --git a/etc/xeus-cpp-valgrind_arm.supp b/etc/xeus-cpp-valgrind_arm.supp new file mode 100644 index 00000000..fab92aa5 --- /dev/null +++ b/etc/xeus-cpp-valgrind_arm.supp @@ -0,0 +1,43 @@ +{ + Suppression 1 + Memcheck:Addr8 + fun:__GI_memcpy + fun:_ZN4xcpp11interpreter20inspect_request_implERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii + fun:_ZN4xeus12xinterpreter15inspect_requestERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii + fun:_ZN21DOCTEST_ANON_SUITE_11L20DOCTEST_ANON_FUNC_14Ev + fun:_ZN7doctest7Context3runEv + fun:main +} + +{ + Suppression 2 + Memcheck:Addr2 + fun:__GI_memcpy + fun:_ZN4xcpp11interpreter20inspect_request_implERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii + fun:_ZN4xeus12xinterpreter15inspect_requestERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii + fun:_ZN21DOCTEST_ANON_SUITE_11L20DOCTEST_ANON_FUNC_14Ev + fun:_ZN7doctest7Context3runEv + fun:main +} + +{ + Suppression 3 + Memcheck:Overlap + fun:__GI_memcpy + fun:_ZN4xcpp11interpreter20inspect_request_implERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii + fun:_ZN4xeus12xinterpreter15inspect_requestERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii + fun:_ZN21DOCTEST_ANON_SUITE_11L20DOCTEST_ANON_FUNC_12Ev + fun:_ZN7doctest7Context3runEv + fun:main +} + +{ + Suppression 4 + Memcheck:Addr1 + fun:__GI_memcpy + fun:_ZN4xcpp11interpreter20inspect_request_implERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii + fun:_ZN4xeus12xinterpreter15inspect_requestERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii + fun:_ZN21DOCTEST_ANON_SUITE_11L20DOCTEST_ANON_FUNC_14Ev + fun:_ZN7doctest7Context3runEv + fun:main +} diff --git a/etc/xeus-cpp-valgrind_x86.supp b/etc/xeus-cpp-valgrind_x86.supp new file mode 100644 index 00000000..ca73ebdd --- /dev/null +++ b/etc/xeus-cpp-valgrind_x86.supp @@ -0,0 +1,73 @@ +{ + Suppression 1 + Memcheck:Addr8 + fun:memmove + fun:copy + fun:_S_copy + fun:_S_copy_chars + fun:_S_copy_chars + fun:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIN9__gnu_cxx17__normal_iteratorIPKcS4_EEEEvT_SB_St20forward_iterator_tag.isra.0 + fun:basic_string<__gnu_cxx::__normal_iterator > > + fun:str + fun:operator std::__cxx11::sub_match<__gnu_cxx::__normal_iterator > >::string_type + fun:_ZN4xcpp11interpreter20inspect_request_implERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii + fun:_ZN4xeus12xinterpreter15inspect_requestERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii + fun:_ZN21DOCTEST_ANON_SUITE_11L20DOCTEST_ANON_FUNC_14Ev + fun:_ZN7doctest7Context3runEv + fun:main +} + +{ + Suppression 2 + Memcheck:Addr2 + fun:memmove + fun:copy + fun:_S_copy + fun:_S_copy_chars + fun:_S_copy_chars + fun:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIN9__gnu_cxx17__normal_iteratorIPKcS4_EEEEvT_SB_St20forward_iterator_tag.isra.0 + fun:basic_string<__gnu_cxx::__normal_iterator > > + fun:str + fun:operator std::__cxx11::sub_match<__gnu_cxx::__normal_iterator > >::string_type + fun:_ZN4xcpp11interpreter20inspect_request_implERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii + fun:_ZN4xeus12xinterpreter15inspect_requestERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii + fun:_ZN21DOCTEST_ANON_SUITE_11L20DOCTEST_ANON_FUNC_14Ev + fun:_ZN7doctest7Context3runEv + fun:main +} + +{ + Suppression 3 + Memcheck:Cond + fun:_ZN4llvm5APInt7setBitsEjj + fun:_ZL16computeKnownBitsPKN4llvm5ValueERKNS_5APIntERNS_9KnownBitsEjRKNS_13SimplifyQueryE + fun:_ZN4llvm16computeKnownBitsEPKNS_5ValueERNS_9KnownBitsERKNS_10DataLayoutEjPNS_15AssumptionCacheEPKNS_11InstructionEPKNS_13DominatorTreeEb + fun:_ZNK4llvm12SelectionDAG13InferPtrAlignENS_7SDValueE + fun:_ZN12_GLOBAL__N_111DAGCombiner9visitLOADEPN4llvm6SDNodeE + fun:_ZN12_GLOBAL__N_111DAGCombiner7combineEPN4llvm6SDNodeE + fun:_ZN4llvm12SelectionDAG7CombineENS_12CombineLevelEPNS_14BatchAAResultsENS_15CodeGenOptLevelE + fun:_ZN4llvm16SelectionDAGISel17CodeGenAndEmitDAGEv + fun:_ZN4llvm16SelectionDAGISel20SelectAllBasicBlocksERKNS_8FunctionE + fun:_ZN4llvm16SelectionDAGISel20runOnMachineFunctionERNS_15MachineFunctionE + fun:_ZN4llvm22SelectionDAGISelLegacy20runOnMachineFunctionERNS_15MachineFunctionE + fun:_ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE.part.0 +} + +{ + Suppression 4 + Memcheck:Addr1 + fun:memmove + fun:copy + fun:_S_copy + fun:_S_copy_chars + fun:_S_copy_chars + fun:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIN9__gnu_cxx17__normal_iteratorIPKcS4_EEEEvT_SB_St20forward_iterator_tag.isra.0 + fun:basic_string<__gnu_cxx::__normal_iterator > > + fun:str + fun:operator std::__cxx11::sub_match<__gnu_cxx::__normal_iterator > >::string_type + fun:_ZN4xcpp11interpreter20inspect_request_implERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii + fun:_ZN4xeus12xinterpreter15inspect_requestERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii + fun:_ZN21DOCTEST_ANON_SUITE_11L20DOCTEST_ANON_FUNC_14Ev + fun:_ZN7doctest7Context3runEv + fun:main +}