devguide icon indicating copy to clipboard operation
devguide copied to clipboard

Dynamic Analysis with Clang building python make unittest failed

Open JunyiXie opened this issue 4 years ago • 0 comments

截屏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)

JunyiXie avatar Sep 14 '21 13:09 JunyiXie