openPMD / openPMD/openPMD-api

CI: UndefinedBehaviorSanitizer

Open
#452 0 comments 0 reactions 0 assignees View on GitHub
continuous integration
Dominant language
C++
Stars
161
Forks
59
Avg merge
2d 22h
Merged PRs (30d)
7

Description

We already run the CI with AddressSanitizers but should also run an entry with [UndefinedBehaviorSanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html).

Also, if we [suppress]() some of the memory leaks in dependencies we might be able to check more backends in AddressSanitizer.

Check all but memory leaks: `-fsantize=address` with export:
```
export ASAN_OPTIONS=detect_stack_use_after_return=1:detect_leaks=0:check_initialization_order=true:strict_init_order=true:detect_stack_use_after_scope=1
```

We can also activate the python backend for address sanitizer checks, as long as we export the `LD_PRELOAD` path to the falsely hidden `asan` symbols: #479

For MPI-parallel checks, we might be able to write a [suppression file](https://releases.llvm.org/7.0.0/tools/clang/docs/AddressSanitizer.html#suppressing-reports-in-external-libraries), excluding the whole external lib.

Refs:
(clang ubsan) https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
(gcc ubsan) https://developers.redhat.com/blog/2014/10/16/gcc-undefined-behavior-sanitizer-ubsan/
https://github.com/google/sanitizers/wiki/AddressSanitizer
https://github.com/google/sanitizers/wiki/AddressSanitizerExampleUseAfterReturn

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.