Skip to content

Commit 842f2b2

Browse files
authored
use the latest clang and -O2 for sanitizer jobs (#3775)
1 parent 5ef3a41 commit 842f2b2

2 files changed

Lines changed: 31 additions & 13 deletions

File tree

.github/workflows/asan.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,45 @@ jobs:
99

1010
runs-on: ubuntu-20.04
1111

12+
container:
13+
image: "ubuntu:21.10"
14+
1215
env:
1316
ASAN_OPTIONS: detect_stack_use_after_return=1
1417

1518
steps:
1619
- uses: actions/checkout@v2
1720

21+
- name: Set up Python 3.10
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: '3.10'
25+
1826
- name: Install missing software on ubuntu
1927
run: |
20-
sudo apt-get update
21-
sudo apt-get install libz3-4 libz3-dev
28+
apt-get update
29+
apt-get install -y make libz3-dev libpcre3-dev
30+
apt-get install -y clang-13
2231
2332
- name: Build
2433
run: make -j$(nproc) cppcheck testrunner USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes VERIFY=1
2534
env:
26-
CC: clang
27-
CXX: clang++
28-
CXXFLAGS: "-fsanitize=address -O1 -g3 -DCPPCHK_GLIBCXX_DEBUG"
35+
CC: clang-13
36+
CXX: clang++-13
37+
CXXFLAGS: "-fsanitize=address -O2 -g3 -DCPPCHK_GLIBCXX_DEBUG"
2938
CPPFLAGS: "-DCHECK_INTERNAL"
3039

3140
- name: Run tests
3241
run: ./testrunner
3342

34-
# Does not work
43+
# TODO: re-enable - was being killed because of incresaed memory usage
3544
# - name: Self check
3645
# run: |
3746
# ./cppcheck -q -j$(nproc) --std=c++11 --template=selfcheck -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ -Icli --inconclusive --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings cli lib
3847
# ./cppcheck -q -j$(nproc) --std=c++11 --template=selfcheck -D__CPPCHECK__ -DQT_VERSION=0x050000 --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=qt -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings gui/*.cpp
3948
# ./cppcheck -q -j$(nproc) --std=c++11 --template=selfcheck -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ -Icli -Igui --inconclusive --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings test/*.cpp tools
4049

41-
# This takes too long time right now
50+
# TODO: This does takes too long to run
4251
# - name: Bughunting lib
4352
# run: ./cppcheck -D__CPPCHECK__ --bug-hunting -j$(nproc) lib
4453

.github/workflows/ubsan.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,32 @@ jobs:
99

1010
runs-on: ubuntu-20.04
1111

12+
container:
13+
image: "ubuntu:21.10"
14+
1215
env:
1316
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
1417

1518
steps:
1619
- uses: actions/checkout@v2
1720

21+
- name: Set up Python 3.10
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: '3.10'
25+
1826
- name: Install missing software on ubuntu
1927
run: |
20-
sudo apt-get update
21-
sudo apt-get install libz3-4 libz3-dev
28+
apt-get update
29+
apt-get install -y make libz3-dev libpcre3-dev
30+
apt-get install -y clang-13
2231
2332
- name: Build
2433
run: make -j$(nproc) cppcheck testrunner USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes VERIFY=1
2534
env:
26-
CC: clang
27-
CXX: clang++
28-
CXXFLAGS: "-fsanitize=undefined -fsanitize=nullability -fno-sanitize=signed-integer-overflow -O1 -g3 -DCPPCHK_GLIBCXX_DEBUG"
35+
CC: clang-13
36+
CXX: clang++-13
37+
CXXFLAGS: "-fsanitize=undefined -fsanitize=nullability -fno-sanitize=signed-integer-overflow -O2 -g3 -DCPPCHK_GLIBCXX_DEBUG"
2938
CPPFLAGS: "-DCHECK_INTERNAL"
3039

3140
- name: Run tests
@@ -37,7 +46,7 @@ jobs:
3746
./cppcheck -q -j$(nproc) --std=c++11 --template=selfcheck -D__CPPCHECK__ -DQT_VERSION=0x050000 --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=qt -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings gui/*.cpp
3847
./cppcheck -q -j$(nproc) --std=c++11 --template=selfcheck -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ -Icli -Igui --inconclusive --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings test/*.cpp tools
3948
40-
# This takes too long time right now
49+
# TODO: This does takes too long to run
4150
# - name: Bughunting lib
4251
# run: ./cppcheck -D__CPPCHECK__ --bug-hunting -j$(nproc) lib
4352

0 commit comments

Comments
 (0)