crash in "Open file" dialog in zh_CN.UTF-8 locales

Bug #261475 reported by Luca Bruno on 2008-08-26
Affects Status Importance Assigned to Milestone
inkscape (Debian)
Fix Released

Bug Description

Launching inkscape with LANG=zh_CN.UTF-8, crashes reproducibly every time in File -> Open...
I've seen it also crashing with zh_TW.UTF-8 after browsing some .svg files (with and without preview enabled).
This bug affect both 0.46 stable and recent svn devel versions. Below the backtrace, attached a full backtrace too.
Moreover pango_ft2_font_get_face is deprecated, see
It was originally reported in debian BTS, see

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb6203700 (LWP 4030)]
font_instance::InitTheFace (this=0x0) at libnrtype/FontInstance.cpp:349
349 theFace=pango_ft2_font_get_face(pFont);
(gdb) bt
#0 font_instance::InitTheFace (this=0x0) at libnrtype/FontInstance.cpp:349
#1 0x083e9ed0 in font_factory::Face (this=0xa0370b0, descr=0xc3ca100, canFail=false) at libnrtype/FontFactory.cpp:824
#2 0x083ea132 in font_factory::Face (this=0xa0370b0, descr=0xc3ca100, canFail=true) at libnrtype/FontFactory.cpp:801
#3 0x083f806b in Inkscape::Text::Layout::Calculator::_buildPangoItemizationForPara (this=0xbf88affc, para=0xbf88af44)
    at libnrtype/Layout-TNG-Compute.cpp:879
#4 0x083f990a in Inkscape::Text::Layout::Calculator::calculate (this=0xbf88affc) at libnrtype/Layout-TNG-Compute.cpp:1377
#5 0x083f9f2d in Inkscape::Text::Layout::calculateFlow (this=0xb1bd2d8) at libnrtype/Layout-TNG-Compute.cpp:1515
#6 0x080f5657 in SPText::rebuildLayout (this=0xb1bd1b8) at sp-text.cpp:573
#7 0x080f5936 in sp_text_update (object=0xb1bd1b8, ctx=0xbf88b1a8, flags=<value optimized out>) at sp-text.cpp:248
#8 0x080d8856 in SPObject::updateDisplay (this=0xb1bd1b8, ctx=0xbf88b1a8, flags=127) at sp-object.cpp:1298
#9 0x080c79df in CGroup::onUpdate (this=0xc414800, ctx=0xbf88b2e8, flags=92) at sp-item-group.cpp:668
#10 0x080d8856 in SPObject::updateDisplay (this=0xb1a0da0, ctx=0xbf88b2e8, flags=95) at sp-object.cpp:1298
#11 0x080c79df in CGroup::onUpdate (this=0xc414da8, ctx=0xbf88b42c, flags=28) at sp-item-group.cpp:668
#12 0x080e8ce1 in sp_root_update (object=0x9ac4410, ctx=0xbf88b648, flags=27) at sp-root.cpp:553
#13 0x080d8856 in SPObject::updateDisplay (this=0x9ac4410, ctx=0xbf88b648, flags=27) at sp-object.cpp:1298
#14 0x0808c038 in SPDocument::_updateDocument (this=0x965bea0) at document.cpp:826
#15 0x0808c132 in sp_document_idle_handler (data=0x965bea0) at document.cpp:872
#16 0xb73b9381 in ?? () from /usr/lib/
#17 0x0965bea0 in ?? ()
#18 0x0c410bf0 in ?? ()
#19 0xbf88b718 in ?? ()
#20 0xb74364a8 in ?? () from /usr/lib/
#21 0xb686a3f0 in ?? () from /lib/i686/cmov/
#22 0xb74364a8 in ?? () from /usr/lib/
#23 0xbf88b768 in ?? ()
#24 0xb73bb2e1 in g_main_context_dispatch () from /usr/lib/
Backtrace stopped: frame did not save the PC

Luca Bruno (lucab) wrote :
Changed in inkscape:
importance: Undecided → Unknown
status: New → Unknown
importance: Undecided → High
Changed in inkscape:
status: Unknown → Confirmed
Luca Bruno (lucab) wrote :

Other related details: the culprit is LC_CTYPE, looks like something (our font handler or pango) goes wrong when it is set to chinese. Inkscape crashes in similar ways in other points of libnrtype, too. Chinese .po contains a character for the open dialog translation which always trigger the crash. I'm trying a patch to prevent the crash, but I can't understand why it fails to get proper faces under chinese.

Luca Bruno (lucab) wrote :

Attached a patch to prevent this and other related crash (against SVN r19753). It doesn't seem to break font display, but wrong rendering with chinese LC_CTYPE may still happen.

I don't claim to understand the bug, but the patch seems safe, just null checks, so I tested and committed it. Thanks for the patch!

Changed in inkscape:
status: New → Fix Released
Changed in inkscape:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.