From 466a8732b590c8a1c9037c98c27466702e44fa4a Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 10 May 2024 01:13:50 +0200 Subject: [PATCH] CI: Tune Ubuntu 22.04 VM ASLR to workaround issue with clang ASAN --- .github/workflows/asan/test.sh | 2 -- .github/workflows/linux_build.yml | 10 ++++++++-- autotest/osr/osr_basic.py | 6 ------ autotest/pyscripts/test_gdal_calc.py | 7 ------- autotest/pyscripts/test_gdal_edit.py | 4 ---- autotest/pyscripts/test_gdal_fillnodata.py | 7 ------- autotest/pyscripts/test_gdal_pansharpen.py | 4 ---- autotest/pyscripts/test_gdal_proximity.py | 7 ------- autotest/pyscripts/test_gdal_sieve.py | 4 ---- autotest/pyscripts/test_ogrmerge.py | 4 ---- 10 files changed, 8 insertions(+), 47 deletions(-) diff --git a/.github/workflows/asan/test.sh b/.github/workflows/asan/test.sh index 8ab93bb59724..ffbfbb0878d0 100755 --- a/.github/workflows/asan/test.sh +++ b/.github/workflows/asan/test.sh @@ -45,8 +45,6 @@ find -L \ ! -name ogr_gpsbabel.py `# new-delete-type-mismatch error in gpsbabel binary that we can't suppress` \ ! -name "__init__.py" \ ! -path 'ogr/data/*' \ - ! -name test_gdal_merge.py \ - ! -name test_gdal_retile.py \ -print \ -exec ./pytest_wrapper.sh {} \; \ | tee ./test-output.txt diff --git a/.github/workflows/linux_build.yml b/.github/workflows/linux_build.yml index 36b2b55643c5..99f006f33728 100644 --- a/.github/workflows/linux_build.yml +++ b/.github/workflows/linux_build.yml @@ -111,8 +111,7 @@ jobs: container: ubuntu_22.04 build_script: build.sh test_script: test.sh - # We force the host OS to be 20.04 to avoid "AddressSanitizer:DEADLYSIGNAL" - os: ubuntu-20.04 + os: ubuntu-22.04 - name: Ubuntu 20.04, gcc id: ubuntu_20.04 @@ -168,6 +167,13 @@ jobs: echo "CACHE_CONTAINER_TAG_CLEAN=${CACHE_CONTAINER_TAG_CLEAN}" >> ${GITHUB_ENV} echo "CONTAINER_NAME_FULL=${CONTAINER_REGISTRY}/${CONTAINER_REGISTRY_USER,,}/${CONTAINER_NAME}:${CONTAINER_TAG_CLEAN}" >>${GITHUB_ENV} + # Work around segfaults in ASan/MSan jobs + # Cf https://github.com/libjpeg-turbo/libjpeg-turbo/commit/2dfe6c0fe9e18671105e94f7cbf044d4a1d157e6 + # and https://github.com/actions/runner-images/issues/9491 + - name: Set up build + run: | + sudo sysctl vm.mmap_rnd_bits=28 + - name: Checkout uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 diff --git a/autotest/osr/osr_basic.py b/autotest/osr/osr_basic.py index 0129bcbb5b02..619b7619252a 100755 --- a/autotest/osr/osr_basic.py +++ b/autotest/osr/osr_basic.py @@ -1840,9 +1840,6 @@ def threaded_function(arg): def test_Set_PROJ_DATA_config_option_sub_proccess_config_option_ok(): - if gdaltest.is_travis_branch("sanitize"): - pytest.skip("fails on sanitize for unknown reason") - backup_search_paths = osr.GetPROJSearchPaths() # conftest.py set 2 paths: autotest/gcore/tmp/proj_db_tmpdir and autotest/proj_grids assert len(backup_search_paths) == 2 @@ -1861,9 +1858,6 @@ def test_Set_PROJ_DATA_config_option_sub_proccess_config_option_ok(): def test_Set_PROJ_DATA_config_option_sub_proccess_config_option_ko(): - if gdaltest.is_travis_branch("sanitize"): - pytest.skip("fails on sanitize for unknown reason") - backup_search_paths = osr.GetPROJSearchPaths() # conftest.py set 2 paths: autotest/gcore/tmp/proj_db_tmpdir and autotest/proj_grids assert len(backup_search_paths) == 2 diff --git a/autotest/pyscripts/test_gdal_calc.py b/autotest/pyscripts/test_gdal_calc.py index 327cb806d491..85bb6a11e7bb 100755 --- a/autotest/pyscripts/test_gdal_calc.py +++ b/autotest/pyscripts/test_gdal_calc.py @@ -36,7 +36,6 @@ from collections import defaultdict from copy import copy -import gdaltest import pytest import test_py_scripts @@ -70,9 +69,6 @@ def script_path(): def test_gdal_calc_help(script_path): - if gdaltest.is_travis_branch("sanitize"): - pytest.skip("fails on sanitize for unknown reason") - assert "ERROR" not in test_py_scripts.run_py_script( script_path, "gdal_calc", "--help" ) @@ -84,9 +80,6 @@ def test_gdal_calc_help(script_path): def test_gdal_calc_version(script_path): - if gdaltest.is_travis_branch("sanitize"): - pytest.skip("fails on sanitize for unknown reason") - assert "ERROR" not in test_py_scripts.run_py_script( script_path, "gdal_calc", "--version" ) diff --git a/autotest/pyscripts/test_gdal_edit.py b/autotest/pyscripts/test_gdal_edit.py index 74ac20576837..8e90e7d6869f 100755 --- a/autotest/pyscripts/test_gdal_edit.py +++ b/autotest/pyscripts/test_gdal_edit.py @@ -33,7 +33,6 @@ import shutil import sys -import gdaltest import pytest import test_py_scripts @@ -141,9 +140,6 @@ def test_gdal_edit_py_1(script_path, tmp_path, read_only): def test_gdal_edit_py_1b(script_path, tmp_path): - if gdaltest.is_travis_branch("sanitize"): - pytest.skip("fails on sanitize for unknown reason") - filename = str(tmp_path / "test_gdal_edit_py.tif") shutil.copy(test_py_scripts.get_data_path("gcore") + "byte.tif", filename) diff --git a/autotest/pyscripts/test_gdal_fillnodata.py b/autotest/pyscripts/test_gdal_fillnodata.py index c3e3f4901697..f8dcf95c3f39 100755 --- a/autotest/pyscripts/test_gdal_fillnodata.py +++ b/autotest/pyscripts/test_gdal_fillnodata.py @@ -30,7 +30,6 @@ import struct -import gdaltest import pytest import test_py_scripts @@ -53,9 +52,6 @@ def script_path(): def test_gdal_fillnodata_help(script_path): - if gdaltest.is_travis_branch("sanitize"): - pytest.skip("fails on sanitize for unknown reason") - assert "ERROR" not in test_py_scripts.run_py_script( script_path, "gdal_fillnodata", "--help" ) @@ -67,9 +63,6 @@ def test_gdal_fillnodata_help(script_path): def test_gdal_fillnodata_version(script_path): - if gdaltest.is_travis_branch("sanitize"): - pytest.skip("fails on sanitize for unknown reason") - assert "ERROR" not in test_py_scripts.run_py_script( script_path, "gdal_fillnodata", "--version" ) diff --git a/autotest/pyscripts/test_gdal_pansharpen.py b/autotest/pyscripts/test_gdal_pansharpen.py index 50e8149978c1..d58303bc49c8 100755 --- a/autotest/pyscripts/test_gdal_pansharpen.py +++ b/autotest/pyscripts/test_gdal_pansharpen.py @@ -30,7 +30,6 @@ ############################################################################### -import gdaltest import pytest import test_py_scripts @@ -76,9 +75,6 @@ def small_world_pan_tif(tmp_path_factory): def test_gdal_pansharpen_help(script_path): - if gdaltest.is_travis_branch("sanitize"): - pytest.skip("fails on sanitize for unknown reason") - assert "ERROR" not in test_py_scripts.run_py_script( script_path, "gdal_pansharpen", "--help" ) diff --git a/autotest/pyscripts/test_gdal_proximity.py b/autotest/pyscripts/test_gdal_proximity.py index 93aa1744403f..f1c51e18f36c 100755 --- a/autotest/pyscripts/test_gdal_proximity.py +++ b/autotest/pyscripts/test_gdal_proximity.py @@ -29,7 +29,6 @@ # DEALINGS IN THE SOFTWARE. ############################################################################### -import gdaltest import pytest import test_py_scripts @@ -52,9 +51,6 @@ def script_path(): def test_gdal_proximity_help(script_path): - if gdaltest.is_travis_branch("sanitize"): - pytest.skip("fails on sanitize for unknown reason") - assert "ERROR" not in test_py_scripts.run_py_script( script_path, "gdal_proximity", "--help" ) @@ -66,9 +62,6 @@ def test_gdal_proximity_help(script_path): def test_gdal_proximity_version(script_path): - if gdaltest.is_travis_branch("sanitize"): - pytest.skip("fails on sanitize for unknown reason") - assert "ERROR" not in test_py_scripts.run_py_script( script_path, "gdal_proximity", "--version" ) diff --git a/autotest/pyscripts/test_gdal_sieve.py b/autotest/pyscripts/test_gdal_sieve.py index 82e4c9b97a4e..a203da5105c1 100755 --- a/autotest/pyscripts/test_gdal_sieve.py +++ b/autotest/pyscripts/test_gdal_sieve.py @@ -30,7 +30,6 @@ ############################################################################### -import gdaltest import pytest import test_py_scripts @@ -53,9 +52,6 @@ def script_path(): def test_gdal_sieve_help(script_path): - if gdaltest.is_travis_branch("sanitize"): - pytest.skip("fails on sanitize for unknown reason") - assert "ERROR" not in test_py_scripts.run_py_script( script_path, "gdal_sieve", "--help" ) diff --git a/autotest/pyscripts/test_ogrmerge.py b/autotest/pyscripts/test_ogrmerge.py index 76887bad0c54..6549b6a61f9e 100755 --- a/autotest/pyscripts/test_ogrmerge.py +++ b/autotest/pyscripts/test_ogrmerge.py @@ -30,7 +30,6 @@ import sys -import gdaltest import pytest import test_py_scripts from test_py_scripts import samples_path @@ -246,9 +245,6 @@ def test_ogrmerge_7(script_path, tmp_path): out_vrt = str(tmp_path / "out.vrt") - if gdaltest.is_travis_branch("sanitize"): - pytest.skip("fails on sanitize for unknown reason") - # No match in -single mode test_py_scripts.run_py_script( script_path,