python / python/cpython

`=no` values for sanitizer configure options still enable sanitizer flags

Open
#157,354 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:
Summary

Passing no to a sanitizer option is reported as disabled, but the option's action still adds sanitizer compiler and linker flags. For AddressSanitizer, it also disables pymalloc.

Reproduction
mkdir build
cd build

../configure --with-address-sanitizer=no
grep -E '^(BASECFLAGS|LDFLAGS)=' Makefile
grep WITH_PYMALLOC pyconfig.h
Actual Behavior

Configure reports:

checking for --with-address-sanitizer... no
checking for --with-pymalloc... no

Despite that output, the AddressSanitizer action adds -fsanitize=address to BASECFLAGS and LDFLAGS, and sets with_pymalloc=no.

Expected Behavior

--with-address-sanitizer=no should not enable AddressSanitizer flags and should not change the pymalloc setting. It should have the same result as omitting the option or using the corresponding --without-... form.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs
  • gh-157355

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided configure reproduction on the CPython main branch and inspect the sanitizer configure-option handling that adds BASECFLAGS, LDFLAGS, and changes with_pymalloc. Done means passing --with-address-sanitizer=no leaves sanitizer flags and the pymalloc setting unchanged, matching an omitted option or corresponding --without form.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.