[Python-Dev] [Python-checkins] Python Regression Test Failures refleak (101)

Michael Hudson mwh at python.net
Sun May 28 16:00:12 CEST 2006


"Thomas Wouters" <thomas at python.org> writes:

> Does 'a tuple containing two Nones, a string and an int' ring a bell to
> anyone? :)

I found this one on the train (look at SyntaxError_init, it's
obvious).  I also found a number of other bugs in the new exceptions.c
code, from leaks:

>>> def f():
...     try: UnicodeEncodeError()
...     except TypeError: pass
... 
>>> for i in range(10):
...     f()
...     print sys.gettotalrefcount()
... 
30816
30821
30826
30831
30836
30841
30846
30851
30856
30861

to potential crashes:

>>> s = SystemExit(); s.code = []; s.__init__(); s.code
[[...]]
Bus error

So I think I'll be reading through exceptions.c pretty carefully.  I
don't think Sean and Richard have acquired as much paranoid
anal-mindedness and I have when hacking on Python C internals yet :)

Cheers,
mwh

-- 
  > Why are we talking about bricks and concrete in a lisp newsgroup?
  After long experiment it was found preferable to talking about why
  Lisp is slower than C++...
                        -- Duane Rettig & Tim Bradshaw, comp.lang.lisp


More information about the Python-Dev mailing list