Skip to content

Memory leak in test_capi with subinterpreter creation #140301

@ashm-dev

Description

@ashm-dev

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions