Dynamic Analysis with Clang building python make unittest failed
Open
Nobody has claimed this yet.
needs: decision
topic-building python
topic-test
type-feature
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 1k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 12
Description
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)
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 locating the Python unittest sanitizer check that reads sysconfig CFLAGS and CONFIG_ARGS. Compare it with the listed configure options for AddressSanitizer, MemorySanitizer, and UndefinedBehaviorSanitizer, then run the make unittest check to confirm sanitizer detection works with those options.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100