Author vstinner
Recipients methane, serhiy.storchaka, vstinner
Date 2018-10-24.12:09:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1540382949.98.0.788709270274.issue35053@psf.upfronthosting.co.za>
In-reply-to
Content
Python 3.8 uses many free lists:
https://pythondev.readthedocs.io/cpython_impl_optim.html#free-lists

Attached dict_wrong_traceback.py shows the bug on the dictionary of an object:

$ ./python ~/dict_wrong_traceback.py 
  File "/home/vstinner/dict_wrong_traceback.py", line 13
    p = Point() # first object (dead!)
  File "/home/vstinner/dict_wrong_traceback.py", line 8
    self.x = 1

tracemalloc shows the traceback of the first object... which has been destroyed!

With the fix:

$ ./python ~/dict_wrong_traceback.py 
  File "/home/vstinner/dict_wrong_traceback.py", line 16
    p = Point() # second object (alive)
  File "/home/vstinner/dict_wrong_traceback.py", line 8
    self.x = 1

It's much better: it doesn't show dead objects anymore :-)
History
Date User Action Args
2018-10-24 12:09:10vstinnersetrecipients: + vstinner, methane, serhiy.storchaka
2018-10-24 12:09:09vstinnersetmessageid: <1540382949.98.0.788709270274.issue35053@psf.upfronthosting.co.za>
2018-10-24 12:09:09vstinnerlinkissue35053 messages
2018-10-24 12:09:09vstinnercreate