Skip to content

Commit 494c311

Browse files
authored
GitLab CI workflow with sanitizers (#6746)
* Add the check workflow with sanitizers enabled * Run the sanitizer-enabled checks on GitLab CI * Update GLCI to use own container image * Make sure that the *Rout extractor runs too GitLab CI seems to run the jobs under `sh -e`, which terminates the step on first failure. Use || to capture the initial failures and fail for real later. * Use literal block style to keep newlines intact
1 parent fe8b3b1 commit 494c311

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.dev/lsan.supp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
leak:libfontconfig.so

.gitlab-ci.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,24 @@ test-lin-ancient-cran:
212212
# Restore checking vignettes if upgrading our R dependency means knitr can be installed.
213213
- R CMD check --no-manual --no-build-vignettes --ignore-vignettes $(ls -1t data.table_*.tar.gz | head -n 1)
214214

215+
# run the main checks with Address(+Leak),UBSanitizer enabled
216+
test-lin-san:
217+
<<: *test-lin
218+
image: registry.gitlab.com/rdatatable/dockerfiles/r-devel-clang-san
219+
variables:
220+
# must be set for most of the process because there are pseudo-leaks everywhere
221+
ASAN_OPTIONS: "detect_leaks=0"
222+
# fontconfig is known to leak; add more suppressions as discovered
223+
LSAN_OPTIONS: "suppressions=$CI_PROJECT_DIR/.dev/lsan.supp"
224+
UBSAN_OPTIONS: "print_stacktrace=1"
225+
script:
226+
- *install-deps
227+
- |
228+
res1=0; ASAN_OPTIONS=detect_leaks=1 R CMD check --no-manual $(ls -1t data.table_*.tar.gz | head -n 1) || res1=$?
229+
res2=0; perl -nle '(print, $a=1) if /: runtime error: |ERROR: LeakSanitizer/../SUMMARY.*Sanitizer/ }{ exit $a' data.table.Rcheck/**/*.Rout* || res2=$?
230+
# fail if R CMD check had failed or if sanitizer output found
231+
if [ $res1 -ne 0 ] || [ $res2 -ne 0 ]; then exit 1; fi
232+
215233
.test-win-template: &test-win
216234
<<: *test
217235
tags:
@@ -311,7 +329,7 @@ integration:
311329
- saas-linux-medium-amd64
312330
only:
313331
- master
314-
needs: ["mirror-packages","build","test-lin-rel","test-lin-rel-cran","test-lin-dev-gcc-strict-cran","test-lin-dev-clang-cran","test-lin-rel-vanilla","test-lin-ancient-cran","test-win-rel","test-win-dev" ,"test-win-old","test-mac-rel","test-mac-old"]
332+
needs: ["mirror-packages","build","test-lin-rel","test-lin-rel-cran","test-lin-dev-gcc-strict-cran","test-lin-dev-clang-cran","test-lin-rel-vanilla","test-lin-ancient-cran","test-lin-san","test-win-rel","test-win-dev" ,"test-win-old","test-mac-rel","test-mac-old"]
315333
script:
316334
- R --version
317335
- *install-deps ## markdown pkg not present in r-pkgdown image

0 commit comments

Comments
 (0)