GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Memory leak in test_capi with subinterpreter creation · Issue #140301 · python/cpython

Memory leak in test_capi with subinterpreter creation #140301

New issue
Copy link
New issue
Copy link
Closed
Closed
Memory leak in test_capi with subinterpreter creation#140301
Copy link
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-C-APItopic-subinterpreterstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@ashm-dev
ashm-dev
opened on Oct 18, 2025
Issue body actions

Bug report

Bug description:

LeakSanitizer detects memory leaks when running test_capi with refleak detection. The leaks occur during subinterpreter creation via Py_NewInterpreterFromConfig().

Affected Versions

  • Python 3.12
  • Python 3.13
  • Python 3.14
  • CPython main branch

Steps to Reproduce

  1. Build CPython with AddressSanitizer and debug mode:
CC=clang CXX=clang++ ./configure --with-address-sanitizer --with-pydebug --with-undefined-behavior-sanitizer --disable-optimizations && make -j$(nproc)
  1. Run test_capi with refleak detection:
./python -X dev -X showrefcount -m test -R 5:5 test_capi -j$(nproc)

Logs

312.log
313.log
314.log
main.log

CPython versions tested on:

3.15, CPython main branch, 3.14, 3.13, 3.12

Operating systems tested on:

Linux

Linked PRs

  • gh-140301: Fix memory leak in subinterpreter PyConfig cleanup #140303
  • [3.14] gh-140301: Fix memory leak in subinterpreter PyConfig cleanup (GH-140303) #140360
  • [3.13] gh-140301: Fix memory leak in subinterpreter PyConfig cleanup (GH-140303) #140684

Activity

  1. ashm-dev
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Oct 18, 2025
  2. StanFromIreland
    added
    performancePerformance or resource usagePerformance or resource usage
    testsTests in the Lib/test dirTests in the Lib/test dir
    topic-C-API
    on Oct 18, 2025
  3. ZeroIntensity
    removed
    performancePerformance or resource usagePerformance or resource usage
    on Oct 18, 2025
  4. ZeroIntensity commented on Oct 18, 2025

    @ZeroIntensity
    ZeroIntensity
    on Oct 18, 2025
    Member
    More actions

    In the future, would you mind including locations (preferably a GitHub source link) in your reports? It's extra work for us when you just drop large log files.

    Reacted by Shamil
  5. ZeroIntensity
    added
    topic-subinterpreters
    on Oct 18, 2025
  6. github-project-automation
    moved this to Todo in Subinterpreterson Oct 18, 2025
  7. github-project-automation
    added this to Subinterpreterson Oct 18, 2025
  8. ashm-dev commented on Oct 18, 2025

    @ashm-dev
    ashm-dev
    on Oct 18, 2025
    ContributorAuthor
    More actions

    Sure, I'll include GitHub source links in future reports. Thanks for the feedback!

  9. ashm-dev commented on Oct 18, 2025

    @ashm-dev
    ashm-dev
    on Oct 18, 2025
    ContributorAuthor
    More actions

    I'll take a shot at fixing this, but no promises :)

  10. ashm-dev
    added a commit that references this issue on Oct 18, 2025

    pythongh-140301: Fix memory leak in subinterpreter PyConfig cleanup

    4adb87e
  11. kumaraditya303
    added a commit that references this issue on Oct 20, 2025

    gh-140301: Fix memory leak in subinterpreter `PyConfig` cleanup (#140303

    a615fb4
  12. miss-islington
    added a commit that references this issue on Oct 20, 2025

    pythongh-140301: Fix memory leak in subinterpreter `PyConfig` cleanup (…

    9d293ea
  13. kumaraditya303
    closed this as completedon Oct 20, 2025
  14. github-project-automation
    moved this from Todo to Done in Subinterpreterson Oct 20, 2025
  15. kumaraditya303
    added a commit that references this issue on Oct 20, 2025

    [3.14] gh-140301: Fix memory leak in subinterpreter `PyConfig` cleanup (

    d7fe4e9
  16. ashm-dev
    added 3 commits that reference this issue on Oct 27, 2025

    pythongh-140301: Fix memory leak in subinterpreter `PyConfig` cleanup (…

    c38ad5e

    [3.13] pythongh-140301: Fix memory leak in subinterpreter PyConfig cl…

    affa9be

    [3.13] pythongh-140301: Fix memory leak in subinterpreter `PyConfig` …

    6adce9a
  17. kumaraditya303
    added a commit that references this issue on Oct 27, 2025

    [3.13] gh-140301: Fix memory leak in subinterpreter PyConfig cleanup (G…

    fd6df66
  18. StanFromIreland
    added a commit that references this issue on Dec 6, 2025

    pythongh-140301: Fix memory leak in subinterpreter `PyConfig` cleanup (…

    459785b
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

    testsTests in the Lib/test dirTests in the Lib/test dirtopic-C-APItopic-subinterpreterstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    • Subinterpreters
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.