FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

The configure script doesn't allow running ASan with PyMalloc · Issue #136872 · python/cpython · GitHub

Repository navigation

The configure script doesn't allow running ASan with PyMalloc #136872

Description

Bug report

Bug description:

The --with-address-sanitizer configure option overrides whatever pymalloc option one provides which it should not.

We should either allow it to work with --with-pymalloc, or, delete the line that disables pymalloc. I discussed it a bit during EP2025 sprint with @encukou .

This is done due to the line here:
https://github.com/python/cpython/blame/4a151cae3317ce133bdf0792fb1064c5030e588c/configure#L13352

I believe that CPython works fine with ASan + PyMalloc. I have tested it by removing the line above. Then the import _testcapi; _testcapi.WITH_PYMALLOC is True and there doesn't seem to be ASan crashes. However, there are leaks being detected, even when building Python, so I did all this with export ASAN_OPTIONS=detect_leaks=0.

It is also worth noting that we:

  1. List the --without-pymalloc flag in the devguide when showing how to run ASan.
  2. We mention there, that the flag is not necessary, but it makes ASan more effective.
  3. We mention in CPython docs that it makes sense to disable PyMalloc when running ASan here

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Activity

  1. encukou commented on Jul 20, 2025

    Member

    We mention in CPython docs that it makes sense to disable PyMalloc when running ASan here

    To be clear: we added that line recently. I trusted the devguide & didn't check the configure script.

    Disabling pymalloc by default in ASan/MSan builds makes sense, but, --with-pymalloc should override the default.

  2. vasiliyk commented on Sep 21, 2026

    Contributor

    I've opened the PR which keeps the default (pymalloc off in ASan/MSan builds) but lets an explicit --with-pymalloc override it, as suggested by @encukou.

  3. added 5 commits that reference this issue on Sep 22, 2026
  4. added a commit that references this issue on Oct 7, 2026
  5. encukou commented on Oct 7, 2026

    Member

    Thank you @vasiliyk for the fix.
    Keeping the issue open for a devguide update.

  6. encukou commented on Oct 8, 2026

    Member

    Tracked in python/devguide#746 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL