matplotlib errors: Non-aligned pointer being freed

Hi,

I’m using matplotlib on osx leopard (compiled with gcc-4.3) and if I try to render a simple plot I see lots of these errors:

python(58290) malloc: *** error for object 0xa06026d8: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug

I get the following backtrace with gdb:

Breakpoint 1, 0x94458131 in malloc_error_break ()
(gdb) bt
#0 0x94458131 in malloc_error_break ()

#1 0x9445311f in szone_error ()
#2 0x94377743 in szone_free ()
#3 0x943775ad in free ()
#4 0x0175c305 in std::string::assign (this=0xbfffa5e0, __str=@0xbfffa5dc) at bits/basic_string.h:236
#5 0x018e6b00 in FT2Font::set_text (this=0x34544d0, args=@0x17a3674, kwargs=@0xbfffa674) at src/ft2font.cpp:927

#6 0x018ef04c in Py::PythonExtension::method_keyword_call_handler (_self_and_name_tuple=0x35819e0, _args=0x3581a30, _keywords=0x358bd20) at Extensions.hxx:671
#7 0x001e0211 in PyCFunction_Call (func=0x3581c88, arg=0x3581a30, kw=0x358bd20) at Objects/methodobject.c:77

#8 0x001a3b51 in PyObject_Call (func=0x3581c88, arg=0x3581a30, kw=0x358bd20) at Objects/abstract.c:1861
#9 0x00239cc0 in PyEval_EvalFrameEx (f=0x3453370, throwflag=0) at Python/ceval.c:3784
#10 0x0023d3b5 in PyEval_EvalCodeEx (co=0x1df2848, globals=0x1de0ae0, locals=0x0, args=0xb753e4, argcount=3, kws=0xb753f0, kwcount=1, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2836

#11 0x0023bd1d in PyEval_EvalFrameEx (f=0xb75210, throwflag=0) at Python/ceval.c:3669
#12 0x0023d3b5 in PyEval_EvalCodeEx (co=0x1b50068, globals=0x18ba930, locals=0x0, args=0x3452914, argcount=2, kws=0x345291c, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2836

#13 0x0023bd1d in PyEval_EvalFrameEx (f=0x34527a0, throwflag=0) at Python/ceval.c:3669
#14 0x0023d3b5 in PyEval_EvalCodeEx (co=0x1b500f8, globals=0x18ba930, locals=0x0, args=0x35819c4, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2836

#15 0x001c944e in function_call (func=0x1b583f0, arg=0x35819b8, kw=0x0) at Objects/funcobject.c:517
#16 0x001a3b51 in PyObject_Call (func=0x1b583f0, arg=0x35819b8, kw=0x0) at Objects/abstract.c:1861
#17 0x001abc4d in instancemethod_call (func=0x1b583f0, arg=0x35819b8, kw=0x0) at Objects/classobject.c:2519

so it seems to come from somewhere within matplotlib. It doesn’t seem to be a major issue, since the program continues fine, and the plot is rendered correctly.

Any ideas on how to fix it?

thanks