Ok, I think I found the problem. src/ft2font.cpp is used by
_nc_backend_agg.so and ft2font.so. They _both_ have a global
_ft2Library. This isn't good. On HP-UX/PA, it seems the _ft2Library
from ft2font.so is used when matplotlib programs are run first.
However, after the cache file is generated, it seems to start using
the _ft2Library from ft2font.so but then when 'FT2Font()' is called,
the _ft2Library from _nc_backend_agg.so is used.
What we really want is just one _ft2Library, the one from
src/ft2font.cpp. src/_nc_backend_agg.cpp does need the functions in
src/ft2font.cpp but I think _nc_backend_agg.so should depend on
ft2font.so, not load a private copy of src/ft2font.cpp and expect
cross-platform behavior wrt a duplicate global _ft2Library.
Another alternative is to have anything requiring src/ft2font.cpp to
simply 'import ft2font'. For the moment, I've remove src/ft2font.cpp
from all modules except ft2font.so. This seems to work. Patch
attached. Should I submit patches to PyImport_ImportModule("ft2font")
a (1.33 KB)
On Sun, Feb 26, 2006 at 01:00:07AM -0600, Albert Chin wrote:
On Fri, Feb 24, 2006 at 12:15:29AM -0600, Albert Chin wrote:
> On Wed, Feb 22, 2006 at 09:24:38PM -0600, Albert Chin wrote:
> > The failure occurs when displaying the data. I've also tried
> > anim_tk.py to determine if it was a problem with the GTK+ backend but
> > anim_tk.py fails in the same way.
> I did some more digging and the "terminate called after throwing an
> instance ..." error is coming from G++. Maybe something funk with C++
> exceptions on HP/PA that isn't triggered on HP/IA.
The throw Py::RuntimeError is coming from src/ft2font.cpp. There's a
global that holds information for FreeType libraries:
This is initialized when Python loads the module. That works fine.
However, sometime after, _ft2Library is reinitialized to 0. This
doesn't occur the _first_ time matplotlib is run. Only on subsequent
runs when it reads in the font cache file does this occur. Odd.
albert chin (china@...319...)