From 05d4957f2e6a80dcf86f5341c4550419ee80ed13 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Sat, 9 Mar 2024 16:53:03 -0500 Subject: [PATCH 1/3] add CI for fsanitizer --- .github/workflows/fsanitizer.yml | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/fsanitizer.yml diff --git a/.github/workflows/fsanitizer.yml b/.github/workflows/fsanitizer.yml new file mode 100644 index 0000000000..7267a62488 --- /dev/null +++ b/.github/workflows/fsanitizer.yml @@ -0,0 +1,37 @@ +name: fsanitizer + +on: [push, pull_request] + +concurrency: + group: ${{ github.ref }}-${{ github.head_ref }}-fsanitizer + cancel-in-progress: true + +jobs: + fsanitizer: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Get submodules + run: | + git submodule update --init + cd external/Microphysics + git fetch; git checkout development + cd ../amrex + git fetch; git checkout development + cd ../.. + + - name: Install dependencies + run: | + sudo apt-get update -y -qq + sudo apt-get -qq -y install curl cmake jq clang g++>=9.3.0 + + - name: Compile subchandra + run: | + cd Exec/science/subchandra + make FSANITIZER=TRUE USE_MPI=FALSE -j 4 + + - name: Run subchandra + run: | + cd Exec/science/subchandra + ./Castro2d.gnu.SMPLSDC.ex inputs_2d.N14.coarse amr.max_level=1 max_step=1 amr.n_cell=320 640 From 70a2bc25429ac4080502894d4a527f7ea6a023f1 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Sat, 9 Mar 2024 17:14:41 -0500 Subject: [PATCH 2/3] intentionally add a bounds issue --- Exec/science/subchandra/problem_initialize_state_data.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Exec/science/subchandra/problem_initialize_state_data.H b/Exec/science/subchandra/problem_initialize_state_data.H index 289d0c9136..dfd70a1976 100644 --- a/Exec/science/subchandra/problem_initialize_state_data.H +++ b/Exec/science/subchandra/problem_initialize_state_data.H @@ -48,7 +48,7 @@ void problem_initialize_state_data (int i, int j, int k, burn_state.rho = state(i,j,k,URHO); burn_state.T = state(i,j,k,UTEMP); - for (int n = 0; n < NumSpec; n++) { + for (int n = 0; n <= NumSpec; n++) { burn_state.xn[n] = state(i,j,k,UFS+n); } From 6911f6dc0f2b644bf51d8739eda381528a6a1c20 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Sat, 9 Mar 2024 17:51:53 -0500 Subject: [PATCH 3/3] revert --- Exec/science/subchandra/problem_initialize_state_data.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Exec/science/subchandra/problem_initialize_state_data.H b/Exec/science/subchandra/problem_initialize_state_data.H index dfd70a1976..289d0c9136 100644 --- a/Exec/science/subchandra/problem_initialize_state_data.H +++ b/Exec/science/subchandra/problem_initialize_state_data.H @@ -48,7 +48,7 @@ void problem_initialize_state_data (int i, int j, int k, burn_state.rho = state(i,j,k,URHO); burn_state.T = state(i,j,k,UTEMP); - for (int n = 0; n <= NumSpec; n++) { + for (int n = 0; n < NumSpec; n++) { burn_state.xn[n] = state(i,j,k,UFS+n); }