[Python-Dev] RE: Painful death in debug build

Neil Schemenauer nas@python.ca
Fri, 5 Oct 2001 21:44:55 -0700


Fred L. Drake, Jr. wrote:
> 
>   Given that Guido's already done the efence run, I'll ignore the
> weird result I'm getting.  ;-)
>   On a laptop running Mandrake 7.2, Python configured --with-pydebug,
> and lots of free memory, I get this:
> 
> 
> beowolf(.../python/debug); LD_PRELOAD=/usr/lib/libefence.so.0.0 ./python ../Lib/test/regrtest.py -l
...
> ElectricFence Exiting: mmap() failed: Cannot allocate memory

Using electric fence requires huge amounts of (virtual) memory.  Every
allocation requires two pages of memory.  I doubt running the entire
test suite would ever work.  I'm having trouble running just test_descr
alone with all the tests commented out!  I think I'm running into
MAX_MAP_COUNT (which defaults to 64k).

I've just grabbed Linux 2.4.10-ac7 which add an AVL tree for VMAs and a
dynamically configurable max_map_count.  We'll see how that goes.

Someone should really write a portable debug version of malloc and free
for Python that works like the Microsoft implementation.  It can't be
too hard to lay down poison before and after the hunk of memory on
allocation and then check it on deallocation.

  Neil