From 5f73c12d0cad91446b63f6101a3e55168b107a66 Mon Sep 17 00:00:00 2001 From: Marco Edoardo Santimaria Date: Sat, 27 Sep 2025 15:06:09 +0200 Subject: [PATCH 1/6] Updated syscall_intercept dependecy Moved Syscall intercept project from pmem to alpha-unito/syscall_intercept --- .github/workflows/ci-tests.yaml | 23 +++++++++++++++++++- Dockerfile | 2 -- capio/posix/syscall_intercept/CMakeLists.txt | 8 ++++--- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index 64a56db95..5941eec06 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -146,7 +146,6 @@ jobs: run: | apt update apt install -y \ - libcapstone-dev \ openmpi-bin \ libopenmpi-dev \ ninja-build \ @@ -164,6 +163,28 @@ jobs: python3-pip \ python3-venv + - name: "Get compiler version" + run: | + IFS='-' read -r -a COMPILER <<< "${{ matrix.cxx }}" + echo "CXX_VERSION=${COMPILER[1]}" >> $GITHUB_ENV + - name: "Install Clang" + if: ${{ startsWith(matrix.cxx, 'clang-') }} + run: | + wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh + chmod u+x /tmp/llvm.sh + sudo /tmp/llvm.sh ${{ env.CXX_VERSION }} + rm -f /tmp/llvm.sh + - name: "Fix missing libclang_rt.profile for Clang 14" + if: ${{ matrix.cxx == 'clang-14' }} + run: | + sudo apt download libclang-rt-14-dev + sudo dpkg --force-all -i libclang-rt-14-dev* + - name: "Install GCC" + if: ${{ startsWith(matrix.cxx, 'g++-') }} + run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt update + sudo apt install -y ${{ matrix.cxx }} - name: "Run CMake" shell: bash run: | diff --git a/Dockerfile b/Dockerfile index 67367755e..5e6b9f7c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,6 @@ RUN apt update \ ca-certificates \ cmake \ git \ - libcapstone-dev \ libopenmpi-dev \ ninja-build \ openmpi-bin \ @@ -38,7 +37,6 @@ ENV LD_LIBRARY_PATH="/usr/local/lib" RUN apt update \ && apt install -y --no-install-recommends \ - libcapstone4 \ openmpi-bin \ openssh-server \ && rm -rf /var/lib/apt/lists/* \ diff --git a/capio/posix/syscall_intercept/CMakeLists.txt b/capio/posix/syscall_intercept/CMakeLists.txt index 650784458..9b91fd1a0 100644 --- a/capio/posix/syscall_intercept/CMakeLists.txt +++ b/capio/posix/syscall_intercept/CMakeLists.txt @@ -14,13 +14,15 @@ include(ExternalProject) # Import external project from git ##################################### ExternalProject_Add(syscall_intercept - GIT_REPOSITORY https://github.com/pmem/syscall_intercept.git - GIT_TAG ca4b13531f883597c2f04a40e095f76f6c3a6d22 + GIT_REPOSITORY https://github.com/alpha-unito/syscall_intercept.git + GIT_TAG 7dbdf6ab9c576f96843ef2553b7efc7d15cf66b4 PREFIX ${CMAKE_CURRENT_BINARY_DIR} CMAKE_ARGS + -DSTATIC_CAPSTONE=ON -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -) \ No newline at end of file + -DPERFORM_STYLE_CHECKS=OFF +) From 96e602bc0f85938603198246cec74404763b67ef Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Sat, 27 Sep 2025 17:50:28 +0200 Subject: [PATCH 2/6] Adjust server setup function --- capio/tests/integration/src/main.cpp | 4 +++- capio/tests/unit/syscall/src/main.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/capio/tests/integration/src/main.cpp b/capio/tests/integration/src/main.cpp index 377356755..822801008 100644 --- a/capio/tests/integration/src/main.cpp +++ b/capio/tests/integration/src/main.cpp @@ -1,5 +1,7 @@ #include +#include "capio/syscall.hpp" + char **build_args() { char **args = (char **) malloc(3 * sizeof(uintptr_t)); @@ -59,7 +61,7 @@ class CapioServerEnvironment : public testing::Environment { void SetUp() override { if (server_pid < 0) { ASSERT_NE(std::getenv("CAPIO_DIR"), nullptr); - ASSERT_GE(server_pid = fork(), 0); + ASSERT_GE(server_pid = capio_syscall(SYS_fork), 0); if (server_pid == 0) { execvpe(args[0], args, envp); _exit(127); diff --git a/capio/tests/unit/syscall/src/main.cpp b/capio/tests/unit/syscall/src/main.cpp index 5654badbf..ce82886eb 100644 --- a/capio/tests/unit/syscall/src/main.cpp +++ b/capio/tests/unit/syscall/src/main.cpp @@ -1,6 +1,8 @@ #include #include +#include "capio/syscall.hpp" + char **build_args() { char **args = (char **) malloc(4 * sizeof(uintptr_t)); @@ -66,7 +68,7 @@ class CapioServerEnvironment : public testing::Environment { void SetUp() override { if (server_pid < 0) { ASSERT_NE(std::getenv("CAPIO_DIR"), nullptr); - ASSERT_GE(server_pid = fork(), 0); + ASSERT_GE(server_pid = capio_syscall(SYS_fork), 0); if (server_pid == 0) { execvpe(args[0], args, envp); _exit(127); From 4c33cb12d1e3d9f2e8a6b5c8ea06ec003c3b1763 Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Sat, 27 Sep 2025 18:53:13 +0200 Subject: [PATCH 3/6] TO DELETE: fix tests by changing them --- capio/tests/unit/syscall/src/clone.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/capio/tests/unit/syscall/src/clone.cpp b/capio/tests/unit/syscall/src/clone.cpp index d5bd37242..3a7bb94c3 100644 --- a/capio/tests/unit/syscall/src/clone.cpp +++ b/capio/tests/unit/syscall/src/clone.cpp @@ -4,6 +4,7 @@ #include #include +#include #include constexpr int ARRAY_SIZE = 100; @@ -61,7 +62,7 @@ TEST(SystemCallTest, TestThreadCloneProducerConsumer) { } TEST(SystemCallTest, TestForkParentChild) { - auto pid = fork(); + auto pid = syscall(SYS_fork); EXPECT_GE(pid, 0); if (pid == 0) { exit(EXIT_SUCCESS); @@ -69,7 +70,7 @@ TEST(SystemCallTest, TestForkParentChild) { } TEST(SystemCallTest, TestThreadCloneProducerConsumerWithStat) { - constexpr const char *PATHNAME = "test_file.txt"; + constexpr const char *PATHNAME = "test_clone.txt"; sem = static_cast(malloc(sizeof(sem_t))); EXPECT_EQ(sem_init(sem, 0, 0), 0); FILE *fp = fopen(PATHNAME, "w+"); From ea8dc4ce1cc93a8a5373a83ce1d5367bbafa2f34 Mon Sep 17 00:00:00 2001 From: marcoSanti Date: Fri, 24 Apr 2026 12:32:22 +0200 Subject: [PATCH 4/6] Updated ci/cd --- .github/workflows/ci-tests.yaml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index 5941eec06..7927d20f2 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -163,28 +163,6 @@ jobs: python3-pip \ python3-venv - - name: "Get compiler version" - run: | - IFS='-' read -r -a COMPILER <<< "${{ matrix.cxx }}" - echo "CXX_VERSION=${COMPILER[1]}" >> $GITHUB_ENV - - name: "Install Clang" - if: ${{ startsWith(matrix.cxx, 'clang-') }} - run: | - wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh - chmod u+x /tmp/llvm.sh - sudo /tmp/llvm.sh ${{ env.CXX_VERSION }} - rm -f /tmp/llvm.sh - - name: "Fix missing libclang_rt.profile for Clang 14" - if: ${{ matrix.cxx == 'clang-14' }} - run: | - sudo apt download libclang-rt-14-dev - sudo dpkg --force-all -i libclang-rt-14-dev* - - name: "Install GCC" - if: ${{ startsWith(matrix.cxx, 'g++-') }} - run: | - sudo add-apt-repository ppa:ubuntu-toolchain-r/test - sudo apt update - sudo apt install -y ${{ matrix.cxx }} - name: "Run CMake" shell: bash run: | From ebdaeb9b113edc0470a4bd742270c54a0d9b33ce Mon Sep 17 00:00:00 2001 From: marcoSanti Date: Fri, 24 Apr 2026 12:46:24 +0200 Subject: [PATCH 5/6] Fixed include paths --- capio/tests/integration/src/main.cpp | 2 +- capio/tests/unit/syscall/src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/capio/tests/integration/src/main.cpp b/capio/tests/integration/src/main.cpp index 822801008..5da524aa2 100644 --- a/capio/tests/integration/src/main.cpp +++ b/capio/tests/integration/src/main.cpp @@ -1,6 +1,6 @@ #include -#include "capio/syscall.hpp" +#include "common/syscall.hpp" char **build_args() { char **args = (char **) malloc(3 * sizeof(uintptr_t)); diff --git a/capio/tests/unit/syscall/src/main.cpp b/capio/tests/unit/syscall/src/main.cpp index ce82886eb..dc556f93e 100644 --- a/capio/tests/unit/syscall/src/main.cpp +++ b/capio/tests/unit/syscall/src/main.cpp @@ -1,7 +1,7 @@ #include #include -#include "capio/syscall.hpp" +#include "common/syscall.hpp" char **build_args() { char **args = (char **) malloc(4 * sizeof(uintptr_t)); From 3798925fdc5a6e25868c0216b4632d809c9dcfd5 Mon Sep 17 00:00:00 2001 From: marcoSanti Date: Fri, 24 Apr 2026 12:55:39 +0200 Subject: [PATCH 6/6] Updated README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b5d177c3..d73031df9 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ CAPIO depends on the following software that needs to be manually installed: The following dependencies are automatically fetched during cmake configuration phase, and compiled when required. - [CAPIO-CL](https://github.com/High-Performance-IO/CAPIO-CL) To handle the CAPIO-CL configuration and enforce streaming directives -- [syscall_intercept](https://github.com/pmem/syscall_intercept) to intercept syscalls +- [alpha-unito/syscall_intercept](https://github.com/alpha-unito/syscall_intercept) to intercept syscalls (forked from ```pmem/syscall_interept```) - [Taywee/args](https://github.com/Taywee/args) to parse server command line inputs ### Compile capio