Reference leak regression with Python3.8a3 #80906
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
assignee = None closed_at = <Date 2019-05-13.15:31:06.436> created_at = <Date 2019-04-25.20:28:27.757> labels = ['3.8', 'performance'] title = 'Reference leak regression with Python3.8a3' updated_at = <Date 2019-05-13.17:17:56.569> user = 'https://bugs.python.org/kayhayen'
activity = <Date 2019-05-13.17:17:56.569> actor = 'vstinner' assignee = 'none' closed = True closed_date = <Date 2019-05-13.15:31:06.436> closer = 'vstinner' components =  creation = <Date 2019-04-25.20:28:27.757> creator = 'kayhayen' dependencies =  files =  hgrepos =  issue_num = 36725 keywords = ['patch'] message_count = 10.0 messages = ['340861', '340876', '340883', '340888', '340890', '340901', '340917', '340920', '340921', '342340'] nosy_count = 3.0 nosy_names = ['vstinner', 'kayhayen', 'nanjekyejoannah'] pr_nums = ['12960', '12961', '13231'] priority = 'normal' resolution = 'duplicate' stage = 'resolved' status = 'closed' superseder = '36851' type = 'resource usage' url = 'https://bugs.python.org/issue36725' versions = ['Python 3.8']
The text was updated successfully, but these errors were encountered:
Much like bpo-9366 the same file can be used. This reference leaks according to Nuitka comparative testing:
simpleFunction59: FAILED 129511 129512 leaked 1
def simpleFunction59(): a = 3 b = 5
return a finally: return a / b
I would be guessing, that you are leaking the return value when returning again.
I wrote an unit test to be able to re-use regrtest memory leak hunter:
import unittest def simpleFunction59(): a = 1 try: return a finally: return a class Tests(unittest.TestCase): def test_bug(self): for _ in range(10): simpleFunction59()
I confirm that there is a leak:
$ ./python -m test -R 3:3 test_bug ... test_bug leaked [10, 10, 10] references, sum=30 ...
@ victor, I have tried your example but I can not reproduce the leak as you did above. May be am missing something?
I used some other tool and got this summary when I was investigating this:
================================= | =========== | ============
Am still investigating though.
I am able to reproduce it finally.
Run tests sequentially
== Tests result: FAILURE ==
1 test failed:
Total duration: 220 ms