From 07b917ca4e5a1e36888c1a3d23407861e585ce6d Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 21 Aug 2020 14:16:41 +0200 Subject: [PATCH 1/2] tests: Add ostree ioctl valgrind suprression I was getting this in the CI: --30631-- WARNING: unhandled amd64-linux syscall: 315 --30631-- You may be able to write your own handler. --30631-- Read the file README_MISSING_SYSCALL_OR_IOCTL. --30631-- Nevertheless we consider this a bug. Please report --30631-- it at http://valgrind.org/support/bug_reports.html. runtime/org.test.Platform/x86_64/stable: 13b73140218edd02a9d18bc178af1a3ad0203049f9f1ad8c51c62b3ee5f1acd9 ==30631== Syscall param ioctl(generic) points to unaddressable byte(s) ==30631== at 0x53A437B: ioctl (syscall-template.S:78) ==30631== by 0x4B4456E: ??? (in /usr/lib/x86_64-linux-gnu/libostree-1.so.1.0.0) ==30631== by 0x4B466FB: ??? (in /usr/lib/x86_64-linux-gnu/libostree-1.so.1.0.0) ==30631== by 0x4B48F29: ostree_repo_write_content (in /usr/lib/x86_64-linux-gnu/libostree-1.so.1.0.0) ==30631== by 0x1D9161: flatpak_mtree_create_symlink (in /home/runner/work/flatpak/flatpak/_build/flatpak) ==30631== by 0x1DF95B: flatpak_repo_generate_appstream (in /home/runner/work/flatpak/flatpak/_build/flatpak) ==30631== by 0x157870: flatpak_builtin_build_update_repo (in /home/runner/work/flatpak/flatpak/_build/flatpak) ==30631== by 0x135793: main (in /home/runner/work/flatpak/flatpak/_build/flatpak) ==30631== Address 0xe is not stack'd, malloc'd or (recently) free'd ==30631== { Memcheck:Param ioctl(generic) fun:ioctl obj:/usr/lib/x86_64-linux-gnu/libostree-1.so.1.0.0 obj:/usr/lib/x86_64-linux-gnu/libostree-1.so.1.0.0 fun:ostree_repo_write_content fun:flatpak_mtree_create_symlink fun:flatpak_repo_generate_appstream fun:flatpak_builtin_build_update_repo fun:main } --- tests/flatpak.supp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/flatpak.supp b/tests/flatpak.supp index 4736b8703..aae8ae160 100644 --- a/tests/flatpak.supp +++ b/tests/flatpak.supp @@ -156,6 +156,15 @@ fun:_check_support_reflink } +# Some unsupported ioctl +{ + ignore_ostree_write_ioctl + Memcheck:Param + ioctl(generic) + fun:ioctl + obj:*/libostree-1.so.1.0.0 +} + # ostree pthread_create issue { ostree_pthread_create_issue From 946cf126b73cb9eb0f1638d8b29ea2e272698d8d Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 21 Aug 2020 12:08:00 +0200 Subject: [PATCH 2/2] CI: Add a valgrind check This takes a long time, but doesn't have to be mandatory, also we only run it if the regular make check passes. Removes some old no-longer needed ci config workaround. The new test uses ubuntu-20.04 so we get wider distro testing. --- .github/workflows/check.yml | 54 ++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 74daa4b9e..08a6e6f56 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -25,8 +25,6 @@ jobs: steps: - name: Install Dependencies run: | - # Work around github repo bug (see https://github.community/t5/GitHub-Actions/ubuntu-latest-Apt-repository-list-issues/m-p/41163/highlight/true#M4513) - for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done sudo add-apt-repository ppa:alexlarsson/flatpak sudo add-apt-repository ppa:alexlarsson/glib260 sudo apt-get update @@ -87,8 +85,6 @@ jobs: steps: - name: Install Dependencies run: | - # Work around github repo bug (see https://github.community/t5/GitHub-Actions/ubuntu-latest-Apt-repository-list-issues/m-p/41163/highlight/true#M4513) - for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done sudo add-apt-repository ppa:alexlarsson/flatpak sudo add-apt-repository ppa:alexlarsson/glib260 sudo apt-get update @@ -133,3 +129,53 @@ jobs: CFLAGS: -Werror=unused-variable - name: Build flatpak run: make -j $(getconf _NPROCESSORS_ONLN) + + valgrind: + name: Run tests in valgrind + needs: check # Don't run expensive test if main check fails + runs-on: ubuntu-20.04 # Might as well test with a different one too + steps: + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y libglib2.0 attr automake gettext autopoint bison dbus gtk-doc-tools \ + libfuse-dev ostree libostree-dev libarchive-dev libzstd-dev libcap-dev libattr1-dev libdw-dev libelf-dev python3-pyparsing \ + libjson-glib-dev shared-mime-info desktop-file-utils libpolkit-agent-1-dev libpolkit-gobject-1-dev \ + libseccomp-dev libsoup2.4-dev libsystemd-dev libxml2-utils libgpgme11-dev gobject-introspection \ + libgirepository1.0-dev libappstream-glib-dev libdconf-dev clang socat meson libdbus-1-dev \ + valgrind + - name: Check out flatpak + uses: actions/checkout@v1 + with: + submodules: true + - name: Create logs dir + run: mkdir test-logs + - name: autogen.sh + run: NOCONFIGURE=1 ./autogen.sh + - name: configure + # TODO: Enable gtk-doc builds + run: | + mkdir _build + pushd _build + ../configure + popd + env: + CFLAGS: -O2 + - name: Build flatpak + run: make -C _build -j $(getconf _NPROCESSORS_ONLN) + - name: Run tests + run: make -C _build check + env: + FLATPAK_TESTS_VALGRIND: true + - name: Collect overall test logs on failure + if: failure() + run: mv _build/test-suite.log test-logs/ || true + - name: Collect individual test logs on cancel + if: failure() || cancelled() + run: mv _build/tests/*.log test-logs/ || true + - name: Upload test logs + uses: actions/upload-artifact@v1 + if: failure() || cancelled() + with: + name: test logs + path: test-logs