classification
Title: test_threading leaked [1, 1, 1] references: test_threads_join
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: dino.viehland Nosy List: dino.viehland, vstinner
Priority: normal Keywords: patch

Created on 2019-09-15 09:48 by vstinner, last changed 2019-09-16 08:07 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 16158 merged dino.viehland, 2019-09-15 14:31
Messages (3)
msg352470 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-09-15 09:48
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
msg352471 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-09-15 09:52
The regression seems to be introduced by:

commit 04f0bbfbedf8d2bb69b012f853de6648b1a9f27f (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.
msg352527 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-09-16 08:07
commit 09dc2c672f937cbe53300cb680fca1f9c78ff976
Author: Dino Viehland <dinoviehland@gmail.com>
Date:   Sun Sep 15 15:51:44 2019 +0100

    Fix missing dec ref (#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;
 }
History
Date User Action Args
2019-09-16 08:07:17vstinnersetmessages: + msg352527
2019-09-15 14:52:17dino.viehlandsetstatus: open -> closed
resolution: fixed
2019-09-15 14:52:08dino.viehlandsetstage: patch review -> resolved
2019-09-15 14:31:38dino.viehlandsetkeywords: + patch
stage: patch review
pull_requests: + pull_request15768
2019-09-15 13:55:30dino.viehlandsetassignee: dino.viehland

nosy: + dino.viehland
2019-09-15 09:52:33vstinnersetmessages: + msg352471
2019-09-15 09:48:19vstinnercreate