]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
ci: add test to check for misaligned memory access
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 10 Apr 2024 23:24:02 +0000 (01:24 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 20 Apr 2024 21:45:26 +0000 (23:45 +0200)
.github/workflows/tests.yml

index c91e939c55e654ac55f8a67820b254ab5baec195..e367120425c4efb54658be87814387673fcb95d0 100644 (file)
@@ -48,6 +48,9 @@ jobs:
           # Test with minimum dependencies versions
           - {impl: c, python: "3.8", ext: min, postgres: "postgres:15"}
 
+          # Test memory alignment
+          - {impl: c, python: "3.12", ext: align, postgres: "postgres:16"}
+
           # Test with PyPy.
           - {impl: python, python: "pypy3.9", postgres: "postgres:13"}
           - {impl: python, python: "pypy3.10", postgres: "postgres:14"}
@@ -117,6 +120,13 @@ jobs:
           echo "PIP_CONSTRAINT=${{ github.workspace }}/tests/constraints.txt" \
             >> $GITHUB_ENV
 
+      - name: Configure memory alignment tests
+        if: ${{ matrix.ext == 'align' }}
+        run: |
+          echo "CFLAGS=-fsanitize=undefined" >> $GITHUB_ENV
+          echo "UBSAN_OPTIONS=halt_on_error=1" >> $GITHUB_ENV
+          echo "PYTEST_ADDOPTS=-v" >> $GITHUB_ENV
+
       - name: Install Python packages
         run: pip install $DEPS