python / python/devguide

Dynamic Analysis with Clang building python make unittest failed

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

还没有人认领这个 Issue。

needs: decision topic-building python topic-test type-feature
主要语言
Python
星标
2.1k
派生
1k
平均合并
2 天 12 小时
30 天内合并 PR
12

描述

截屏2021-09-14 下午9 12 19

use this way to enable sanitizers make unittest check Sanitizer failed; it use _cflags to check

_cflags = sysconfig.get_config_var('CFLAGS') or ''
_config_args = sysconfig.get_config_var('CONFIG_ARGS') or ''
MEMORY_SANITIZER = (
    '-fsanitize=memory' in _cflags or
    '--with-memory-sanitizer' in _config_args
)

ADDRESS_SANITIZER = (
    '-fsanitize=address' in _cflags
)

should replace with configure option

  --with-address-sanitizer
                          enable AddressSanitizer memory error detector,
                          'asan' (default is no)
  --with-memory-sanitizer enable MemorySanitizer allocation error detector,
                          'msan' (default is no)
  --with-undefined-behavior-sanitizer
                          enable UndefinedBehaviorSanitizer undefined
                          behaviour detector, 'ubsan' (default is no)

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先定位读取 sysconfig CFLAGS 和 CONFIG_ARGS 的 Python unittest sanitizer 检查。将其与为 AddressSanitizer、MemorySanitizer 和 UndefinedBehaviorSanitizer 列出的 configure 选项进行比较,然后运行 make unittest check,以确认 sanitizer 检测在使用这些选项时能够正常工作。

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

评估

技术栈
python
领域
build-system, testing
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

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