]> 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:47:36 +0000 (23:47 +0200)
.github/workflows/tests.yml

index 1e056069eee8ec7dd448e9f35b22506c9eabf399..8ebaf330c9c3870f1ec042d9aa5f1727a6efb291 100644 (file)
@@ -48,6 +48,9 @@ jobs:
           # Test with minimum dependencies versions
           - {impl: c, python: "3.7", 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"}
@@ -112,6 +115,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