On 5/15/2013 1:55 PM, Ojala Janne wrote:

Which backend are you using?  I can't reproduce.  Does

https://github.com/matplotlib/matplotlib/blob/master/examples/text_labels_and_annotations/unicode_demo.py
<https://github.com/matplotlib/matplotlib/blob/master/examples/text_labels_and_annotations/unicode_demo.py>

work for you?

The bug only happens if I try to save the figure as EPS. So I suppose that
then means its a cairo back end (happens also if I force cairo). So that
means
as written the code works fine but if i try to make publishable quality
output
by saving as EPS (a raster image is not suitable), it crashes.

But it again works if I add any character thats so weird that ist on a n
extended
  unicode block then all characters seem to be handled correctly. Even
the ones
that previously crashed.


I can reproduce the crash on Python 2.7, 32 and 64 bit. Python 2.6 and 3.3 appear to work. The call stack is attached. The crash is in ttfont_add_glyph_dependencies() at <https://github.com/matplotlib/matplotlib/blob/v1.2.x/ttconv/pprdrv_tt2.cpp#L703>

Christoph



        msvcr90.dll!__crt_debugger_hook(int _Reserved=0)  Line 65       C
        msvcr90.dll!_invoke_watson(const wchar_t * 
pszExpression=0x000000000022e750, const wchar_t * 
pszFunction=0x00000000798363d3, const wchar_t * pszFile=0x0000000005ed9ddc, 
unsigned int nLine=109701576, unsigned __int64 pReserved=0)  Line 233  C++
        msvcr90.dll!_invalid_parameter(const wchar_t * 
pszExpression=0x0000000005f649a8, const wchar_t * 
pszFunction=0x0000000005b8ce88, const wchar_t * pszFile=0x000000000022e708, 
unsigned int nLine=2288096, unsigned __int64 pReserved=0)  Line 115        C++
        msvcr90.dll!_invalid_parameter_noinfo()  Line 126       C++
        ttconv.pyd!std::_Vector_const_iterator<int,std::allocator<int> 
>::operator*()  Line 106 C++
        ttconv.pyd!std::_Vector_iterator<int,std::allocator<int> >::operator*() 
 Line 340       C++
>       ttconv.pyd!ttfont_add_glyph_dependencies(TTFONT * 
> font=0x000000000022e8c0, std::vector<int,std::allocator<int> > & 
> glyph_ids=[13](17,19,20,21,22,23,24,25,26,27,28,36,174))  Line 703 + 0xd 
> bytes       C++
        ttconv.pyd!read_font(const char * filename=0x0000000005f7fa60, 
font_type_enum target_type=PS_TYPE_3, std::vector<int,std::allocator<int> > & 
glyph_ids=[13](17,19,20,21,22,23,24,25,26,27,28,36,174), TTFONT & font={...})  
Line 1326   C++
        ttconv.pyd!insert_ttfont(const char * filename=0x0000000005f7fa60, 
TTStreamWriter & stream={...}, font_type_enum target_type=PS_TYPE_3, 
std::vector<int,std::allocator<int> > & 
glyph_ids=[13](17,19,20,21,22,23,24,25,26,27,28,36,174))  Line 1336     C++
        ttconv.pyd!convert_ttf_to_ps(_object * self=0x0000000000000000, _object 
* args=0x0000000005f649a8, _object * kwds=0x0000000000000000)  Line 149 + 0x1f 
bytes    C++
        python27.dll!PyCFunction_Call(_object * func=0x0000000000000004, 
_object * arg=0x0000000001d57760, _object * kw=0x0000000005b8ce88)  Line 85 + 
0x8 bytes        C
        python27.dll!call_function(_object * * * pp_stack=0x0000000000000000, 
int oparg=131)  Line 4021 + 0xaf bytes    C
        python27.dll!PyEval_EvalFrameEx(_frame * f=0x0000000005ceddf8, int 
throwflag=99512536)  Line 2670       C
        python27.dll!PyEval_EvalCodeEx(PyCodeObject * co=0x0000000005f725b0, 
_object * globals=0x0000000000000009, _object * locals=0x0000000000000001, 
_object * * args=0x0000000000000000, int argcount=9, _object * * 
kws=0x0000000005bb31a0, int kwcount=1, _object * * defs=0x0000000005f6e3c0, int 
defcount=6, _object * closure=0x0000000000000000)  Line 3253 + 0xa bytes       C
        python27.dll!function_call(_object * func=0x0000000005f7c588, _object * 
arg=0x0000000005b729a8, _object * kw=0x0000000000000009)  Line 531 + 0x3b bytes 
C
        python27.dll!PyObject_Call(_object * func=0x0000000005b729a8, _object * 
arg=0x0000000005fd7798, _object * kw=0x0000000000000000)  Line 2530     C
        python27.dll!ext_do_call(_object * func=0x0000000005f7c588, _object * * 
* pp_stack=0x0000000000000002, int flags=95555384, int na=9, int nk=0)  Line 
4334 + 0xe bytes   C
        python27.dll!PyEval_EvalFrameEx(_frame * f=0x0000000005b20d18, int 
throwflag=95362448)  Line 2708       C
        python27.dll!PyEval_EvalCodeEx(PyCodeObject * co=0x0000000005f72430, 
_object * globals=0x0000000000000003, _object * locals=0x0000000000000005, 
_object * * args=0x0000000005f63c50, int argcount=3, _object * * 
kws=0x0000000005f7a1e0, int kwcount=5, _object * * defs=0x0000000000000000, int 
defcount=0, _object * closure=0x0000000000000000)  Line 3253 + 0xa bytes       C
        python27.dll!function_call(_object * func=0x0000000005f7c518, _object * 
arg=0x0000000001e7a750, _object * kw=0x0000000000000009)  Line 531 + 0x3b bytes 
C
        python27.dll!PyObject_Call(_object * func=0x0000000001e7a750, _object * 
arg=0x0000000005fd5818, _object * kw=0x0000000001d61048)  Line 2530     C
        python27.dll!ext_do_call(_object * func=0x0000000005f7c518, _object * * 
* pp_stack=0x0000000000000003, int flags=100268584, int na=3, int nk=0)  Line 
4334 + 0xe bytes  C
        python27.dll!PyEval_EvalFrameEx(_frame * f=0x0000000005f9f868, int 
throwflag=100028232)  Line 2708      C
        python27.dll!PyEval_EvalCodeEx(PyCodeObject * co=0x0000000005f723b0, 
_object * globals=0x0000000000000002, _object * locals=0x0000000000000005, 
_object * * args=0x000000000022f3d8, int argcount=2, _object * * 
kws=0x0000000005f7a2e0, int kwcount=5, _object * * defs=0x0000000000000000, int 
defcount=0, _object * closure=0x0000000000000000)  Line 3253 + 0xa bytes       C
        python27.dll!function_call(_object * func=0x0000000005f7c4a8, _object * 
arg=0x0000000005ba9cc8, _object * kw=0x0000000000000009)  Line 531 + 0x3b bytes 
C
        python27.dll!PyObject_Call(_object * func=0x0000000005ba9cc8, _object * 
arg=0x0000000004055748, _object * kw=0x0000000005f68080)  Line 2530     C
        python27.dll!ext_do_call(_object * func=0x0000000005f7c4a8, _object * * 
* pp_stack=0x0000000000000003, int flags=97075920, int na=1, int nk=0)  Line 
4334 + 0xe bytes   C
        python27.dll!PyEval_EvalFrameEx(_frame * f=0x0000000005c94118, int 
throwflag=65646176)  Line 2708       C
        python27.dll!PyEval_EvalCodeEx(PyCodeObject * co=0x0000000003f64c30, 
_object * globals=0x0000000000000001, _object * locals=0x0000000000000005, 
_object * * args=0x000000000022f6a0, int argcount=2, _object * * 
kws=0x0000000003c809e0, int kwcount=5, _object * * defs=0x0000000000000000, int 
defcount=0, _object * closure=0x0000000000000000)  Line 3253 + 0xa bytes       C
        python27.dll!function_call(_object * func=0x0000000005810dd8, _object * 
arg=0x0000000005bb30c8, _object * kw=0x0000000000000009)  Line 531 + 0x3b bytes 
C
        python27.dll!PyObject_Call(_object * func=0x0000000005bb30c8, _object * 
arg=0x00000000057a4618, _object * kw=0x0000000000000000)  Line 2530     C
        python27.dll!ext_do_call(_object * func=0x0000000005810dd8, _object * * 
* pp_stack=0x0000000000000002, int flags=88516896, int na=2, int nk=5)  Line 
4334 + 0xe bytes   C
        python27.dll!PyEval_EvalFrameEx(_frame * f=0x000000000546a678, int 
throwflag=92161680)  Line 2708       C
        python27.dll!PyEval_EvalCodeEx(PyCodeObject * co=0x0000000003f6d4b0, 
_object * globals=0x0000000000000002, _object * locals=0x0000000000000003, 
_object * * args=0x0000000004052c88, int argcount=2, _object * * 
kws=0x0000000005a37480, int kwcount=3, _object * * defs=0x00000000057e4690, int 
defcount=5, _object * closure=0x0000000000000000)  Line 3253 + 0xa bytes       C
        python27.dll!function_call(_object * func=0x00000000058113c8, _object * 
arg=0x0000000005bb3108, _object * kw=0x0000000000000009)  Line 531 + 0x3b bytes 
C
        python27.dll!PyObject_Call(_object * func=0x0000000005bb3108, _object * 
arg=0x0000000004052c88, _object * kw=0x0000000005f63f28)  Line 2530     C
        python27.dll!ext_do_call(_object * func=0x00000000058113c8, _object * * 
* pp_stack=0x0000000000000003, int flags=97085672, int na=1, int nk=0)  Line 
4334 + 0xe bytes   C
        python27.dll!PyEval_EvalFrameEx(_frame * f=0x0000000005c96718, int 
throwflag=-65397472)  Line 2708      C
        python27.dll!PyEval_EvalCodeEx(PyCodeObject * co=0x0000000003e2a030, 
_object * globals=0x0000000000000001, _object * locals=0x0000000000000000, 
_object * * args=0x0000000000000003, int argcount=2, _object * * 
kws=0x0000000001e385c0, int kwcount=0, _object * * defs=0x0000000000000000, int 
defcount=0, _object * closure=0x0000000000000000)  Line 3253 + 0xa bytes       C
        python27.dll!fast_function(_object * func=0x0000000000000002, _object * 
* * pp_stack=0x0000000005ba6f98, int n=95296984, int na=504117770, int nk=0)  
Line 4121 C
        python27.dll!call_function(_object * * * pp_stack=0x0000000000000000, 
int oparg=131)  Line 4042 + 0x16 bytes    C
        python27.dll!PyEval_EvalFrameEx(_frame * f=0x0000000001e38438, int 
throwflag=30756147)  Line 2670       C
        python27.dll!PyEval_EvalCodeEx(PyCodeObject * co=0x0000000001df11b0, 
_object * globals=0x000000007388f904, _object * locals=0x0000000001df11b0, 
_object * * args=0x0000000001ef6670, int argcount=0, _object * * 
kws=0x0000000000000000, int kwcount=0, _object * * defs=0x0000000000000000, int 
defcount=0, _object * closure=0x0000000000000000)  Line 3253 + 0xa bytes       C
        python27.dll!PyEval_EvalCode(PyCodeObject * co=0x000000007390c660, 
_object * globals=0x0000000001d54d33, _object * locals=0x0000000001ddff18)  
Line 673 C
        python27.dll!run_mod(_mod * mod=0x000000007390c660, const char * 
filename=0x0000000001f791e8, _object * globals=0x0000000000000001, _object * 
locals=0x000000001e14327e, PyCompilerFlags * flags=0x000000000022ff38, _arena * 
arena=0x0000000001d56680)  Line 1366      C
        python27.dll!PyRun_FileExFlags(_iobuf * fp=0x0000000001d54d33, const 
char * filename=0x0000000001d9e1f8, int start=31325976, _object * 
globals=0x0000000001d9e330, _object * locals=0x0000000001ddff18, int closeit=1, 
PyCompilerFlags * flags=0x000000000022ff38)  Line 1352   C
        python27.dll!PyRun_SimpleFileExFlags(_iobuf * fp=0x0000000000000001, 
const char * filename=0x0000000001d54d33, int closeit=1938867808, 
PyCompilerFlags * flags=0x000000000022ff38)  Line 944 + 0x2a bytes       C
        python27.dll!PyRun_AnyFileExFlags(_iobuf * fp=0x0000000001d54d00, const 
char * filename=0x0000000000000001, int closeit=0, PyCompilerFlags * 
flags=0x0000000001d54d33)  Line 748        C
        python27.dll!Py_Main(int argc=0, char * * argv=0x0000004600000000)  
Line 643 + 0x24 bytes       C
        python.exe!__tmainCRTStartup()  Line 586 + 0x19 bytes   C
        kernel32.dll!BaseThreadInitThunk()  + 0x1a bytes        
        ntdll.dll!RtlUserThreadStart()  + 0x21 bytes    
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to