From 82a6b75b04eea9e68fc6df2afe9d6a17e723c1ed Mon Sep 17 00:00:00 2001 From: vrooomy Date: Tue, 3 Mar 2026 15:19:51 +0530 Subject: [PATCH 01/16] ci: enable ASan leak detection and enforce exit failure - Set detect_leaks=1 in ASAN_OPTIONS for Ubuntu jobs - Added exitcode=1 to ensure CI fails on memory leaks --- .github/workflows/OCV-PR-Linux.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/OCV-PR-Linux.yaml b/.github/workflows/OCV-PR-Linux.yaml index 1df0008c..4b20fb4f 100644 --- a/.github/workflows/OCV-PR-Linux.yaml +++ b/.github/workflows/OCV-PR-Linux.yaml @@ -62,6 +62,7 @@ jobs: include: - version: '24.04' image: '24.04:20251127' + asan: true jpegxl: true avif: true avx2: true @@ -75,6 +76,7 @@ jobs: # avif: true - version: '22.04' image: '22.04:20251015' + asan : true avif: true plugins: true - version: '20.04' @@ -116,7 +118,13 @@ jobs: ${{ matrix.avx2 && '-DCPU_BASELINE=AVX2'}} ${{ matrix.plugins && '-DVIDEOIO_PLUGIN_LIST=all -DHIGHGUI_PLUGIN_LIST=all' }} ${{ matrix.limited_api && '-DPYTHON3_LIMITED_API=ON' }} - ${{ matrix.asan && '-DENABLE_OMIT_FRAME_POINTER=OFF -DCMAKE_CXX_FLAGS="-fsanitize=address"' }} + ${{ matrix.asan && ' + -DENABLE_OMIT_FRAME_POINTER=OFF + -DCMAKE_C_FLAGS="-fno-omit-frame-pointer -fsanitize=address" + -DCMAKE_CXX_FLAGS="-fno-omit-frame-pointer -fsanitize=address" + -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address" + -DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=address" + ' }} HOME: ${{ contains(matrix.image, '24.04') && '/home/ubuntu' || '/home/ci' }} MAIN_BUILD_DIR: "${{ (github.event.repository.name != 'opencv_contrib') && 'build' || 'build-contrib' }}" # NOTE: CN config @@ -180,8 +188,7 @@ jobs: OPENCV_TEST_REQUIRE_DATA: 1 OPENCV_TEST_CHECK_OPTIONAL_DATA: 1 PYTHONPATH: '${{ env.HOME }}/${{ env.MAIN_BUILD_DIR }}/python_loader:$PYTHONPATH' - # TODO: enable later - # ASAN_OPTIONS: 'detect_leaks=0' + ASAN_OPTIONS: ${{ matrix.asan && 'detect_leaks=1:exitcode=1:abort_on_error=1:halt_on_error=1' || '' }} with: workdir: '${{ env.HOME }}' builddir: '${{ env.MAIN_BUILD_DIR }}' From c0a2205eeb46b0f2e2fe45602ef6b949d97afe18 Mon Sep 17 00:00:00 2001 From: vrooomy Date: Tue, 3 Mar 2026 17:03:37 +0530 Subject: [PATCH 02/16] fixed CMake flags formatting and added RelWithDebInfo --- .github/workflows/OCV-PR-Linux.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/OCV-PR-Linux.yaml b/.github/workflows/OCV-PR-Linux.yaml index 4b20fb4f..eede1107 100644 --- a/.github/workflows/OCV-PR-Linux.yaml +++ b/.github/workflows/OCV-PR-Linux.yaml @@ -118,13 +118,7 @@ jobs: ${{ matrix.avx2 && '-DCPU_BASELINE=AVX2'}} ${{ matrix.plugins && '-DVIDEOIO_PLUGIN_LIST=all -DHIGHGUI_PLUGIN_LIST=all' }} ${{ matrix.limited_api && '-DPYTHON3_LIMITED_API=ON' }} - ${{ matrix.asan && ' - -DENABLE_OMIT_FRAME_POINTER=OFF - -DCMAKE_C_FLAGS="-fno-omit-frame-pointer -fsanitize=address" - -DCMAKE_CXX_FLAGS="-fno-omit-frame-pointer -fsanitize=address" - -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address" - -DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=address" - ' }} + ${{ matrix.asan && '-DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_OMIT_FRAME_POINTER=OFF -DCMAKE_C_FLAGS="-fno-omit-frame-pointer -fsanitize=address" -DCMAKE_CXX_FLAGS="-fno-omit-frame-pointer -fsanitize=address" -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address" -DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=address"' }} HOME: ${{ contains(matrix.image, '24.04') && '/home/ubuntu' || '/home/ci' }} MAIN_BUILD_DIR: "${{ (github.event.repository.name != 'opencv_contrib') && 'build' || 'build-contrib' }}" # NOTE: CN config From 363c3e99ed428cc88c1894d68a786f5f4a2791cd Mon Sep 17 00:00:00 2001 From: vrooomy Date: Wed, 11 Mar 2026 13:18:22 +0530 Subject: [PATCH 03/16] increased timeout to 20m to accomodate ASan time --- .github/workflows/OCV-PR-Linux.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/OCV-PR-Linux.yaml b/.github/workflows/OCV-PR-Linux.yaml index eede1107..dc4ca281 100644 --- a/.github/workflows/OCV-PR-Linux.yaml +++ b/.github/workflows/OCV-PR-Linux.yaml @@ -177,6 +177,7 @@ jobs: - name: Run OpenCV tests uses: ./run-tests + timeout-minutes: 20 env: OPENCV_TEST_DATA_PATH: '${{ env.HOME }}/opencv_extra/testdata' OPENCV_TEST_REQUIRE_DATA: 1 From 2ded843cbcbef7b739a90e80f257444c6b045e5b Mon Sep 17 00:00:00 2001 From: vrooomy Date: Wed, 11 Mar 2026 14:51:26 +0530 Subject: [PATCH 04/16] added a dedicated Ubuntu 24 Asan workflow with updated job time --- .github/workflows/OCV-PR-LINUX-24-ASan.yaml | 151 ++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 .github/workflows/OCV-PR-LINUX-24-ASan.yaml diff --git a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml new file mode 100644 index 00000000..7d3797c9 --- /dev/null +++ b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml @@ -0,0 +1,151 @@ +name: OCV PR Linux 24 ASan + +on: + pull_request: + branches: + - main + paths: + - '.github/workflows/OCV-PR-LINUX-24-ASan.yaml' + workflow_call: + inputs: + workflow_branch: + description: "Branch for ci-gha-workflow repository" + default: "main" + required: false + type: string + +concurrency: + group: OCV-PR-Linux-24-ASan-${{ github.ref }} + cancel-in-progress: true + +jobs: + branch_eval: + runs-on: ubuntu-24.04 + outputs: + branches: ${{ steps.determine-branches.outputs.branches }} + steps: + - id: determine-branches + shell: bash + run: | + if [ "${{ github.event.repository.name == 'ci-gha-workflow' }}" = "true" ] ; then + echo "branches=[ '4.x', '5.x' ]" >> "$GITHUB_OUTPUT" + else + echo "branches=[ '${{ github.base_ref }}' ]" >> "$GITHUB_OUTPUT" + fi + + Ubuntu-24-ASan: + runs-on: opencv-cn-lin-x86-64 + timeout-minutes: 180 + needs: + - branch_eval + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(needs.branch_eval.outputs.branches )}} + defaults: + run: + shell: bash + container: + image: 'quay.io/opencv-ci/opencv-ubuntu-24.04:20251127' + volumes: + - /home/opencv-cn/git_cache:/opt/git_cache + - /home/opencv-cn/ci_cache/opencv/24.04:/opt/.ccache + - /home/opencv-cn/binaries_cache/24.04:/opt/binaries_cache + - /home/opencv-cn/dnn-models:/opt/dnn-models + env: + ANT_HOME: '/usr/share/ant' + DNN_MODELS: '/opt/dnn-models' + CCACHE_DIR: '/opt/.ccache' + CCACHE_MAXSIZE: '8G' + OPENCV_DOWNLOAD_PATH: '/opt/binaries_cache' + # Focused CMAKE_OPT for Ubuntu 24.04 with ASan enabled by default + CMAKE_OPT: >- + -DBUILD_DOCS=ON + -DBUILD_EXAMPLES=ON + -DOPENCV_ENABLE_NONFREE=ON + -DWITH_IMGCODEC_GIF=ON + -DWITH_JPEGXL=ON + -DWITH_AVIF=ON + -DWITH_GPHOTO2=ON + -DWITH_ARAVIS=ON + -DCPU_BASELINE=AVX2 + -DCMAKE_BUILD_TYPE=RelWithDebInfo + -DENABLE_OMIT_FRAME_POINTER=OFF + -DCMAKE_C_FLAGS="-fno-omit-frame-pointer -fsanitize=address" + -DCMAKE_CXX_FLAGS="-fno-omit-frame-pointer -fsanitize=address" + -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address" + -DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=address" + HOME: '/home/ubuntu' + MAIN_BUILD_DIR: "${{ (github.event.repository.name != 'opencv_contrib') && 'build' || 'build-contrib' }}" + OPENCV_FOR_THREADS_NUM: 8 + CMAKE_BUILD_PARALLEL_LEVEL: 8 + + steps: + - name: Checkout workflow repository + uses: actions/checkout@v4 + with: + repository: opencv/ci-gha-workflow + ref: "${{ github.repository == 'opencv/ci-gha-workflow' && github.ref || inputs.workflow_branch }}" + + - name: Checkout and merge OpenCV + uses: ./checkout-and-merge + with: + target_branch: "${{ matrix.branch }}" + author: "${{ github.event.pull_request.user.login }}" + source_branch: "${{ github.event.repository.name == 'ci-gha-workflow' && '' || github.head_ref }}" + gitcache: '/opt/git_cache' + home: '${{ env.HOME }}' + workdir: '${{ env.HOME }}' + + - name: Update extra dnn models + timeout-minutes: 60 + working-directory: '${{ env.HOME }}' + run: | + ls -lR ${{ env.DNN_MODELS }} + python3 opencv_extra/testdata/dnn/download_models.py \ + --cleanup \ + --dst '${{ env.DNN_MODELS }}/dnn' + echo "OPENCV_DNN_TEST_DATA_PATH=${{ env.DNN_MODELS }}" >> $GITHUB_ENV + + - if: ${{ github.event.repository.name != 'opencv_contrib' }} + name: Configure and build OpenCV + uses: ./configure-and-build + with: + workdir: '${{ env.HOME }}' + builddir: 'build' + generator: 'Ninja' + options: '${{ env.CMAKE_OPT }}' + + - name: Configure and build OpenCV with contrib + uses: ./configure-and-build + with: + workdir: '${{ env.HOME }}' + builddir: 'build-contrib' + generator: 'Ninja' + options: '-DOPENCV_EXTRA_MODULES_PATH=opencv_contrib/modules ${{ env.CMAKE_OPT }}' + + - name: Run OpenCV tests + uses: ./run-tests + timeout-minutes: 20 + env: + OPENCV_TEST_DATA_PATH: '${{ env.HOME }}/opencv_extra/testdata' + OPENCV_TEST_REQUIRE_DATA: 1 + OPENCV_TEST_CHECK_OPTIONAL_DATA: 1 + PYTHONPATH: '${{ env.HOME }}/${{ env.MAIN_BUILD_DIR }}/python_loader:$PYTHONPATH' + ASAN_OPTIONS: 'detect_leaks=1:exitcode=1:abort_on_error=1:halt_on_error=1' + with: + workdir: '${{ env.HOME }}' + builddir: '${{ env.MAIN_BUILD_DIR }}' + logdir: '${{ env.HOME }}/${{ env.MAIN_BUILD_DIR }}' + plan: "test-plan-${{ matrix.branch }}.json" + suite: "[ ${{ (github.event.repository.name == 'opencv_contrib') && '''linux-contrib''' || '''linux''' }} ]" + filter: "[ 'ubuntu-common', 'ubuntu-avx2' ]" + enable_python: "true" + enable_java: "true" + suffix: '24.04_asan_${{ matrix.branch }}' + + - if: ${{ always() && env.WARNINGS == '1' }} + name: Warnings check + run: | + echo "::error Warnings have been found!" + exit 1 \ No newline at end of file From 89d677e2d02957b3523ce35ae40dcce72892caf7 Mon Sep 17 00:00:00 2001 From: vrooomy Date: Wed, 11 Mar 2026 15:14:16 +0530 Subject: [PATCH 05/16] reverted cahnges in the OCV-PR-LINUX.yaml --- .github/workflows/OCV-PR-Linux.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/OCV-PR-Linux.yaml b/.github/workflows/OCV-PR-Linux.yaml index dc4ca281..1df0008c 100644 --- a/.github/workflows/OCV-PR-Linux.yaml +++ b/.github/workflows/OCV-PR-Linux.yaml @@ -62,7 +62,6 @@ jobs: include: - version: '24.04' image: '24.04:20251127' - asan: true jpegxl: true avif: true avx2: true @@ -76,7 +75,6 @@ jobs: # avif: true - version: '22.04' image: '22.04:20251015' - asan : true avif: true plugins: true - version: '20.04' @@ -118,7 +116,7 @@ jobs: ${{ matrix.avx2 && '-DCPU_BASELINE=AVX2'}} ${{ matrix.plugins && '-DVIDEOIO_PLUGIN_LIST=all -DHIGHGUI_PLUGIN_LIST=all' }} ${{ matrix.limited_api && '-DPYTHON3_LIMITED_API=ON' }} - ${{ matrix.asan && '-DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_OMIT_FRAME_POINTER=OFF -DCMAKE_C_FLAGS="-fno-omit-frame-pointer -fsanitize=address" -DCMAKE_CXX_FLAGS="-fno-omit-frame-pointer -fsanitize=address" -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address" -DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=address"' }} + ${{ matrix.asan && '-DENABLE_OMIT_FRAME_POINTER=OFF -DCMAKE_CXX_FLAGS="-fsanitize=address"' }} HOME: ${{ contains(matrix.image, '24.04') && '/home/ubuntu' || '/home/ci' }} MAIN_BUILD_DIR: "${{ (github.event.repository.name != 'opencv_contrib') && 'build' || 'build-contrib' }}" # NOTE: CN config @@ -177,13 +175,13 @@ jobs: - name: Run OpenCV tests uses: ./run-tests - timeout-minutes: 20 env: OPENCV_TEST_DATA_PATH: '${{ env.HOME }}/opencv_extra/testdata' OPENCV_TEST_REQUIRE_DATA: 1 OPENCV_TEST_CHECK_OPTIONAL_DATA: 1 PYTHONPATH: '${{ env.HOME }}/${{ env.MAIN_BUILD_DIR }}/python_loader:$PYTHONPATH' - ASAN_OPTIONS: ${{ matrix.asan && 'detect_leaks=1:exitcode=1:abort_on_error=1:halt_on_error=1' || '' }} + # TODO: enable later + # ASAN_OPTIONS: 'detect_leaks=0' with: workdir: '${{ env.HOME }}' builddir: '${{ env.MAIN_BUILD_DIR }}' From 60df6ae84c916131f1fb453d2f7c4634174d6e95 Mon Sep 17 00:00:00 2001 From: vrooomy Date: Wed, 11 Mar 2026 18:25:37 +0530 Subject: [PATCH 06/16] updated the default timeout limit from 10 to 20 min and opencv test time from 20 to 60 --- .github/workflows/OCV-PR-LINUX-24-ASan.yaml | 2 +- scripts/runner.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml index 7d3797c9..04724461 100644 --- a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml +++ b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml @@ -126,7 +126,7 @@ jobs: - name: Run OpenCV tests uses: ./run-tests - timeout-minutes: 20 + timeout-minutes: 60 env: OPENCV_TEST_DATA_PATH: '${{ env.HOME }}/opencv_extra/testdata' OPENCV_TEST_REQUIRE_DATA: 1 diff --git a/scripts/runner.py b/scripts/runner.py index cad4afb8..af224e4f 100644 --- a/scripts/runner.py +++ b/scripts/runner.py @@ -134,7 +134,7 @@ async def run_one(name, cmd, logname, env, args): parser.add_argument("--suite", action="append", required=True, help="Suite in test plan (set of executables), multiple allowed") parser.add_argument("--filter", action="append", help="Filter in test plan (skip some testcases), multiple allowed") parser.add_argument("--options", default="default", help="Options in test plan (extra run options)") - parser.add_argument("--timeout", type=int, default=10, help="Timeout in minutes") + parser.add_argument("--timeout", type=int, default=20, help="Timeout in minutes") parser.add_argument("--prefix", default="out_", help="Prefix to add to logs") parser.add_argument("--workdir", default=".", type=Path, help="Working directory") parser.add_argument("--logdir", default=".", type=Path, help="Directory to store logs (either absolute or relative to workdir)") From 43329b39423da2d19f92e3b4e01cd04f87a5edb9 Mon Sep 17 00:00:00 2001 From: vrooomy Date: Wed, 11 Mar 2026 18:27:01 +0530 Subject: [PATCH 07/16] opencv test time limit 100 min --- .github/workflows/OCV-PR-LINUX-24-ASan.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml index 04724461..434afbe6 100644 --- a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml +++ b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml @@ -126,7 +126,7 @@ jobs: - name: Run OpenCV tests uses: ./run-tests - timeout-minutes: 60 + timeout-minutes: 100 env: OPENCV_TEST_DATA_PATH: '${{ env.HOME }}/opencv_extra/testdata' OPENCV_TEST_REQUIRE_DATA: 1 From 5bbe991fc91896c912c62abf34c522a4079e2bce Mon Sep 17 00:00:00 2001 From: vrooomy Date: Wed, 11 Mar 2026 20:05:57 +0530 Subject: [PATCH 08/16] increasted timeout to 90 min --- .github/workflows/OCV-PR-LINUX-24-ASan.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml index 434afbe6..156c6725 100644 --- a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml +++ b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml @@ -143,6 +143,7 @@ jobs: enable_python: "true" enable_java: "true" suffix: '24.04_asan_${{ matrix.branch }}' + timeout: "90" - if: ${{ always() && env.WARNINGS == '1' }} name: Warnings check From c280b63ee5c7d737286b0611ef63d02c77959843 Mon Sep 17 00:00:00 2001 From: vrooomy Date: Mon, 16 Mar 2026 15:48:54 +0530 Subject: [PATCH 09/16] added third-party memory leak warning supressions --- .github/workflows/OCV-PR-LINUX-24-ASan.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml index 156c6725..f8712f26 100644 --- a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml +++ b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml @@ -124,6 +124,18 @@ jobs: generator: 'Ninja' options: '-DOPENCV_EXTRA_MODULES_PATH=opencv_contrib/modules ${{ env.CMAKE_OPT }}' + - name: Create LSAN Suppressions + run: | + cat < ${{ env.HOME }}/lsan.supp + # Ignore intentional leaks in third-party GUI & System libraries + leak:libavutil + leak:libx265 + leak:libglib-2.0 + leak:libdbus-1 + leak:libatk-bridge + leak:libGLX_mesa + EOF + - name: Run OpenCV tests uses: ./run-tests timeout-minutes: 100 @@ -133,6 +145,7 @@ jobs: OPENCV_TEST_CHECK_OPTIONAL_DATA: 1 PYTHONPATH: '${{ env.HOME }}/${{ env.MAIN_BUILD_DIR }}/python_loader:$PYTHONPATH' ASAN_OPTIONS: 'detect_leaks=1:exitcode=1:abort_on_error=1:halt_on_error=1' + LSAN_OPTIONS: 'suppressions=${{ env.HOME }}/lsan.supp' with: workdir: '${{ env.HOME }}' builddir: '${{ env.MAIN_BUILD_DIR }}' @@ -143,7 +156,7 @@ jobs: enable_python: "true" enable_java: "true" suffix: '24.04_asan_${{ matrix.branch }}' - timeout: "90" + timeout: "180" - if: ${{ always() && env.WARNINGS == '1' }} name: Warnings check From 91d71c7dbd759ae6a550fa752f2131132c005286 Mon Sep 17 00:00:00 2001 From: vrooomy Date: Thu, 19 Mar 2026 14:07:22 +0530 Subject: [PATCH 10/16] removed hugui test and videoio test and 3rd party supressions --- .github/workflows/OCV-PR-LINUX-24-ASan.yaml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml index f8712f26..18a36c93 100644 --- a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml +++ b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml @@ -124,18 +124,6 @@ jobs: generator: 'Ninja' options: '-DOPENCV_EXTRA_MODULES_PATH=opencv_contrib/modules ${{ env.CMAKE_OPT }}' - - name: Create LSAN Suppressions - run: | - cat < ${{ env.HOME }}/lsan.supp - # Ignore intentional leaks in third-party GUI & System libraries - leak:libavutil - leak:libx265 - leak:libglib-2.0 - leak:libdbus-1 - leak:libatk-bridge - leak:libGLX_mesa - EOF - - name: Run OpenCV tests uses: ./run-tests timeout-minutes: 100 @@ -145,14 +133,13 @@ jobs: OPENCV_TEST_CHECK_OPTIONAL_DATA: 1 PYTHONPATH: '${{ env.HOME }}/${{ env.MAIN_BUILD_DIR }}/python_loader:$PYTHONPATH' ASAN_OPTIONS: 'detect_leaks=1:exitcode=1:abort_on_error=1:halt_on_error=1' - LSAN_OPTIONS: 'suppressions=${{ env.HOME }}/lsan.supp' with: workdir: '${{ env.HOME }}' builddir: '${{ env.MAIN_BUILD_DIR }}' logdir: '${{ env.HOME }}/${{ env.MAIN_BUILD_DIR }}' plan: "test-plan-${{ matrix.branch }}.json" suite: "[ ${{ (github.event.repository.name == 'opencv_contrib') && '''linux-contrib''' || '''linux''' }} ]" - filter: "[ 'ubuntu-common', 'ubuntu-avx2' ]" + filter: "[ 'ubuntu-common', 'ubuntu-avx2' , '-opencv_test_higui' , '-opencv_test_videoio' ]" enable_python: "true" enable_java: "true" suffix: '24.04_asan_${{ matrix.branch }}' From 6329493107c5944096f473cc85cc1154e714dfca Mon Sep 17 00:00:00 2001 From: vrooomy Date: Thu, 19 Mar 2026 14:16:43 +0530 Subject: [PATCH 11/16] fixed highgui test removal --- .github/workflows/OCV-PR-LINUX-24-ASan.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml index 18a36c93..92f3cd2d 100644 --- a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml +++ b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml @@ -139,7 +139,7 @@ jobs: logdir: '${{ env.HOME }}/${{ env.MAIN_BUILD_DIR }}' plan: "test-plan-${{ matrix.branch }}.json" suite: "[ ${{ (github.event.repository.name == 'opencv_contrib') && '''linux-contrib''' || '''linux''' }} ]" - filter: "[ 'ubuntu-common', 'ubuntu-avx2' , '-opencv_test_higui' , '-opencv_test_videoio' ]" + filter: "[ 'ubuntu-common', 'ubuntu-avx2' , '-opencv_test_highgui' , '-opencv_test_videoio' ]" enable_python: "true" enable_java: "true" suffix: '24.04_asan_${{ matrix.branch }}' From e8e317b97b2ac068cb810f7695706b273c8a5fe0 Mon Sep 17 00:00:00 2001 From: vrooomy Date: Thu, 19 Mar 2026 15:49:21 +0530 Subject: [PATCH 12/16] add test plan 4.x and 5.x to exclude highgui and videoio tests --- .github/workflows/OCV-PR-LINUX-24-ASan.yaml | 4 +- scripts/test-plan-asan-4.x.json | 111 ++++++++++++++++++ scripts/test-plan-asan-5.x.json | 120 ++++++++++++++++++++ 3 files changed, 233 insertions(+), 2 deletions(-) create mode 100644 scripts/test-plan-asan-4.x.json create mode 100644 scripts/test-plan-asan-5.x.json diff --git a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml index 92f3cd2d..68f48533 100644 --- a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml +++ b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml @@ -137,9 +137,9 @@ jobs: workdir: '${{ env.HOME }}' builddir: '${{ env.MAIN_BUILD_DIR }}' logdir: '${{ env.HOME }}/${{ env.MAIN_BUILD_DIR }}' - plan: "test-plan-${{ matrix.branch }}.json" + plan: "test-plan-asan-${{ matrix.branch }}.json" suite: "[ ${{ (github.event.repository.name == 'opencv_contrib') && '''linux-contrib''' || '''linux''' }} ]" - filter: "[ 'ubuntu-common', 'ubuntu-avx2' , '-opencv_test_highgui' , '-opencv_test_videoio' ]" + filter: "[ 'ubuntu-common', 'ubuntu-avx2' ]" enable_python: "true" enable_java: "true" suffix: '24.04_asan_${{ matrix.branch }}' diff --git a/scripts/test-plan-asan-4.x.json b/scripts/test-plan-asan-4.x.json new file mode 100644 index 00000000..6e2aa4c4 --- /dev/null +++ b/scripts/test-plan-asan-4.x.json @@ -0,0 +1,111 @@ +{ + "suites": { + "short": [ "opencv_test_core", "opencv_test_imgproc", "opencv_test_photo" ], + + "linux": [ + "opencv_test_calib3d", + "opencv_test_core", + "opencv_test_dnn", + "opencv_test_features2d", + "opencv_test_flann", + "opencv_test_gapi", + "opencv_test_imgcodecs", + "opencv_test_imgproc", + "opencv_test_ml", + "opencv_test_objdetect", + "opencv_test_photo", + "opencv_test_stitching", + "opencv_test_video", + "opencv_perf_calib3d", + "opencv_perf_core", + "opencv_perf_dnn", + "opencv_perf_features2d", + "opencv_perf_gapi", + "opencv_perf_imgcodecs", + "opencv_perf_imgproc", + "opencv_perf_objdetect", + "opencv_perf_photo", + "opencv_perf_stitching", + "opencv_perf_video", + "opencv_perf_videoio" + ], + + "linux-contrib": [ + "opencv_test_bgsegm", + "opencv_test_bioinspired", + "opencv_test_dnn_superres", + "opencv_test_face", + "opencv_test_fuzzy", + "opencv_test_hdf", + "opencv_test_img_aug", + "opencv_test_img_hash", + "opencv_test_intensity_transform", + "opencv_test_line_descriptor", + "opencv_test_mcc", + "opencv_test_optflow", + "opencv_test_phase_unwrapping", + "opencv_test_quality", + "opencv_test_rapid", + "opencv_test_reg", + "opencv_test_rgbd", + "opencv_test_saliency", + "opencv_test_sfm", + "opencv_test_shape", + "opencv_test_stereo", + "opencv_test_structured_light", + "opencv_test_superres", + "opencv_test_text", + "opencv_test_tracking", + "opencv_test_videostab", + "opencv_test_wechat_qrcode", + "opencv_test_xfeatures2d", + "opencv_test_ximgproc", + "opencv_test_xphoto", + "opencv_perf_bioinspired", + "opencv_perf_dnn_superres", + "opencv_perf_features2d", + "opencv_perf_line_descriptor", + "opencv_perf_optflow", + "opencv_perf_reg", + "opencv_perf_rgbd", + "opencv_perf_stereo", + "opencv_perf_superres", + "opencv_perf_tracking", + "opencv_perf_xfeatures2d", + "opencv_perf_ximgproc", + "opencv_perf_xphoto" + ] + }, + "filters": { + "ubuntu-common": { + "test_gapi": [ + "AsyncAPICancelation/cancel/*" + ], + "test_videoio": [ + "videoio/videoio_synthetic.write_read_position/*_MPEG_GSTREAMER", + "videoio/videoio_synthetic.write_read_position/*_MJPG_GSTREAMER", + "videoio/videocapture_acceleration.read/yuv420p_mjpeg_mp4_GSTREAMER_*_MAT", + "videoio/videowriter_acceleration.write/mkv_MPEG_GSTREAMER_*_MAT" + ] + }, + "ubuntu-avx2": { + "test_core": [ + "Core_InRangeS/ElemWiseTest.accuracy/0", + "Core_InRange/ElemWiseTest.accuracy/0" + ] + } + }, + "options": { + "default": { + "wrap": { + "highgui": "xvfb-run -a" + }, + "args": { + "test": "--skip_unstable=1", + "perf": "--perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1" + }, + "exe": {}, + "env": {} + } + } +} diff --git a/scripts/test-plan-asan-5.x.json b/scripts/test-plan-asan-5.x.json new file mode 100644 index 00000000..75a5d1f2 --- /dev/null +++ b/scripts/test-plan-asan-5.x.json @@ -0,0 +1,120 @@ +{ + "suites": { + "short": [ "opencv_test_core", "opencv_test_imgproc", "opencv_test_photo" ], + + "linux": [ + "opencv_test_3d", + "opencv_test_calib", + "opencv_test_core", + "opencv_test_dnn_classic", + "opencv_test_dnn", + "opencv_test_features", + "opencv_test_flann", + "opencv_test_imgcodecs", + "opencv_test_imgproc", + "opencv_test_objdetect", + "opencv_test_photo", + "opencv_test_stereo", + "opencv_test_stitching", + "opencv_test_video", + "opencv_perf_3d", + "opencv_perf_calib", + "opencv_perf_core", + "opencv_perf_dnn", + "opencv_perf_features", + "opencv_perf_imgcodecs", + "opencv_perf_imgproc", + "opencv_perf_objdetect", + "opencv_perf_photo", + "opencv_perf_stereo", + "opencv_perf_stitching", + "opencv_perf_video", + "opencv_perf_videoio" + ], + + "linux-contrib": [ + "opencv_test_bgsegm", + "opencv_test_bioinspired", + "opencv_test_dnn_superres", + "opencv_test_face", + "opencv_test_fuzzy", + "opencv_test_gapi", + "opencv_test_hdf", + "opencv_test_img_hash", + "opencv_test_intensity_transform", + "opencv_test_line_descriptor", + "opencv_test_ml", + "opencv_test_optflow", + "opencv_test_phase_unwrapping", + "opencv_test_quality", + "opencv_test_rapid", + "opencv_test_reg", + "opencv_test_rgbd", + "opencv_test_saliency", + "opencv_test_sfm", + "opencv_test_shape", + "opencv_test_structured_light", + "opencv_test_superres", + "opencv_test_text", + "opencv_test_tracking", + "opencv_test_videostab", + "opencv_test_wechat_qrcode", + "opencv_test_xfeatures2d", + "opencv_test_ximgproc", + "opencv_test_xobjdetect", + "opencv_test_xphoto", + "opencv_test_xstereo", + "opencv_perf_bioinspired", + "opencv_perf_dnn_superres", + "opencv_perf_gapi", + "opencv_perf_line_descriptor", + "opencv_perf_optflow", + "opencv_perf_reg", + "opencv_perf_superres", + "opencv_perf_tracking", + "opencv_perf_xfeatures2d", + "opencv_perf_ximgproc", + "opencv_perf_xobjdetect", + "opencv_perf_xphoto", + "opencv_perf_xstereo" + ] + }, + "filters": { + "ubuntu-common": { + "test_gapi": [ + "AsyncAPICancelation/cancel/*" + ], + "test_videoio": [ + "videoio/videoio_synthetic.write_read_position/*_MPEG_GSTREAMER", + "videoio/videoio_synthetic.write_read_position/*_MJPG_GSTREAMER", + "videoio/videocapture_acceleration.read/yuv420p_mjpeg_mp4_GSTREAMER_*_MAT", + "videoio/videowriter_acceleration.write/mkv_MPEG_GSTREAMER_*_MAT" + ] + }, + "ubuntu-avx2": { + "test_core": [ + "Core_InRangeS/ElemWiseTest.accuracy/0", + "Core_InRange/ElemWiseTest.accuracy/0" + ] + } + }, + "options": { + "default": { + "wrap": { + "highgui": "xvfb-run -a" + }, + "args": { + "test": "--skip_unstable=1", + "perf": "--perf_impl=plain --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1" + }, + "exe": { + "opencv_test_dnn_classic": "opencv_test_dnn" + }, + "env": { + "opencv_test_dnn_classic": { + "OPENCV_FORCE_DNN_ENGINE": "1" + } + } + } + } +} From 70f87bce3a0334089d9fa30cfc0785d62b79bd6c Mon Sep 17 00:00:00 2001 From: vrooomy Date: Fri, 20 Mar 2026 13:40:00 +0530 Subject: [PATCH 13/16] removed video tests from test-plan-asan-4.x and test-plan-asan-5.x --- scripts/test-plan-asan-4.x.json | 5 +---- scripts/test-plan-asan-5.x.json | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/test-plan-asan-4.x.json b/scripts/test-plan-asan-4.x.json index 6e2aa4c4..7d3b73a9 100644 --- a/scripts/test-plan-asan-4.x.json +++ b/scripts/test-plan-asan-4.x.json @@ -15,7 +15,6 @@ "opencv_test_objdetect", "opencv_test_photo", "opencv_test_stitching", - "opencv_test_video", "opencv_perf_calib3d", "opencv_perf_core", "opencv_perf_dnn", @@ -25,9 +24,7 @@ "opencv_perf_imgproc", "opencv_perf_objdetect", "opencv_perf_photo", - "opencv_perf_stitching", - "opencv_perf_video", - "opencv_perf_videoio" + "opencv_perf_stitching" ], "linux-contrib": [ diff --git a/scripts/test-plan-asan-5.x.json b/scripts/test-plan-asan-5.x.json index 75a5d1f2..60b91f3a 100644 --- a/scripts/test-plan-asan-5.x.json +++ b/scripts/test-plan-asan-5.x.json @@ -16,7 +16,6 @@ "opencv_test_photo", "opencv_test_stereo", "opencv_test_stitching", - "opencv_test_video", "opencv_perf_3d", "opencv_perf_calib", "opencv_perf_core", @@ -27,9 +26,7 @@ "opencv_perf_objdetect", "opencv_perf_photo", "opencv_perf_stereo", - "opencv_perf_stitching", - "opencv_perf_video", - "opencv_perf_videoio" + "opencv_perf_stitching" ], "linux-contrib": [ From f01a970ed8e440749d09b7a1212753ec5abc3aa9 Mon Sep 17 00:00:00 2001 From: vrooomy Date: Fri, 20 Mar 2026 15:00:39 +0530 Subject: [PATCH 14/16] removed extra build flags --- .github/workflows/OCV-PR-LINUX-24-ASan.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml index 68f48533..2d2504c7 100644 --- a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml +++ b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml @@ -58,16 +58,9 @@ jobs: CCACHE_DIR: '/opt/.ccache' CCACHE_MAXSIZE: '8G' OPENCV_DOWNLOAD_PATH: '/opt/binaries_cache' - # Focused CMAKE_OPT for Ubuntu 24.04 with ASan enabled by default CMAKE_OPT: >- - -DBUILD_DOCS=ON - -DBUILD_EXAMPLES=ON -DOPENCV_ENABLE_NONFREE=ON -DWITH_IMGCODEC_GIF=ON - -DWITH_JPEGXL=ON - -DWITH_AVIF=ON - -DWITH_GPHOTO2=ON - -DWITH_ARAVIS=ON -DCPU_BASELINE=AVX2 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_OMIT_FRAME_POINTER=OFF From 1f3f388a6efef80f1b1495437360dcb06ef880a6 Mon Sep 17 00:00:00 2001 From: vrooomy Date: Fri, 20 Mar 2026 15:16:01 +0530 Subject: [PATCH 15/16] add empty line at the end --- .github/workflows/OCV-PR-LINUX-24-ASan.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml index 2d2504c7..ec4fa800 100644 --- a/.github/workflows/OCV-PR-LINUX-24-ASan.yaml +++ b/.github/workflows/OCV-PR-LINUX-24-ASan.yaml @@ -142,4 +142,5 @@ jobs: name: Warnings check run: | echo "::error Warnings have been found!" - exit 1 \ No newline at end of file + exit 1 + \ No newline at end of file From e20db45d6aa794307ae489ca7b956b9d93369775 Mon Sep 17 00:00:00 2001 From: vrooomy Date: Mon, 23 Mar 2026 14:04:53 +0530 Subject: [PATCH 16/16] removed opencv_test_gapi from asan test plan 4.x and 5.x --- scripts/test-plan-asan-4.x.json | 1 - scripts/test-plan-asan-5.x.json | 1 - 2 files changed, 2 deletions(-) diff --git a/scripts/test-plan-asan-4.x.json b/scripts/test-plan-asan-4.x.json index 7d3b73a9..5ddd4704 100644 --- a/scripts/test-plan-asan-4.x.json +++ b/scripts/test-plan-asan-4.x.json @@ -8,7 +8,6 @@ "opencv_test_dnn", "opencv_test_features2d", "opencv_test_flann", - "opencv_test_gapi", "opencv_test_imgcodecs", "opencv_test_imgproc", "opencv_test_ml", diff --git a/scripts/test-plan-asan-5.x.json b/scripts/test-plan-asan-5.x.json index 60b91f3a..c454c266 100644 --- a/scripts/test-plan-asan-5.x.json +++ b/scripts/test-plan-asan-5.x.json @@ -35,7 +35,6 @@ "opencv_test_dnn_superres", "opencv_test_face", "opencv_test_fuzzy", - "opencv_test_gapi", "opencv_test_hdf", "opencv_test_img_hash", "opencv_test_intensity_transform",