Recommendations for which sanitizers to enable
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 110
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
As time passes, the g++/clang++ gain more new sanitizers, existing ones get better, and some get ported to new platforms (e.g. recently leak support was added to OS X in clang++ 5).
Similar to #37 for warnings, This ticket can serve as a central place to start documenting a recommended list of sanitizer flags to use. I intend this to be a quick, opinionated reference to check before you would dive deeper into docs like https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html.
The relevant questions I see are:
- 🍇 Which sanitizers should we always test with?
- 🍊 Which additional flags or environment variables should we use?
- 🍏 Which additional flags should be used when testing the sanitizers on CI systems?
- 🍎 Which additional flags should be used when building sanitized binaries for live testing?
Refs:
- source of truth for which sanitizers are in which groupings:
- 4.x: https://github.com/llvm-mirror/clang/blob/release_40/include/clang/Basic/Sanitizers.def
- 5.x: https://github.com/llvm-mirror/clang/blob/release_50/include/clang/Basic/Sanitizers.def
- master: https://github.com/llvm-mirror/clang/blob/master/include/clang/Basic/Sanitizers.def
- Docs for HEAD llvm for sanitizers:
- Address: https://clang.llvm.org/docs/AddressSanitizer.html
- Thread: https://clang.llvm.org/docs/ThreadSanitizer.html
- Memory: https://clang.llvm.org/docs/MemorySanitizer.html
- UndefinedBehavior: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
- DataFlow: https://clang.llvm.org/docs/DataFlowSanitizer.html
- Leak: https://clang.llvm.org/docs/LeakSanitizer.html
- Control Flow Integrity: https://clang.llvm.org/docs/ControlFlowIntegrity.html
- Safe Stack: https://clang.llvm.org/docs/SafeStack.html
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the sanitizer groupings in the referenced Sanitizers.def files with the AddressSanitizer, ThreadSanitizer, MemorySanitizer, UndefinedBehaviorSanitizer, DataFlowSanitizer, LeakSanitizer, Control Flow Integrity, and Safe Stack documentation. Clarify recommendations for always-on testing, CI, and live-testing builds, including relevant flags, environment variables, and platform limits. Done means the issue contains a concise, opinionated reference covering those questions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation, testing-qa
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100