◐ Shell
clean mode source ↗

Message 301058 - Python tracker

Copy attached test_leak.py to Lib/test/ and run:

haypo@selma$ ./python -m test -R 3:30 test_leak

Run tests in parallel using 1 child processes
0:00:00 load avg: 0.67 [1/1/1] test_leak failed
beginning 33 repetitions
123456789012345678901234567890123
.................................
test_leak leaked [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] memory blocks, sum=30

1 test failed:
    test_leak

Total duration: 682 ms
Tests result: FAILURE


It seems like Thread2 constructor creates a dictionary on "self.hashvalue = (...)". It's a dictionary sharing keys, but it seems like the dict table memory is not released whne the bug occurs.


Sadly, I'm only able to reproduce the bug on a 32-bit build. Since the bug depends on exact hash values, maybe the bug exists in 64-bit builds, but is less likely?


I'm not 100% sure if the bug is related to dict or set.


The bug comes from bpo-31217.