[Python-Dev] Re: [Python-checkins] python/dist/src/Objects typeobject.c,2.242,2.243

Michael Hudson mwh at python.net
Fri Aug 8 16:08:00 EDT 2003


mwh at users.sourceforge.net writes:

> Update of /cvsroot/python/python/dist/src/Objects
> In directory sc8-pr-cvs1:/tmp/cvs-serv29176
>
> Modified Files:
> 	typeobject.c 
> Log Message:
> /* XXX From here until type is allocated, "return NULL" leaks bases! */
>
> Sure looks like it to me! <wink>
>
> When I run the leak2.py script I posted to python-dev, I only see
> three reference leaks in all of test_descr.  When I run
> test_descr.test_main, I still see 46 leaks.  This clearly demands
> posting a yelp to python-dev :-)

This is deeply weird.  Watch:

[mwh at pc150 build-debug]$ ./python.exe 
Python 2.4a0 (#25, Aug  8 2003, 14:17:07) 
[GCC 3.1 20020420 (prerelease)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from test import test_support 
[40915 refs]
>>> test_support.verbose = 0
[41028 refs]
>>> from test import test_descr  
[56312 refs]
>>> import gc
[56439 refs]
>>> for i in range(5): # just to get things to stabilize
...  test_descr.test_main(); gc.collect()
... 
273
297
297
297
297
[66427 refs] ----------------------------------.
>>> test_descr.test_main(); gc.collect()       | leaks 46 refs
297                                            |
[66473 refs] <---------------------------------:
>>> test_descr.test_main(); gc.collect()       |
297                                            | and again
[66519 refs] <---------------------------------'
>>> test_descr.test_main(); gc.collect()
32
[66523 refs] ----------------------------------.
>>> test_descr.test_main(); gc.collect()       | now we leak
32                                             | just three!
[66526 refs] <---------------------------------'
>>> gc.set_threshold(193, 10, 10)
[66526 refs]
>>> test_descr.test_main(); gc.collect()
32
[66571 refs] ----------------------------------.
>>> test_descr.test_main(); gc.collect()       | back to 46!
32                                             |
[66617 refs] <---------------------------------'
>>> 

Help!?  Anyone!? (Neil!?)

bewildered-ly y'rs,
mwh

-- 
  Ya, ya, ya, except ... if I were built out of KSR chips, I'd
  be running at 25 or 50 MHz, and would be wrong about ALMOST
  EVERYTHING almost ALL THE TIME just due to being a computer!
                                              -- Tim Peters, 30 Apr 97



More information about the Python-Dev mailing list