[Pythonmac-SIG] Matplotlib warning means what?

Bob Ippolito bob at redivi.com
Sun Mar 13 00:06:26 CET 2005


On Mar 12, 2005, at 17:55, Brendan Simons wrote:

> I've been tooling around with matplotlib,  as graciously packaged by 
> Chris Barker, and hosted on Bob Ippolito's pythonmac.org/packages 
> site.  Everything seems to be working smoothly,  but I've run into a 
> couple of warnings I can't decrypt.
>
> 1) Executing the following code,
> #! /usr/bin/pythonw
> import pylab
> pylab.plot([1, 2, 3], [4, 5, 6])
> pylab.show()
>
> displays a chart as expected (the toolbar icons are a little mucked, 
> but that's minor).  However, dismissing the chart window brings up 
> this warning:
>
> 2005-03-12 17:26:52.075 Python[569] *** _NSAutoreleaseNoPool(): Object 
> 0x66402d0 of class NSCFString autoreleased with no pool in place - 
> just leaking
> *** malloc[569]: Deallocation of a pointer not malloced: 0x66c73d0; 
> This could be a double free(), or free() called with the middle of an 
> allocated block; Try setting environment variable MallocHelp to see 
> tools to help debug
>
> Is this a bug with matplotlib, with my installation of matplotlib, or 
> with my script?  Can I ignore it, and if not, what can I do to address 
> it?

This is a bug in matplotlib or something matplotlib depends on.  It's 
using Foundation without setting up the proper NSAutoreleasePool 
context.  If you have PyObjC, you could just throw an import objc at 
the top and it would get rid of the warning, but it would still be 
leaking memory because the context never gets popped.

-bob



More information about the Pythonmac-SIG mailing list