Skip to content

test_threading leaked [1, 1, 1] references: test_threads_join #82357

Closed

Description

@vstinner
BPO 38176
Nosy @vstinner, @DinoV
PRs
  • bpo-38176: Fix missing dec ref #16158
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/DinoV'
    closed_at = <Date 2019-09-15.14:52:17.172>
    created_at = <Date 2019-09-15.09:48:19.686>
    labels = ['library', '3.9']
    title = 'test_threading leaked [1, 1, 1] references: test_threads_join'
    updated_at = <Date 2019-09-16.08:07:17.255>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2019-09-16.08:07:17.255>
    actor = 'vstinner'
    assignee = 'dino.viehland'
    closed = True
    closed_date = <Date 2019-09-15.14:52:17.172>
    closer = 'dino.viehland'
    components = ['Library (Lib)']
    creation = <Date 2019-09-15.09:48:19.686>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38176
    keywords = ['patch']
    message_count = 3.0
    messages = ['352470', '352471', '352527']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'dino.viehland']
    pr_nums = ['16158']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue38176'
    versions = ['Python 3.9']

    Activity

    1. vstinner commented on Sep 15, 2019

      @vstinner
      MemberAuthor

      vstinner@apu$ ./python -m test -R 3:3 test_threading -m test.test_threading.SubinterpThreadingTests.test_threads_join
      Run tests sequentially
      0:00:00 load avg: 1.11 [1/1] test_threading
      beginning 6 repetitions
      123456
      ......
      test_threading leaked [1, 1, 1] references, sum=3
      test_threading failed

      == Tests result: FAILURE ==

      1 test failed:
      test_threading

      Total duration: 639 ms
      Tests result: FAILURE

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Sep 15, 2019
    3. vstinner commented on Sep 15, 2019

      @vstinner
      MemberAuthor

      The regression seems to be introduced by:

      commit 04f0bbf (HEAD, refs/bisect/bad)
      Author: Dino Viehland <dinoviehland@fb.com>
      Date: Fri Sep 13 11:12:27 2019 +0100

      bpo-38075: Port _randommodule.c to PEP-384 (GH-15798)
      
      - Migrate `Random_Type` to `PyType_FromSpec`
      - To simulate an old use of `PyLong_Type.tp_as_number->nb_absolute`, I added
        code to the module init function to stash `int.__abs__` for later
        use. Ideally we'd use `PyType_GetSlot()` instead, but it doesn't currently
        work for static types in CPython, and implementing it just for this case
        doesn't seem worth it.
      - Do exact check for long and dispatch to PyNumber_Absolute, use vector call when not exact.
      
    4. self-assigned this
      on Sep 15, 2019
    5. vstinner commented on Sep 16, 2019

      @vstinner
      MemberAuthor

      commit 09dc2c6
      Author: Dino Viehland <dinoviehland@gmail.com>
      Date: Sun Sep 15 15:51:44 2019 +0100

      Fix missing dec ref (bpo-16158)
      
      diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c
      index 8b0a0244bf..1ea2bf28ab 100644
      --- a/Modules/_randommodule.c
      +++ b/Modules/_randommodule.c
      @@ -572,6 +572,7 @@ static int
       _random_clear(PyObject *module)
       {
           Py_CLEAR(_randomstate(module)->Random_Type);
      +    Py_CLEAR(_randomstate(module)->Long___abs__);
           return 0;
       }
    6. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directory

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions