This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jwp
Recipients jwp
Date 2009-02-16.21:23:31
SpamBayes Score 5.2167256e-06
Marked as misclassified No
Message-id <1234819475.16.0.132337680587.issue5283@psf.upfronthosting.co.za>
In-reply-to
Content
I found this bug by misplacing a line of a code. Yes, I was doing
naughty things, but in the case of the class that led to the discovery,
it was inadvertent. :P


class something_else(object):
 pass

class foo(object):
 def __del__(self):
  self.__class__ = something_else

for _ in range(1000):
 foo()

That results in a fatal python error due to a negative reference
count(on the foo class object) in 3.0.

3.0.1 (release30-maint:69593M, Feb 13 2009, 14:48:10) -> kaboom
jwp@torch[]:org/pgfoundry/python 134% /src/build/py30/bin/python3.0
./kaboom.py
Fatal Python error: Objects/descrobject.c:10 object at 0x5221b8 has
negative ref count -1
zsh: abort      /src/build/py30/bin/python3.0 ./kaboom.py


2.6 (r26:66714, Dec 21 2008, 21:17:32) -> kaboom
jwp@torch[]:org/pgfoundry/python 0% /sw/bin/python2.6 ./kaboom.py      
        
Fatal Python error: GC object already tracked
zsh: abort      /sw/bin/python2.6 ./kaboom.py


2.5.2 (r252:60911, Jun 15 2008, 18:55:39) -> no kaboom (no asserts? eh..)
...

2.5.1 (r251:54863, Apr 15 2008, 22:57:26) -> kaboom (/usr/bin/python2.5)
jwp@torch[]:org/pgfoundry/python 0% /usr/bin/python2.5 ./kaboom.py
Assertion failed: (PyType_Check(base)), function _PyType_Lookup, file
Objects/typeobject.c, line 2035.
zsh: abort      /usr/bin/python2.5 ./kaboom.py
History
Date User Action Args
2009-02-16 21:24:35jwpsetrecipients: + jwp
2009-02-16 21:24:35jwpsetmessageid: <1234819475.16.0.132337680587.issue5283@psf.upfronthosting.co.za>
2009-02-16 21:23:34jwplinkissue5283 messages
2009-02-16 21:23:32jwpcreate