random crash, Pango-WARNING

Darren Dale wrote:

···

On Sunday 26 February 2006 7:50 pm, you wrote:

Darren Dale wrote:

On Sunday 26 February 2006 6:37 am, Steve Schmerler wrote:

Hi

With 0.87 and 0.86.2 mpl randomly crashes when executing this script:

---------------------------

from pylab import *
from matplotlib import verbose

verbose.level = 'debug-annoying'
##verbose.level = 'debug'

rcParams['text.usetex'] = True
plot([1,2,3])

savefig("image.eps")
---------------------------

The crash is triggered when savefig() is called and only if
rcParams['text.usetex'] = True. The error message is

(test.py:7258): Pango-WARNING **: Invalid UTF-8 string passed to
pango_layout_set_text()

I tried to track it down but the crash seems to occur in *different*
code segments (calling "python test.py" several times it crashed
sometimes after a call to dvips, sometimes dvipng, gs, ...). Sometimes
it even *doesn't* crash at all.

I have the following pango-stuff installed (Debian):

elcorto@...662...:~$ COLUMNS=200 dpkg -l | grep pango
ii libpango1.0-0 1.8.1-1

ii libpango1.0-common 1.8.1-1

ii libpango1.0-dbg 1.8.1-1

ii libpango1.0-dev 1.8.1-1

I can't reproduce your result with pango 1.10.3 installed on a gentoo
system with python-2.4.2. Does the script crash if you set
verbose.level=silent? It looks like one of the stdout or stderr messages
from dvips/gs/dvipng is returning unicode, in which case you could try to
convert them to strings before passing them to verbose.report. Just a
guess.

Yes, with verbose.level = 'silent' the script runs and saves the image
but in interactive use the interpreter crashes (an errow message window
pops up, verbose.level: silent in matplotlibrc).

Did you try to wrap the stderr/stdout output with str()?

No. I have to correct myself. I just tested it again (with verbose.level
= 'silent' in the script and/or matplotlibrc) and it *does* crash so
it's not the verbose messages. This seems truly random ...

cheers,
steve

--
Random number generation is the art of producing pure gibberish as
quickly as possible.