From 9c4e37aacfd5f5c788fee495b46ca9f7cbcfe3f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Thu, 21 Mar 2024 11:00:54 +0100 Subject: [PATCH 01/22] Update container image tags. --- .github/workflows/regression.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index c001fedf53f..1b28776de3b 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -52,12 +52,12 @@ jobs: key: ${{ matrix.config_set }}-${{ github.sha }} restore-keys: ${{ matrix.config_set }} - name: Pre Cleanup - uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103 + uses: docker://ghcr.io/su2code/su2/build-su2:240320-1536 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} - name: Build - uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103 + uses: docker://ghcr.io/su2code/su2/build-su2:240320-1536 with: args: -b ${{github.ref}} -f "${{matrix.flags}}" - name: Compress binaries @@ -68,7 +68,7 @@ jobs: name: ${{ matrix.config_set }} path: install_bin.tgz - name: Post Cleanup - uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103 + uses: docker://ghcr.io/su2code/su2/build-su2:240320-1536 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -97,12 +97,12 @@ jobs: key: ${{ matrix.config_set }}-${{ github.sha }} restore-keys: ${{ matrix.config_set }} - name: Pre Cleanup - uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103 + uses: docker://ghcr.io/su2code/su2/build-su2-tsan:240320-1536 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} - name: Build - uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103 + uses: docker://ghcr.io/su2code/su2/build-su2-tsan:240320-1536 with: args: -b ${{github.ref}} -f "${{matrix.flags}}" - name: Compress binaries @@ -113,7 +113,7 @@ jobs: name: ${{ matrix.config_set }} path: install_bin.tgz - name: Post Cleanup - uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103 + uses: docker://ghcr.io/su2code/su2/build-su2-tsan:240320-1536 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -144,7 +144,7 @@ jobs: tag: OMP steps: - name: Pre Cleanup - uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 + uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -170,12 +170,12 @@ jobs: chmod a+x $BIN_FOLDER/* ls -lahR $BIN_FOLDER - name: Run Tests in Container - uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 + uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536 with: # -t -c args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} - name: Cleanup - uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 + uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -192,7 +192,7 @@ jobs: - name: Reduce ASLR entropy for tsan run: sudo sysctl -w vm.mmap_rnd_bits=28 - name: Pre Cleanup - uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103 + uses: docker://ghcr.io/su2code/su2/test-su2-tsan:240320-1536 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -218,12 +218,12 @@ jobs: chmod a+x $BIN_FOLDER/* ls -lahR $BIN_FOLDER - name: Run Tests in Container - uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103 + uses: docker://ghcr.io/su2code/su2/test-su2-tsan:240320-1536 with: # -t -c args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} -a "--tsan" - name: Cleanup - uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103 + uses: docker://ghcr.io/su2code/su2/test-su2-tsan:240320-1536 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -244,7 +244,7 @@ jobs: tag: MPI steps: - name: Pre Cleanup - uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 + uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -305,11 +305,11 @@ jobs: echo $PWD ls -lahR - name: Run Unit Tests - uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 + uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536 with: entrypoint: install/bin/${{matrix.testdriver}} - name: Post Cleanup - uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 + uses: docker://ghcr.io/su2code/su2/test-su2:240320-1536 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} From c2a2c572661cce158eb6b2cb2da1a6932bc5543a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Thu, 21 Mar 2024 14:15:45 +0100 Subject: [PATCH 02/22] Add job for building SU2 with the address sanitizer. --- .github/workflows/regression.yml | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 1b28776de3b..d1126341605 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -117,6 +117,46 @@ jobs: with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} + build_asan: + name: Build SU2 (asan) + strategy: + fail-fast: false + matrix: + config_set: [BaseNoMPI-asan, ReverseNoMPI-asan] + include: + - config_set: BaseNoMPI-asan + flags: '--buildtype=debugoptimized -Denable-pywrapper=true -Denable-openblas=true -Dwith-mpi=disabled -Denable-mlpcpp=true -Denable-tests=true --warnlevel=3 --werror' + - config_set: ReverseNoMPI-asan + flags: '--buildtype=debugoptimized -Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror' + runs-on: ${{ inputs.runner || 'ubuntu-latest' }} + steps: + - name: Reduce ASLR entropy for asan + run: sudo sysctl -w vm.mmap_rnd_bits=28 + - name: Cache Object Files + uses: actions/cache@v4 + with: + path: ccache + key: ${{ matrix.config_set }}-${{ github.sha }} + restore-keys: ${{ matrix.config_set }} + - name: Pre Cleanup + uses: docker://ghcr.io/su2code/su2/build-su2-asan:240320-1536 + with: + entrypoint: /bin/rm + args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} + - name: Build + run: docker run --rm -it --cap-add=SYS_PTRACE -v $(pwd):/${{ github.workspace }} -w ${{ github.workspace }} ghcr.io/su2code/su2/build-su2-asan:240320-1536 -b ${{github.ref}} -f "${{matrix.flags}}" + - name: Compress binaries + run: tar -zcvf install_bin.tgz install/* + - name: Upload Binaries + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.config_set }} + path: install_bin.tgz + - name: Post Cleanup + uses: docker://ghcr.io/su2code/su2/build-su2-asan:240320-1536 + with: + entrypoint: /bin/rm + args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} regression_tests: runs-on: ${{ inputs.runner || 'ubuntu-latest' }} name: Regression Tests From 5ff2348da749023b7a271882c3954a7db5a2a539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Thu, 21 Mar 2024 14:33:13 +0100 Subject: [PATCH 03/22] Fix. --- .github/workflows/regression.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index d1126341605..ce0aa58bd90 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -144,7 +144,7 @@ jobs: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} - name: Build - run: docker run --rm -it --cap-add=SYS_PTRACE -v $(pwd):/${{ github.workspace }} -w ${{ github.workspace }} ghcr.io/su2code/su2/build-su2-asan:240320-1536 -b ${{github.ref}} -f "${{matrix.flags}}" + run: docker run --rm --cap-add=SYS_PTRACE -v $(pwd):/${{ github.workspace }} -w ${{ github.workspace }} ghcr.io/su2code/su2/build-su2-asan:240320-1536 -b ${{github.ref}} -f "${{matrix.flags}}" - name: Compress binaries run: tar -zcvf install_bin.tgz install/* - name: Upload Binaries From bc6362f4b3063412c410872f8de995ae698cbeb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Thu, 21 Mar 2024 14:56:22 +0100 Subject: [PATCH 04/22] Remove slash. --- .github/workflows/regression.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index ce0aa58bd90..fdf619a57cb 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -144,7 +144,7 @@ jobs: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} - name: Build - run: docker run --rm --cap-add=SYS_PTRACE -v $(pwd):/${{ github.workspace }} -w ${{ github.workspace }} ghcr.io/su2code/su2/build-su2-asan:240320-1536 -b ${{github.ref}} -f "${{matrix.flags}}" + run: docker run --rm --cap-add=SYS_PTRACE -v $(pwd):${{ github.workspace }} -w ${{ github.workspace }} ghcr.io/su2code/su2/build-su2-asan:240320-1536 -b ${{github.ref}} -f "${{matrix.flags}}" - name: Compress binaries run: tar -zcvf install_bin.tgz install/* - name: Upload Binaries From 3c32cd4f7d007dc14c9b47108c3796d653577aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Fri, 22 Mar 2024 13:08:08 +0100 Subject: [PATCH 05/22] Address sanitizer builds without python wrapper and unit tests. --- .github/workflows/regression.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index fdf619a57cb..29d47f6bccd 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -125,9 +125,9 @@ jobs: config_set: [BaseNoMPI-asan, ReverseNoMPI-asan] include: - config_set: BaseNoMPI-asan - flags: '--buildtype=debugoptimized -Denable-pywrapper=true -Denable-openblas=true -Dwith-mpi=disabled -Denable-mlpcpp=true -Denable-tests=true --warnlevel=3 --werror' + flags: '--buildtype=debugoptimized -Denable-pywrapper=true -Denable-openblas=true -Dwith-mpi=disabled -Denable-mlpcpp=true --warnlevel=3 --werror' - config_set: ReverseNoMPI-asan - flags: '--buildtype=debugoptimized -Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror' + flags: '--buildtype=debugoptimized -Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled --warnlevel=3 --werror' runs-on: ${{ inputs.runner || 'ubuntu-latest' }} steps: - name: Reduce ASLR entropy for asan @@ -144,7 +144,7 @@ jobs: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} - name: Build - run: docker run --rm --cap-add=SYS_PTRACE -v $(pwd):${{ github.workspace }} -w ${{ github.workspace }} ghcr.io/su2code/su2/build-su2-asan:240320-1536 -b ${{github.ref}} -f "${{matrix.flags}}" + run: docker run --rm --cap-add SYS_PTRACE -v $(pwd):${{ github.workspace }} -w ${{ github.workspace }} ghcr.io/su2code/su2/build-su2-asan:240320-1536 -b ${{github.ref}} -f "${{matrix.flags}}" - name: Compress binaries run: tar -zcvf install_bin.tgz install/* - name: Upload Binaries From acd1a760f3f12ea16a870585b46665370574db63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Mon, 25 Mar 2024 15:35:33 +0100 Subject: [PATCH 06/22] Add --asan flag, add with_asan parameter. --- .github/workflows/regression.yml | 2 +- TestCases/TestCase.py | 31 +++++++++++++++++-------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 29d47f6bccd..274918a2e2f 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -125,7 +125,7 @@ jobs: config_set: [BaseNoMPI-asan, ReverseNoMPI-asan] include: - config_set: BaseNoMPI-asan - flags: '--buildtype=debugoptimized -Denable-pywrapper=true -Denable-openblas=true -Dwith-mpi=disabled -Denable-mlpcpp=true --warnlevel=3 --werror' + flags: '--buildtype=debugoptimized -Denable-openblas=true -Dwith-mpi=disabled -Denable-mlpcpp=true --warnlevel=3 --werror' - config_set: ReverseNoMPI-asan flags: '--buildtype=debugoptimized -Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled --warnlevel=3 --werror' runs-on: ${{ inputs.runner || 'ubuntu-latest' }} diff --git a/TestCases/TestCase.py b/TestCases/TestCase.py index 6d577b47df4..ce63fddd5c6 100644 --- a/TestCases/TestCase.py +++ b/TestCases/TestCase.py @@ -45,6 +45,7 @@ def is_float(test_string): def parse_args(description: str): parser = argparse.ArgumentParser(description=description) parser.add_argument('--tsan', action='store_true', help='Run thread sanitizer tests. Requires a tsan-enabled SU2 build.') + parser.add_argument('--asan', action='store_true', help='Run address sanitizer tests. Requires an asan-enabled SU2 build.') return parser.parse_args() class TestCase: @@ -114,6 +115,7 @@ def __init__(self,tag_in): self.cpu_arch = platform.machine().casefold() self.enabled_on_cpu_arch = ["x86_64","amd64","aarch64","arm64"] self.enabled_with_tsan = True + self.enabled_with_asan = True self.command = self.Command() self.timeout = 0 self.tol = 0.0 @@ -125,9 +127,9 @@ def __init__(self,tag_in): self.reference_file_aarch64 = "" self.test_file = "of_grad.dat" - def run_test(self, running_with_tsan=False): + def run_test(self, with_tsan=False, with_asan=False): - if not self.is_enabled(running_with_tsan): + if not self.is_enabled(with_tsan, with_asan): return True print('==================== Start Test: %s ===================='%self.tag) @@ -142,7 +144,7 @@ def run_test(self, running_with_tsan=False): # Adjust the number of iterations in the config file if len(self.test_vals) != 0: - self.adjust_iter(running_with_tsan) + self.adjust_iter(with_tsan, with_asan) # Check for disabling the restart if self.no_restart: @@ -186,7 +188,7 @@ def run_test(self, running_with_tsan=False): delta_vals = [] sim_vals = [] - if not running_with_tsan: # tsan findings result in non-zero return code, no need to examine the output + if not with_tsan and not with_asan: # sanitizer findings result in non-zero return code, no need to examine the output # Examine the output f = open(logfilename,'r') output = f.readlines() @@ -260,7 +262,7 @@ def run_test(self, running_with_tsan=False): if not start_solver: print('ERROR: The code was not able to get to the "Begin solver" section.') - if not running_with_tsan and iter_missing: + if not with_tsan and not with_asan and iter_missing: print('ERROR: The iteration number %d could not be found.'%self.test_iter) print('CPU architecture=%s' % self.cpu_arch) @@ -281,9 +283,9 @@ def run_test(self, running_with_tsan=False): os.chdir(workdir) return passed - def run_filediff(self, running_with_tsan=False): + def run_filediff(self, with_tsan=False, with_asan=False): - if not self.is_enabled(running_with_tsan): + if not self.is_enabled(with_tsan, with_asan): return True print('==================== Start Test: %s ===================='%self.tag) @@ -291,7 +293,7 @@ def run_filediff(self, running_with_tsan=False): timed_out = False # Adjust the number of iterations in the config file - self.adjust_iter(running_with_tsan) + self.adjust_iter(with_tsan, with_asan) self.adjust_test_data() @@ -330,7 +332,7 @@ def run_filediff(self, running_with_tsan=False): print("Output from the failed case:") subprocess.call(["cat", logfilename]) - if not running_with_tsan: # thread sanitizer tests only check the return code, no need to compare outputs + if not with_tsan and not with_asan: # sanitizer tests only check the return code, no need to compare outputs diff_time_start = datetime.datetime.now() if not timed_out and passed: # Compare files @@ -850,7 +852,7 @@ def run_def(self): os.chdir(workdir) return passed - def adjust_iter(self, running_with_tsan=False): + def adjust_iter(self, with_tsan=False, with_asan=False): # Read the cfg file workdir = os.getcwd() @@ -861,7 +863,7 @@ def adjust_iter(self, running_with_tsan=False): new_iter = self.test_iter + 1 - if running_with_tsan: + if with_tsan or with_asan: # detect restart restart_iter = 0 @@ -942,18 +944,19 @@ def disable_restart(self): return - def is_enabled(self, running_with_tsan=False): + def is_enabled(self, with_tsan=False, with_asan=False): is_enabled_on_arch = self.cpu_arch in self.enabled_on_cpu_arch if not is_enabled_on_arch: print('Ignoring test "%s" because it is not enabled for the current CPU architecture: %s' % (self.tag, self.cpu_arch)) - tsan_compatible = not running_with_tsan or self.enabled_with_tsan + tsan_compatible = not with_tsan or self.enabled_with_tsan + asan_compatible = not with_asan or self.enabled_with_asan if not tsan_compatible: print('Ignoring test "%s" because it is not enabled to run with the thread sanitizer.' % self.tag) - return is_enabled_on_arch and tsan_compatible + return is_enabled_on_arch and tsan_compatible and asan_compatible def adjust_test_data(self): From c16aab20c0e8744d8a4d41ce6df4b4075b6e0ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Mon, 25 Mar 2024 16:05:28 +0100 Subject: [PATCH 07/22] Add basic tsan/asan checks to further run_* routines. --- TestCases/TestCase.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/TestCases/TestCase.py b/TestCases/TestCase.py index ce63fddd5c6..ec6499245b3 100644 --- a/TestCases/TestCase.py +++ b/TestCases/TestCase.py @@ -470,9 +470,9 @@ def run_filediff(self, with_tsan=False, with_asan=False): os.chdir(workdir) return passed - def run_opt(self): + def run_opt(self, with_tsan=False, with_asan=False): - if not self.is_enabled(): + if not self.is_enabled(with_tsan, with_asan): return True print('==================== Start Test: %s ===================='%self.tag) @@ -595,9 +595,9 @@ def run_opt(self): os.chdir(workdir) return passed - def run_geo(self): + def run_geo(self, with_tsan=False, with_asan=False): - if not self.is_enabled(): + if not self.is_enabled(with_tsan, with_asan): return True print('==================== Start Test: %s ===================='%self.tag) @@ -727,9 +727,9 @@ def run_geo(self): os.chdir(workdir) return passed - def run_def(self): + def run_def(self, with_tsan=False, with_asan=False): - if not self.is_enabled(): + if not self.is_enabled(with_tsan, with_asan): return True print('==================== Start Test: %s ===================='%self.tag) From c84780e94d63d7180638b7abe356b6a7c21a1e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Mon, 25 Mar 2024 16:13:04 +0100 Subject: [PATCH 08/22] Enable address sanitizer execution of SU2_CFD serial regression tests. --- TestCases/serial_regression.py | 86 +++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 28 deletions(-) diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index cecb6408e22..9964395d837 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -28,12 +28,15 @@ from __future__ import print_function, division, absolute_import import sys from TestCase import TestCase +from TestCase import parse_args def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' + args = parse_args('Serial Regression Tests') + test_list = [] ######################### @@ -1188,7 +1191,7 @@ def main(): if test.tol == 0.0: test.tol = 0.00001 - pass_list = [ test.run_test() for test in test_list ] + pass_list = [ test.run_test(args.tsan, args.asan) for test in test_list ] ###################################### @@ -1203,7 +1206,8 @@ def main(): naca0012_geo.command = TestCase.Command(exec = "SU2_GEO") naca0012_geo.timeout = 1600 naca0012_geo.tol = 0.00001 - pass_list.append(naca0012_geo.run_geo()) + naca0012_geo.enabled_with_asan = False + pass_list.append(naca0012_geo.run_geo(args.tsan, args.asan)) test_list.append(naca0012_geo) ###################################### @@ -1219,8 +1223,9 @@ def main(): intersect_def.command = TestCase.Command(exec = "SU2_DEF") intersect_def.timeout = 1600 intersect_def.tol = 1e-04 + intersect_def.enabled_with_asan = False - pass_list.append(intersect_def.run_def()) + pass_list.append(intersect_def.run_def(args.tsan, args.asan)) test_list.append(intersect_def) # Inviscid NACA0012 (triangles) @@ -1232,8 +1237,9 @@ def main(): naca0012_def.command = TestCase.Command(exec = "SU2_DEF") naca0012_def.timeout = 1600 naca0012_def.tol = 1e-08 + naca0012_def.enabled_with_asan = False - pass_list.append(naca0012_def.run_def()) + pass_list.append(naca0012_def.run_def(args.tsan, args.asan)) test_list.append(naca0012_def) # Inviscid NACA0012 based on SURFACE_FILE input (surface_bump.dat) @@ -1245,8 +1251,9 @@ def main(): naca0012_def_file.command = TestCase.Command(exec = "SU2_DEF") naca0012_def_file.timeout = 1600 naca0012_def_file.tol = 1e-8 + naca0012_def_file.enabled_with_asan = False - pass_list.append(naca0012_def_file.run_def()) + pass_list.append(naca0012_def_file.run_def(args.tsan, args.asan)) test_list.append(naca0012_def_file) # RAE2822 (mixed tris + quads) @@ -1258,8 +1265,9 @@ def main(): rae2822_def.command = TestCase.Command(exec = "SU2_DEF") rae2822_def.timeout = 1600 rae2822_def.tol = 1e-13 + rae2822_def.enabled_with_asan = False - pass_list.append(rae2822_def.run_def()) + pass_list.append(rae2822_def.run_def(args.tsan, args.asan)) test_list.append(rae2822_def) # Turb NACA4412 (quads, wall distance) @@ -1271,8 +1279,9 @@ def main(): naca4412_def.command = TestCase.Command(exec = "SU2_DEF") naca4412_def.timeout = 1600 naca4412_def.tol = 1e-12 + naca4412_def.enabled_with_asan = False - pass_list.append(naca4412_def.run_def()) + pass_list.append(naca4412_def.run_def(args.tsan, args.asan)) test_list.append(naca4412_def) # Brick of tets (inverse volume) @@ -1284,8 +1293,9 @@ def main(): brick_tets_def.command = TestCase.Command(exec = "SU2_DEF") brick_tets_def.timeout = 1600 brick_tets_def.tol = 1e-09 + brick_tets_def.enabled_with_asan = False - pass_list.append(brick_tets_def.run_def()) + pass_list.append(brick_tets_def.run_def(args.tsan, args.asan)) test_list.append(brick_tets_def) # Brick of isotropic hexas (inverse volume) @@ -1297,8 +1307,9 @@ def main(): brick_hex_def.command = TestCase.Command(exec = "SU2_DEF") brick_hex_def.timeout = 1600 brick_hex_def.tol = 1e-09 + brick_hex_def.enabled_with_asan = False - pass_list.append(brick_hex_def.run_def()) + pass_list.append(brick_hex_def.run_def(args.tsan, args.asan)) test_list.append(brick_hex_def) # Brick with a pyramid layer (inverse volume) @@ -1310,8 +1321,9 @@ def main(): brick_pyra_def.command = TestCase.Command(exec = "SU2_DEF") brick_pyra_def.timeout = 1600 brick_pyra_def.tol = 1e-08 + brick_pyra_def.enabled_with_asan = False - pass_list.append(brick_pyra_def.run_def()) + pass_list.append(brick_pyra_def.run_def(args.tsan, args.asan)) test_list.append(brick_pyra_def) # Brick of isotropic prisms (inverse volume) @@ -1323,8 +1335,9 @@ def main(): brick_prism_def.command = TestCase.Command(exec = "SU2_DEF") brick_prism_def.timeout = 1600 brick_prism_def.tol = 1e-08 + brick_prism_def.enabled_with_asan = False - pass_list.append(brick_prism_def.run_def()) + pass_list.append(brick_prism_def.run_def(args.tsan, args.asan)) test_list.append(brick_prism_def) # Brick of prisms with high aspect ratio cells near the wall (wall distance) @@ -1336,8 +1349,9 @@ def main(): brick_prism_rans_def.command = TestCase.Command(exec = "SU2_DEF") brick_prism_rans_def.timeout = 1600 brick_prism_rans_def.tol = 1e-12 + brick_prism_rans_def.enabled_with_asan = False - pass_list.append(brick_prism_rans_def.run_def()) + pass_list.append(brick_prism_rans_def.run_def(args.tsan, args.asan)) test_list.append(brick_prism_rans_def) # Brick of hexas with high aspect ratio cells near the wall (inverse volume) @@ -1349,8 +1363,9 @@ def main(): brick_hex_rans_def.command = TestCase.Command(exec = "SU2_DEF") brick_hex_rans_def.timeout = 1600 brick_hex_rans_def.tol = 1e-12 + brick_hex_rans_def.enabled_with_asan = False - pass_list.append(brick_hex_rans_def.run_def()) + pass_list.append(brick_hex_rans_def.run_def(args.tsan, args.asan)) test_list.append(brick_hex_rans_def) # Cylindrical FFD test @@ -1362,8 +1377,9 @@ def main(): cylinder_ffd_def.command = TestCase.Command(exec = "SU2_DEF") cylinder_ffd_def.timeout = 1600 cylinder_ffd_def.tol = 1e-09 + cylinder_ffd_def.enabled_with_asan = False - pass_list.append(cylinder_ffd_def.run_def()) + pass_list.append(cylinder_ffd_def.run_def(args.tsan, args.asan)) test_list.append(cylinder_ffd_def) # Spherical FFD test @@ -1375,8 +1391,9 @@ def main(): sphere_ffd_def.command = TestCase.Command(exec = "SU2_DEF") sphere_ffd_def.timeout = 1600 sphere_ffd_def.tol = 1e-08 + sphere_ffd_def.enabled_with_asan = False - pass_list.append(sphere_ffd_def.run_def()) + pass_list.append(sphere_ffd_def.run_def(args.tsan, args.asan)) test_list.append(sphere_ffd_def) # Spherical FFD test using BSplines @@ -1388,8 +1405,9 @@ def main(): sphere_ffd_def_bspline.command = TestCase.Command(exec = "SU2_DEF") sphere_ffd_def_bspline.timeout = 1600 sphere_ffd_def_bspline.tol = 1e-08 + sphere_ffd_def_bspline.enabled_with_asan = False - pass_list.append(sphere_ffd_def_bspline.run_def()) + pass_list.append(sphere_ffd_def_bspline.run_def(args.tsan, args.asan)) test_list.append(sphere_ffd_def_bspline) ###################################### @@ -1405,7 +1423,8 @@ def main(): contadj_euler_py.timeout = 1600 contadj_euler_py.reference_file = "of_grad_cd.dat.ref" contadj_euler_py.test_file = "of_grad_cd.dat" - pass_list.append(contadj_euler_py.run_filediff()) + contadj_euler_py.enabled_with_asan = False + pass_list.append(contadj_euler_py.run_filediff(args.tsan, args.asan)) test_list.append(contadj_euler_py) # test shape_optimization.py @@ -1417,7 +1436,8 @@ def main(): shape_opt_euler_py.command = TestCase.Command(exec = "shape_optimization.py", param = "-g CONTINUOUS_ADJOINT -f") shape_opt_euler_py.timeout = 1600 shape_opt_euler_py.tol = 0.00001 - pass_list.append(shape_opt_euler_py.run_opt()) + shape_opt_euler_py.enabled_with_asan = False + pass_list.append(shape_opt_euler_py.run_opt(args.tsan, args.asan)) test_list.append(shape_opt_euler_py) # Multiple functionals with the continuous adjoint @@ -1429,7 +1449,8 @@ def main(): contadj_multi_py.timeout = 1600 contadj_multi_py.reference_file = "of_grad_combo.dat.ref" contadj_multi_py.test_file = "of_grad_combo.dat" - pass_list.append(contadj_multi_py.run_filediff()) + contadj_multi_py.enabled_with_asan = False + pass_list.append(contadj_multi_py.run_filediff(args.tsan, args.asan)) test_list.append(contadj_multi_py) # Optimization with multiple objectives, with gradients evaluated individually @@ -1467,7 +1488,8 @@ def main(): opt_multiobj1surf_py.command = TestCase.Command(exec = "shape_optimization.py", param = "-g CONTINUOUS_ADJOINT -f") opt_multiobj1surf_py.timeout = 1600 opt_multiobj1surf_py.tol = 0.00001 - pass_list.append(opt_multiobj1surf_py.run_opt()) + opt_multiobj1surf_py.enabled_with_asan = False + pass_list.append(opt_multiobj1surf_py.run_opt(args.tsan, args.asan)) test_list.append(opt_multiobj1surf_py) # test optimization, with a single objective evaluated on multiple surfaces @@ -1479,7 +1501,8 @@ def main(): opt_2surf1obj_py.command = TestCase.Command(exec = "shape_optimization.py", param = "-g CONTINUOUS_ADJOINT -f") opt_2surf1obj_py.timeout = 1600 opt_2surf1obj_py.tol = 0.00001 - pass_list.append(opt_2surf1obj_py.run_opt()) + opt_2surf1obj_py.enabled_with_asan = False + pass_list.append(opt_2surf1obj_py.run_opt(args.tsan, args.asan)) test_list.append(opt_2surf1obj_py) ########################## @@ -1495,8 +1518,9 @@ def main(): pywrapper_naca0012.command = TestCase.Command(exec = "SU2_CFD.py", param = "-f") pywrapper_naca0012.timeout = 1600 pywrapper_naca0012.tol = 0.00001 + pywrapper_naca0012.enabled_with_asan = False test_list.append(pywrapper_naca0012) - pass_list.append(pywrapper_naca0012.run_test()) + pass_list.append(pywrapper_naca0012.run_test(args.tsan, args.asan)) # NACA0012 (SST, FUN3D results for finest grid: CL=1.0840, CD=0.01253) pywrapper_turb_naca0012_sst = TestCase('pywrapper_turb_naca0012_sst') @@ -1508,8 +1532,9 @@ def main(): pywrapper_turb_naca0012_sst.command = TestCase.Command(exec = "SU2_CFD.py", param = "-f") pywrapper_turb_naca0012_sst.timeout = 3200 pywrapper_turb_naca0012_sst.tol = 0.00001 + pywrapper_turb_naca0012_sst.enabled_with_asan = False test_list.append(pywrapper_turb_naca0012_sst) - pass_list.append(pywrapper_turb_naca0012_sst.run_test()) + pass_list.append(pywrapper_turb_naca0012_sst.run_test(args.tsan, args.asan)) # Square cylinder pywrapper_square_cylinder = TestCase('pywrapper_square_cylinder') @@ -1521,8 +1546,9 @@ def main(): pywrapper_square_cylinder.timeout = 1600 pywrapper_square_cylinder.tol = 0.00001 pywrapper_square_cylinder.unsteady = True + pywrapper_square_cylinder.enabled_with_asan = False test_list.append(pywrapper_square_cylinder) - pass_list.append(pywrapper_square_cylinder.run_test()) + pass_list.append(pywrapper_square_cylinder.run_test(args.tsan, args.asan)) # Aeroelastic pywrapper_aeroelastic = TestCase('pywrapper_aeroelastic') @@ -1534,8 +1560,9 @@ def main(): pywrapper_aeroelastic.timeout = 1600 pywrapper_aeroelastic.tol = 0.00001 pywrapper_aeroelastic.unsteady = True + pywrapper_aeroelastic.enabled_with_asan = False test_list.append(pywrapper_aeroelastic) - pass_list.append(pywrapper_aeroelastic.run_test()) + pass_list.append(pywrapper_aeroelastic.run_test(args.tsan, args.asan)) # FSI, 2d pywrapper_fsi2d = TestCase('pywrapper_fsi2d') @@ -1548,8 +1575,9 @@ def main(): pywrapper_fsi2d.multizone = True pywrapper_fsi2d.timeout = 1600 pywrapper_fsi2d.tol = 0.00001 + pywrapper_fsi2d.enabled_with_asan = False test_list.append(pywrapper_fsi2d) - pass_list.append(pywrapper_fsi2d.run_test()) + pass_list.append(pywrapper_fsi2d.run_test(args.tsan, args.asan)) # Unsteady CHT pywrapper_unsteadyCHT = TestCase('pywrapper_unsteadyCHT') @@ -1561,8 +1589,9 @@ def main(): pywrapper_unsteadyCHT.timeout = 1600 pywrapper_unsteadyCHT.tol = 0.00001 pywrapper_unsteadyCHT.unsteady = True + pywrapper_unsteadyCHT.enabled_with_asan = False test_list.append(pywrapper_unsteadyCHT) - pass_list.append(pywrapper_unsteadyCHT.run_test()) + pass_list.append(pywrapper_unsteadyCHT.run_test(args.tsan, args.asan)) # Rigid motion pywrapper_rigidMotion = TestCase('pywrapper_rigidMotion') @@ -1574,8 +1603,9 @@ def main(): pywrapper_rigidMotion.timeout = 1600 pywrapper_rigidMotion.tol = 0.00001 pywrapper_rigidMotion.unsteady = True + pywrapper_rigidMotion.enabled_with_asan = False test_list.append(pywrapper_rigidMotion) - pass_list.append(pywrapper_rigidMotion.run_test()) + pass_list.append(pywrapper_rigidMotion.run_test(args.tsan, args.asan)) # Tests summary print('==================================================================') From 8a79faa2ebfba86bae4e2bd432fbb3877496c7da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Mon, 25 Mar 2024 16:44:37 +0100 Subject: [PATCH 09/22] Add job for address sanitizer tests. --- .github/workflows/regression.yml | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 274918a2e2f..b80cd8f4384 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -267,6 +267,53 @@ jobs: with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} + address_sanitizer_tests: + runs-on: ${{ inputs.runner || 'ubuntu-latest' }} + name: Address Sanitizer Tests + needs: build_asan + strategy: + fail-fast: false + matrix: + testscript: ['serial_regression.py'] + steps: + - name: Reduce ASLR entropy for asan + run: sudo sysctl -w vm.mmap_rnd_bits=28 + - name: Pre Cleanup + uses: docker://ghcr.io/su2code/su2/test-su2-asan:240320-1536 + with: + entrypoint: /bin/rm + args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} + - name: Download All artifacts + uses: actions/download-artifact@v4 + - name: Uncompress and Move Binaries + run: | + BIN_FOLDER="$PWD/install/bin" + mkdir -p $BIN_FOLDER + ls -lah $BIN_FOLDER + for type in Base Reverse Forward; do + TYPE_FOLDER="${type}NoMPI-asan" + echo "Processing '$TYPE_FOLDER' ..." + if [ -d $TYPE_FOLDER ]; then + pushd $TYPE_FOLDER + ls -lah + tar -zxvf install_bin.tgz + ls -lah install/bin/ + cp -r install/* $BIN_FOLDER/../ + popd; + fi + done + chmod a+x $BIN_FOLDER/* + ls -lahR $BIN_FOLDER + - name: Run Tests in Container + uses: docker://ghcr.io/su2code/su2/test-su2-asan:240320-1536 + with: + # -t -c + args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} -a "--asan" + - name: Cleanup + uses: docker://ghcr.io/su2code/su2/test-su2-asan:240320-1536 + with: + entrypoint: /bin/rm + args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} unit_tests: runs-on: ${{ inputs.runner || 'ubuntu-latest' }} name: Unit Tests From 3e426993752690a0f8b22e98e1781e8748418fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 26 Mar 2024 17:19:12 +0100 Subject: [PATCH 10/22] Avoid reallocation of surface_movement. --- SU2_CFD/src/drivers/CDriver.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index 7160cc93e6f..6c1a6170a04 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -2389,7 +2389,9 @@ void CDriver::PreprocessDynamicMesh(CConfig *config, CGeometry **geometry, CSolv cout << "Setting dynamic mesh structure for zone "<< iZone + 1<<"." << endl; grid_movement = new CVolumetricMovement(geometry[MESH_0], config); - surface_movement = new CSurfaceMovement(); + if (surface_movement != nullptr) + surface_movement = new CSurfaceMovement(); + surface_movement->CopyBoundary(geometry[MESH_0], config); if (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE){ if (rank == MASTER_NODE) cout << endl << "Instance "<< iInst + 1 <<":" << endl; From a65d31cd0532529f3addf977011923c23cf38d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Wed, 27 Mar 2024 16:00:43 +0100 Subject: [PATCH 11/22] Enable address sanitizer execution of SU2_CFD_AD serial regression AD tests. --- .github/workflows/regression.yml | 2 +- TestCases/serial_regression_AD.py | 29 ++++++++++++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index b80cd8f4384..af6f6c60875 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -274,7 +274,7 @@ jobs: strategy: fail-fast: false matrix: - testscript: ['serial_regression.py'] + testscript: ['serial_regression.py', 'serial_regression_AD.py'] steps: - name: Reduce ASLR entropy for asan run: sudo sysctl -w vm.mmap_rnd_bits=28 diff --git a/TestCases/serial_regression_AD.py b/TestCases/serial_regression_AD.py index 2a0ac757097..ac268040cd5 100644 --- a/TestCases/serial_regression_AD.py +++ b/TestCases/serial_regression_AD.py @@ -30,12 +30,15 @@ import sys from TestCase import TestCase +from TestCase import parse_args def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' + args = parse_args('Serial Regression AD Tests') + test_list = [] ##################################### @@ -223,7 +226,7 @@ def main(): if test.tol == 0.0: test.tol = 0.00001 - pass_list = [ test.run_test() for test in test_list ] + pass_list = [ test.run_test(args.tsan, args.asan) for test in test_list ] ################################### ### Coupled RHT-CFD Adjoint ### @@ -239,7 +242,8 @@ def main(): discadj_rht.reference_file = "of_grad_cd.csv.ref" discadj_rht.reference_file_aarch64 = "of_grad_cd_aarch64.csv.ref" discadj_rht.test_file = "of_grad_cd.csv" - pass_list.append(discadj_rht.run_filediff()) + discadj_rht.enabled_with_asan = False + pass_list.append(discadj_rht.run_filediff(args.tsan, args.asan)) test_list.append(discadj_rht) ###################################### @@ -256,7 +260,8 @@ def main(): discadj_euler_py.reference_file = "of_grad_cd_disc.dat.ref" discadj_euler_py.reference_file_aarch64 = "of_grad_cd_disc_aarch64.dat.ref" discadj_euler_py.test_file = "of_grad_cd.dat" - pass_list.append(discadj_euler_py.run_filediff()) + discadj_euler_py.enabled_with_asan = False + pass_list.append(discadj_euler_py.run_filediff(args.tsan, args.asan)) test_list.append(discadj_euler_py) # test discrete_adjoint with multiple ffd boxes @@ -269,7 +274,8 @@ def main(): discadj_multiple_ffd_py.reference_file = "of_grad_cd.dat.ref" discadj_multiple_ffd_py.reference_file_aarch64 = "of_grad_cd_aarch64.dat.ref" discadj_multiple_ffd_py.test_file = "of_grad_cd.dat" - pass_list.append(discadj_multiple_ffd_py.run_filediff()) + discadj_multiple_ffd_py.enabled_with_asan = False + pass_list.append(discadj_multiple_ffd_py.run_filediff(args.tsan, args.asan)) test_list.append(discadj_multiple_ffd_py) # test direct_differentiation.py @@ -282,7 +288,8 @@ def main(): directdiff_euler_py.reference_file = "of_grad_directdiff.dat.ref" directdiff_euler_py.reference_file_aarch64 = "of_grad_directdiff_aarch64.dat.ref" directdiff_euler_py.test_file = "DIRECTDIFF/of_grad_directdiff.dat" - pass_list.append(directdiff_euler_py.run_filediff()) + directdiff_euler_py.enabled_with_asan = False + pass_list.append(directdiff_euler_py.run_filediff(args.tsan, args.asan)) test_list.append(directdiff_euler_py) # test direct_differentiation.py with multiple ffd boxes @@ -295,7 +302,8 @@ def main(): directdiff_multiple_ffd_py.reference_file = "of_grad_directdiff.dat.ref" directdiff_multiple_ffd_py.reference_file_aarch64 = "of_grad_directdiff_aarch64.dat.ref" directdiff_multiple_ffd_py.test_file = "DIRECTDIFF/of_grad_directdiff.dat" - pass_list.append(directdiff_multiple_ffd_py.run_filediff()) + directdiff_multiple_ffd_py.enabled_with_asan = False + pass_list.append(directdiff_multiple_ffd_py.run_filediff(args.tsan, args.asan)) test_list.append(directdiff_multiple_ffd_py) # test continuous_adjoint.py, with multiple objectives @@ -320,8 +328,9 @@ def main(): pywrapper_FEA_AD_FlowLoad.timeout = 1600 pywrapper_FEA_AD_FlowLoad.tol = 0.000001 pywrapper_FEA_AD_FlowLoad.new_output = False + pywrapper_FEA_AD_FlowLoad.enabled_with_asan = False test_list.append(pywrapper_FEA_AD_FlowLoad) - pass_list.append(pywrapper_FEA_AD_FlowLoad.run_test()) + pass_list.append(pywrapper_FEA_AD_FlowLoad.run_test(args.tsan, args.asan)) # Flow AD Mesh Displacement Sensitivity pywrapper_CFD_AD_MeshDisp = TestCase('pywrapper_CFD_AD_MeshDisp') @@ -333,8 +342,9 @@ def main(): pywrapper_CFD_AD_MeshDisp.timeout = 1600 pywrapper_CFD_AD_MeshDisp.tol = 0.000001 pywrapper_CFD_AD_MeshDisp.new_output = False + pywrapper_CFD_AD_MeshDisp.enabled_with_asan = False test_list.append(pywrapper_CFD_AD_MeshDisp) - pass_list.append(pywrapper_CFD_AD_MeshDisp.run_test()) + pass_list.append(pywrapper_CFD_AD_MeshDisp.run_test(args.tsan, args.asan)) ################################### @@ -350,7 +360,8 @@ def main(): grad_smooth_naca0012.reference_file = "of_hess.dat.ref" grad_smooth_naca0012.reference_file_aarch64 = "of_hess_aarch64.dat.ref" grad_smooth_naca0012.test_file = "of_hess.dat" - pass_list.append(grad_smooth_naca0012.run_filediff()) + grad_smooth_naca0012.enabled_with_asan = False + pass_list.append(grad_smooth_naca0012.run_filediff(args.tsan, args.asan)) test_list.append(grad_smooth_naca0012) # Tests summary From 3477fba6e59b07190c385688a609423f9e14ea7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Thu, 28 Mar 2024 18:37:45 +0100 Subject: [PATCH 12/22] Enable asan execution of SU2_GEO and SU2_DEF serial regression tests. --- TestCases/TestCase.py | 166 +++++++++++++++++---------------- TestCases/serial_regression.py | 15 --- 2 files changed, 84 insertions(+), 97 deletions(-) diff --git a/TestCases/TestCase.py b/TestCases/TestCase.py index ec6499245b3..334be29bb01 100644 --- a/TestCases/TestCase.py +++ b/TestCases/TestCase.py @@ -642,52 +642,53 @@ def run_geo(self, with_tsan=False, with_asan=False): timed_out = True passed = False - # Examine the output - f = open(logfilename,'r') - output = f.readlines() - delta_vals = [] - sim_vals = [] - data = [] - if not timed_out: - start_solver = False - for line in output: - if not start_solver: # Don't bother parsing anything before SU2_GEO starts - if line.find('Station 1') > -1: - start_solver=True - elif line.find('Station 2') > -1: # jump out of loop if we hit the next station - break - else: # Found the lines; parse the input - - if line.find('Chord') > -1: - raw_data = line.replace(",", "").split() - data.append(raw_data[1]) - found_chord = True - data.append(raw_data[5]) - found_radius = True - data.append(raw_data[8]) - found_toc = True - data.append(raw_data[10]) - found_aoa = True - - if found_chord and found_radius and found_toc and found_aoa: # Found what we're checking for - iter_missing = False - if not len(self.test_vals)==len(data): # something went wrong... probably bad input - print("Error in test_vals!") - passed = False - for j in range(len(data)): - sim_vals.append( float(data[j]) ) - delta_vals.append( abs(float(data[j])-self.test_vals[j]) ) - if delta_vals[j] > self.tol: - exceed_tol = True - passed = False - else: - iter_missing = True + if not with_tsan and not with_asan: # sanitizer findings result in non-zero return code, no need to examine the output + # Examine the output + f = open(logfilename,'r') + output = f.readlines() + delta_vals = [] + sim_vals = [] + data = [] + if not timed_out: + start_solver = False + for line in output: + if not start_solver: # Don't bother parsing anything before SU2_GEO starts + if line.find('Station 1') > -1: + start_solver=True + elif line.find('Station 2') > -1: # jump out of loop if we hit the next station + break + else: # Found the lines; parse the input + + if line.find('Chord') > -1: + raw_data = line.replace(",", "").split() + data.append(raw_data[1]) + found_chord = True + data.append(raw_data[5]) + found_radius = True + data.append(raw_data[8]) + found_toc = True + data.append(raw_data[10]) + found_aoa = True + + if found_chord and found_radius and found_toc and found_aoa: # Found what we're checking for + iter_missing = False + if not len(self.test_vals)==len(data): # something went wrong... probably bad input + print("Error in test_vals!") + passed = False + for j in range(len(data)): + sim_vals.append( float(data[j]) ) + delta_vals.append( abs(float(data[j])-self.test_vals[j]) ) + if delta_vals[j] > self.tol: + exceed_tol = True + passed = False + else: + iter_missing = True - if not start_solver: - passed = False + if not start_solver: + passed = False - if iter_missing: - passed = False + if iter_missing: + passed = False # Write the test results #for j in output: @@ -769,48 +770,49 @@ def run_def(self, with_tsan=False, with_asan=False): timed_out = True passed = False - # Examine the output - f = open(logfilename,'r') - output = f.readlines() - delta_vals = [] - sim_vals = [] - if not timed_out: - start_solver = False - for line in output: - if not start_solver: # Don't bother parsing anything before -- Volumetric grid deformation --- - if line.find('Volumetric grid deformation') > -1: - start_solver=True - else: # Found the -- Volumetric grid deformation --- line; parse the input - raw_data = line.split() - try: - iter_number = int(raw_data[0]) - data = raw_data[len(raw_data)-1:] # Take the last column for comparison - except ValueError: - continue - except IndexError: - continue + if not with_tsan and not with_asan: # sanitizer findings result in non-zero return code, no need to examine the output + # Examine the output + f = open(logfilename,'r') + output = f.readlines() + delta_vals = [] + sim_vals = [] + if not timed_out: + start_solver = False + for line in output: + if not start_solver: # Don't bother parsing anything before -- Volumetric grid deformation --- + if line.find('Volumetric grid deformation') > -1: + start_solver=True + else: # Found the -- Volumetric grid deformation --- line; parse the input + raw_data = line.split() + try: + iter_number = int(raw_data[0]) + data = raw_data[len(raw_data)-1:] # Take the last column for comparison + except ValueError: + continue + except IndexError: + continue - if iter_number == self.test_iter: # Found the iteration number we're checking for - iter_missing = False - if not len(self.test_vals)==len(data): # something went wrong... probably bad input - print("Error in test_vals!") - passed = False - break - for j in range(len(data)): - sim_vals.append( float(data[j]) ) - delta_vals.append( abs(float(data[j])-self.test_vals[j]) ) - if delta_vals[j] > self.tol: - exceed_tol = True + if iter_number == self.test_iter: # Found the iteration number we're checking for + iter_missing = False + if not len(self.test_vals)==len(data): # something went wrong... probably bad input + print("Error in test_vals!") passed = False - break - else: - iter_missing = True + break + for j in range(len(data)): + sim_vals.append( float(data[j]) ) + delta_vals.append( abs(float(data[j])-self.test_vals[j]) ) + if delta_vals[j] > self.tol: + exceed_tol = True + passed = False + break + else: + iter_missing = True - if not start_solver: - passed = False + if not start_solver: + passed = False - if iter_missing: - passed = False + if iter_missing: + passed = False # Write the test results #for j in output: diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 9964395d837..ce5de549f41 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -1206,7 +1206,6 @@ def main(): naca0012_geo.command = TestCase.Command(exec = "SU2_GEO") naca0012_geo.timeout = 1600 naca0012_geo.tol = 0.00001 - naca0012_geo.enabled_with_asan = False pass_list.append(naca0012_geo.run_geo(args.tsan, args.asan)) test_list.append(naca0012_geo) @@ -1223,7 +1222,6 @@ def main(): intersect_def.command = TestCase.Command(exec = "SU2_DEF") intersect_def.timeout = 1600 intersect_def.tol = 1e-04 - intersect_def.enabled_with_asan = False pass_list.append(intersect_def.run_def(args.tsan, args.asan)) test_list.append(intersect_def) @@ -1237,7 +1235,6 @@ def main(): naca0012_def.command = TestCase.Command(exec = "SU2_DEF") naca0012_def.timeout = 1600 naca0012_def.tol = 1e-08 - naca0012_def.enabled_with_asan = False pass_list.append(naca0012_def.run_def(args.tsan, args.asan)) test_list.append(naca0012_def) @@ -1251,7 +1248,6 @@ def main(): naca0012_def_file.command = TestCase.Command(exec = "SU2_DEF") naca0012_def_file.timeout = 1600 naca0012_def_file.tol = 1e-8 - naca0012_def_file.enabled_with_asan = False pass_list.append(naca0012_def_file.run_def(args.tsan, args.asan)) test_list.append(naca0012_def_file) @@ -1265,7 +1261,6 @@ def main(): rae2822_def.command = TestCase.Command(exec = "SU2_DEF") rae2822_def.timeout = 1600 rae2822_def.tol = 1e-13 - rae2822_def.enabled_with_asan = False pass_list.append(rae2822_def.run_def(args.tsan, args.asan)) test_list.append(rae2822_def) @@ -1279,7 +1274,6 @@ def main(): naca4412_def.command = TestCase.Command(exec = "SU2_DEF") naca4412_def.timeout = 1600 naca4412_def.tol = 1e-12 - naca4412_def.enabled_with_asan = False pass_list.append(naca4412_def.run_def(args.tsan, args.asan)) test_list.append(naca4412_def) @@ -1293,7 +1287,6 @@ def main(): brick_tets_def.command = TestCase.Command(exec = "SU2_DEF") brick_tets_def.timeout = 1600 brick_tets_def.tol = 1e-09 - brick_tets_def.enabled_with_asan = False pass_list.append(brick_tets_def.run_def(args.tsan, args.asan)) test_list.append(brick_tets_def) @@ -1307,7 +1300,6 @@ def main(): brick_hex_def.command = TestCase.Command(exec = "SU2_DEF") brick_hex_def.timeout = 1600 brick_hex_def.tol = 1e-09 - brick_hex_def.enabled_with_asan = False pass_list.append(brick_hex_def.run_def(args.tsan, args.asan)) test_list.append(brick_hex_def) @@ -1321,7 +1313,6 @@ def main(): brick_pyra_def.command = TestCase.Command(exec = "SU2_DEF") brick_pyra_def.timeout = 1600 brick_pyra_def.tol = 1e-08 - brick_pyra_def.enabled_with_asan = False pass_list.append(brick_pyra_def.run_def(args.tsan, args.asan)) test_list.append(brick_pyra_def) @@ -1335,7 +1326,6 @@ def main(): brick_prism_def.command = TestCase.Command(exec = "SU2_DEF") brick_prism_def.timeout = 1600 brick_prism_def.tol = 1e-08 - brick_prism_def.enabled_with_asan = False pass_list.append(brick_prism_def.run_def(args.tsan, args.asan)) test_list.append(brick_prism_def) @@ -1349,7 +1339,6 @@ def main(): brick_prism_rans_def.command = TestCase.Command(exec = "SU2_DEF") brick_prism_rans_def.timeout = 1600 brick_prism_rans_def.tol = 1e-12 - brick_prism_rans_def.enabled_with_asan = False pass_list.append(brick_prism_rans_def.run_def(args.tsan, args.asan)) test_list.append(brick_prism_rans_def) @@ -1363,7 +1352,6 @@ def main(): brick_hex_rans_def.command = TestCase.Command(exec = "SU2_DEF") brick_hex_rans_def.timeout = 1600 brick_hex_rans_def.tol = 1e-12 - brick_hex_rans_def.enabled_with_asan = False pass_list.append(brick_hex_rans_def.run_def(args.tsan, args.asan)) test_list.append(brick_hex_rans_def) @@ -1377,7 +1365,6 @@ def main(): cylinder_ffd_def.command = TestCase.Command(exec = "SU2_DEF") cylinder_ffd_def.timeout = 1600 cylinder_ffd_def.tol = 1e-09 - cylinder_ffd_def.enabled_with_asan = False pass_list.append(cylinder_ffd_def.run_def(args.tsan, args.asan)) test_list.append(cylinder_ffd_def) @@ -1391,7 +1378,6 @@ def main(): sphere_ffd_def.command = TestCase.Command(exec = "SU2_DEF") sphere_ffd_def.timeout = 1600 sphere_ffd_def.tol = 1e-08 - sphere_ffd_def.enabled_with_asan = False pass_list.append(sphere_ffd_def.run_def(args.tsan, args.asan)) test_list.append(sphere_ffd_def) @@ -1405,7 +1391,6 @@ def main(): sphere_ffd_def_bspline.command = TestCase.Command(exec = "SU2_DEF") sphere_ffd_def_bspline.timeout = 1600 sphere_ffd_def_bspline.tol = 1e-08 - sphere_ffd_def_bspline.enabled_with_asan = False pass_list.append(sphere_ffd_def_bspline.run_def(args.tsan, args.asan)) test_list.append(sphere_ffd_def_bspline) From 38b6658f4292690219b474f14bb2643a4afc8505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 2 Apr 2024 11:15:05 +0200 Subject: [PATCH 13/22] Fixes in run_geo and run_def. --- TestCases/TestCase.py | 60 ++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/TestCases/TestCase.py b/TestCases/TestCase.py index 334be29bb01..0818c6074a0 100644 --- a/TestCases/TestCase.py +++ b/TestCases/TestCase.py @@ -642,12 +642,18 @@ def run_geo(self, with_tsan=False, with_asan=False): timed_out = True passed = False + # check for non-zero return code + process.communicate() + if process.returncode != 0: + passed = False + + delta_vals = [] + sim_vals = [] + if not with_tsan and not with_asan: # sanitizer findings result in non-zero return code, no need to examine the output # Examine the output f = open(logfilename,'r') output = f.readlines() - delta_vals = [] - sim_vals = [] data = [] if not timed_out: start_solver = False @@ -706,20 +712,21 @@ def run_geo(self, with_tsan=False, with_asan=False): if timed_out: print('ERROR: Execution timed out. timeout=%d'%self.timeout) - if exceed_tol: - print('ERROR: Difference between computed input and test_vals exceeded tolerance. TOL=%f'%self.tol) + if not with_tsan and not with_asan: + if exceed_tol: + print('ERROR: Difference between computed input and test_vals exceeded tolerance. TOL=%f'%self.tol) - if not start_solver: - print('ERROR: The code was not able to get to the "OBJFUN" section.') + if not start_solver: + print('ERROR: The code was not able to get to the "OBJFUN" section.') - if iter_missing: - print('ERROR: The SU2_GEO values could not be found.') + if iter_missing: + print('ERROR: The SU2_GEO values could not be found.') - print_vals(self.test_vals, name="test_vals (stored)") + print_vals(self.test_vals, name="test_vals (stored)") - print_vals(sim_vals, name="sim_vals (computed)") + print_vals(sim_vals, name="sim_vals (computed)") - print_vals(delta_vals, name="delta_vals") + print_vals(delta_vals, name="delta_vals") print('test duration: %.2f min'%(running_time/60.0)) print('==================== End Test: %s ====================\n'%self.tag) @@ -770,12 +777,18 @@ def run_def(self, with_tsan=False, with_asan=False): timed_out = True passed = False + # check for non-zero return code + process.communicate() + if process.returncode != 0: + passed = False + + delta_vals = [] + sim_vals = [] + if not with_tsan and not with_asan: # sanitizer findings result in non-zero return code, no need to examine the output # Examine the output f = open(logfilename,'r') output = f.readlines() - delta_vals = [] - sim_vals = [] if not timed_out: start_solver = False for line in output: @@ -830,22 +843,23 @@ def run_def(self, with_tsan=False, with_asan=False): if timed_out: print('ERROR: Execution timed out. timeout=%d sec'%self.timeout) - if exceed_tol: - print('ERROR: Difference between computed input and test_vals exceeded tolerance. TOL=%e'%self.tol) + if not with_tsan and not with_asan: + if exceed_tol: + print('ERROR: Difference between computed input and test_vals exceeded tolerance. TOL=%e'%self.tol) - if not start_solver: - print('ERROR: The code was not able to get to the "Begin solver" section.') + if not start_solver: + print('ERROR: The code was not able to get to the "Begin solver" section.') - if iter_missing: - print('ERROR: The iteration number %d could not be found.'%self.test_iter) + if iter_missing: + print('ERROR: The iteration number %d could not be found.'%self.test_iter) - print('test_iter=%d' % self.test_iter) + print('test_iter=%d' % self.test_iter) - print_vals(self.test_vals, name="test_vals (stored)") + print_vals(self.test_vals, name="test_vals (stored)") - print_vals(sim_vals, name="sim_vals (computed)") + print_vals(sim_vals, name="sim_vals (computed)") - print_vals(delta_vals, name="delta_vals") + print_vals(delta_vals, name="delta_vals") print('test duration: %.2f min'%(running_time/60.0)) #print('==================== End Test: %s ====================\n'%self.tag) From 4ce1448e2406dc7a04092c8b630bcdae435faab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 2 Apr 2024 18:31:19 +0200 Subject: [PATCH 14/22] Fix mismatched allocation/deallocation. --- SU2_GEO/src/SU2_GEO.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_GEO/src/SU2_GEO.cpp b/SU2_GEO/src/SU2_GEO.cpp index 86b9ee5c6e0..cc8b3193c32 100644 --- a/SU2_GEO/src/SU2_GEO.cpp +++ b/SU2_GEO/src/SU2_GEO.cpp @@ -1435,8 +1435,8 @@ int main(int argc, char* argv[]) { delete[] Gradient; for (iPlane = 0; iPlane < nPlane; iPlane++) { - delete Plane_P0[iPlane]; - delete Plane_Normal[iPlane]; + delete[] Plane_P0[iPlane]; + delete[] Plane_Normal[iPlane]; } delete[] Plane_P0; delete[] Plane_Normal; From cf1fab86fc485ebc24e01f60bafc0d072cd1e789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 2 Apr 2024 18:56:56 +0200 Subject: [PATCH 15/22] Fix missing deallocation. --- SU2_GEO/src/SU2_GEO.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/SU2_GEO/src/SU2_GEO.cpp b/SU2_GEO/src/SU2_GEO.cpp index cc8b3193c32..4e1d3bad9fe 100644 --- a/SU2_GEO/src/SU2_GEO.cpp +++ b/SU2_GEO/src/SU2_GEO.cpp @@ -1429,6 +1429,7 @@ int main(int argc, char* argv[]) { delete[] Xcoord_Airfoil; delete[] Ycoord_Airfoil; delete[] Zcoord_Airfoil; + delete[] Variable_Airfoil; delete[] ObjectiveFunc; delete[] ObjectiveFunc_New; From 9651460281a880491959e7cece4c37d1994c1774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Wed, 3 Apr 2024 10:31:35 +0200 Subject: [PATCH 16/22] Fix memory leak of CFreeFormDefBox::BlendingFunction[2]. --- Common/src/grid_movement/CFreeFormDefBox.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Common/src/grid_movement/CFreeFormDefBox.cpp b/Common/src/grid_movement/CFreeFormDefBox.cpp index 78e4b384c9f..6cfd9cc8c85 100644 --- a/Common/src/grid_movement/CFreeFormDefBox.cpp +++ b/Common/src/grid_movement/CFreeFormDefBox.cpp @@ -144,7 +144,8 @@ CFreeFormDefBox::~CFreeFormDefBox() { for (iCornerPoints = 0; iCornerPoints < nCornerPoints; iCornerPoints++) delete[] Coord_Corner_Points[iCornerPoints]; delete[] Coord_Corner_Points; - for (iDim = 0; iDim < nDim; iDim++) { + /*--- nDim is 3 at allocation but might change later, so we used fixed 3 as upper bound for deallocation ---*/ + for (iDim = 0; iDim < 3; iDim++) { delete BlendingFunction[iDim]; } delete[] BlendingFunction; From 7ad81fb70c592454af074a00d9916f39b6f347d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Wed, 3 Apr 2024 10:34:55 +0200 Subject: [PATCH 17/22] Fix reallocation without freeing and memory leak at exit of CSurfaceMovement::FFDBox. --- Common/src/grid_movement/CSurfaceMovement.cpp | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/Common/src/grid_movement/CSurfaceMovement.cpp b/Common/src/grid_movement/CSurfaceMovement.cpp index 59b0cf7bfe8..9b21d64f2c9 100644 --- a/Common/src/grid_movement/CSurfaceMovement.cpp +++ b/Common/src/grid_movement/CSurfaceMovement.cpp @@ -33,12 +33,21 @@ CSurfaceMovement::CSurfaceMovement() : CGridMovement() { size = SU2_MPI::GetSize(); rank = SU2_MPI::GetRank(); + FFDBox = nullptr; nFFDBox = 0; nLevel = 0; FFDBoxDefinition = false; } -CSurfaceMovement::~CSurfaceMovement() = default; +CSurfaceMovement::~CSurfaceMovement() { + if (FFDBox != nullptr) { + for (unsigned int iFFDBox = 0; iFFDBox < MAX_NUMBER_FFD; ++iFFDBox) { + if (FFDBox[iFFDBox] != nullptr) delete FFDBox[iFFDBox]; + } + delete[] FFDBox; + FFDBox = nullptr; + } +}; vector > CSurfaceMovement::SetSurface_Deformation(CGeometry* geometry, CConfig* config) { unsigned short iFFDBox, iDV, iLevel, iChild, iParent, jFFDBox, iMarker; @@ -60,7 +69,16 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry* g if (config->GetDesign_Variable(0) == FFD_SETTING) { /*--- Definition of the FFD deformation class ---*/ - FFDBox = new CFreeFormDefBox*[MAX_NUMBER_FFD]; + /*--- As this method might be called multiple times, properly delete old objects before allocating new ones. ---*/ + if (FFDBox != nullptr) { + for (unsigned int iFFDBox = 0; iFFDBox < MAX_NUMBER_FFD; ++iFFDBox) { + if (FFDBox[iFFDBox] != nullptr) delete FFDBox[iFFDBox]; + } + delete[] FFDBox; + FFDBox = nullptr; + } + + FFDBox = new CFreeFormDefBox*[MAX_NUMBER_FFD](); /*--- Read the FFD information from the config file ---*/ @@ -167,7 +185,16 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry* g (config->GetDesign_Variable(0) == FFD_THICKNESS) || (config->GetDesign_Variable(0) == FFD_ANGLE_OF_ATTACK)) { /*--- Definition of the FFD deformation class ---*/ - FFDBox = new CFreeFormDefBox*[MAX_NUMBER_FFD]; + /*--- As this method might be called multiple times, properly delete old objects before allocating new ones. ---*/ + if (FFDBox != nullptr) { + for (unsigned int iFFDBox = 0; iFFDBox < MAX_NUMBER_FFD; ++iFFDBox) { + if (FFDBox[iFFDBox] != nullptr) delete FFDBox[iFFDBox]; + } + delete[] FFDBox; + FFDBox = nullptr; + } + + FFDBox = new CFreeFormDefBox*[MAX_NUMBER_FFD](); /*--- Read the FFD information from the grid file ---*/ From 41256dcda5ede6a12c89b7e8643d2194a51ee892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Wed, 3 Apr 2024 11:14:26 +0200 Subject: [PATCH 18/22] Fix semicolon and variable hiding. --- Common/src/grid_movement/CSurfaceMovement.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Common/src/grid_movement/CSurfaceMovement.cpp b/Common/src/grid_movement/CSurfaceMovement.cpp index 9b21d64f2c9..5c29534fb39 100644 --- a/Common/src/grid_movement/CSurfaceMovement.cpp +++ b/Common/src/grid_movement/CSurfaceMovement.cpp @@ -47,7 +47,7 @@ CSurfaceMovement::~CSurfaceMovement() { delete[] FFDBox; FFDBox = nullptr; } -}; +} vector > CSurfaceMovement::SetSurface_Deformation(CGeometry* geometry, CConfig* config) { unsigned short iFFDBox, iDV, iLevel, iChild, iParent, jFFDBox, iMarker; @@ -71,7 +71,7 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry* g /*--- As this method might be called multiple times, properly delete old objects before allocating new ones. ---*/ if (FFDBox != nullptr) { - for (unsigned int iFFDBox = 0; iFFDBox < MAX_NUMBER_FFD; ++iFFDBox) { + for (iFFDBox = 0; iFFDBox < MAX_NUMBER_FFD; ++iFFDBox) { if (FFDBox[iFFDBox] != nullptr) delete FFDBox[iFFDBox]; } delete[] FFDBox; @@ -187,7 +187,7 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry* g /*--- As this method might be called multiple times, properly delete old objects before allocating new ones. ---*/ if (FFDBox != nullptr) { - for (unsigned int iFFDBox = 0; iFFDBox < MAX_NUMBER_FFD; ++iFFDBox) { + for (iFFDBox = 0; iFFDBox < MAX_NUMBER_FFD; ++iFFDBox) { if (FFDBox[iFFDBox] != nullptr) delete FFDBox[iFFDBox]; } delete[] FFDBox; From c97610b02bc1281eb766847e7ef5ed7ac451dfb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Wed, 3 Apr 2024 14:50:32 +0200 Subject: [PATCH 19/22] Explore fix for heap buffer overflow in CInterface. --- SU2_CFD/src/interfaces/CInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/interfaces/CInterface.cpp b/SU2_CFD/src/interfaces/CInterface.cpp index 050c948bc1f..20e2b2332a4 100644 --- a/SU2_CFD/src/interfaces/CInterface.cpp +++ b/SU2_CFD/src/interfaces/CInterface.cpp @@ -286,7 +286,7 @@ void CInterface::PreprocessAverage(CGeometry *donor_geometry, CGeometry *target_ for(iSpan = 1; iSpan SpanValuesDonor[jSpan]){ From afad3acf5d96e0ed7a3df1fbcaf7443e688b56c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Wed, 10 Apr 2024 16:25:40 +0200 Subject: [PATCH 20/22] Fix comparison. --- SU2_CFD/src/drivers/CDriver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index 6c1a6170a04..8476c58dc54 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -2389,7 +2389,7 @@ void CDriver::PreprocessDynamicMesh(CConfig *config, CGeometry **geometry, CSolv cout << "Setting dynamic mesh structure for zone "<< iZone + 1<<"." << endl; grid_movement = new CVolumetricMovement(geometry[MESH_0], config); - if (surface_movement != nullptr) + if (surface_movement == nullptr) surface_movement = new CSurfaceMovement(); surface_movement->CopyBoundary(geometry[MESH_0], config); From aa2787b4437a10e917253020b007f9763ebd984f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Wed, 8 May 2024 10:35:12 +0200 Subject: [PATCH 21/22] Revert "Explore fix for heap buffer overflow in CInterface." This reverts commit c97610b02bc1281eb766847e7ef5ed7ac451dfb9. --- SU2_CFD/src/interfaces/CInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/interfaces/CInterface.cpp b/SU2_CFD/src/interfaces/CInterface.cpp index 20e2b2332a4..050c948bc1f 100644 --- a/SU2_CFD/src/interfaces/CInterface.cpp +++ b/SU2_CFD/src/interfaces/CInterface.cpp @@ -286,7 +286,7 @@ void CInterface::PreprocessAverage(CGeometry *donor_geometry, CGeometry *target_ for(iSpan = 1; iSpan SpanValuesDonor[jSpan]){ From 0f3fc3ec900f1518c0c3ed26c3e971ae27fb974c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Wed, 8 May 2024 10:39:15 +0200 Subject: [PATCH 22/22] Disable address sanitizer runs of the Aachen turbine test. --- TestCases/parallel_regression.py | 1 + TestCases/serial_regression.py | 1 + 2 files changed, 2 insertions(+) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index b891e7d9a84..f8403488070 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1058,6 +1058,7 @@ def main(): Aachen_3D_restart.cfg_dir = "turbomachinery/Aachen_turbine" Aachen_3D_restart.cfg_file = "aachen_3D_MP_restart.cfg" Aachen_3D_restart.test_iter = 5 + Aachen_3D_restart.enabled_with_asan = False Aachen_3D_restart.test_vals = [-15.329206, -15.008622, -15.078888, -13.841072, -12.727840, -9.975729] test_list.append(Aachen_3D_restart) diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index b0cb0c4ae7b..f7ab332ae7a 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -860,6 +860,7 @@ def main(): Aachen_3D_restart.cfg_dir = "turbomachinery/Aachen_turbine" Aachen_3D_restart.cfg_file = "aachen_3D_MP_restart.cfg" Aachen_3D_restart.test_iter = 5 + Aachen_3D_restart.enabled_with_asan = False Aachen_3D_restart.test_vals = [-15.137167, -14.551444, -15.078894, -13.486154, -12.724891, -9.717612] test_list.append(Aachen_3D_restart)