mapbox / mapbox/cpp

Recommendations for which sanitizers to enable

未关闭
#41 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
没有语言数据
星标
110
派生
17
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,将所引用的 Sanitizers.def 文件中的 sanitizer 分组与 AddressSanitizer、ThreadSanitizer、MemorySanitizer、UndefinedBehaviorSanitizer、DataFlowSanitizer、LeakSanitizer、Control Flow Integrity 和 Safe Stack 的文档进行比较。明确关于始终启用的测试、CI 和 live-testing 构建的建议,包括相关 flags、环境变量和平台限制。完成的标准是 issue 中包含一份简洁且观点明确的参考,涵盖这些问题。

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp
领域
documentation, testing-qa
Issue 类型
文档
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。