trunk: crash when selecting text object with empty 'font-family' property (rev >= 12104)

Bug #1230241 reported by su_v
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
Martin Owens

Bug Description

Inkscape trunk crashes on selecting a text object which has an empty 'font-family' style property. Independent of whether this is conformant SVG or not (needs to be verified), Inkscape ought to handle this more gracefully and not crash.

Steps to reproduce:
1) launch inkscape (default prefs, default new doc)
2) open the attached SVG file
3) select the bottom-most text object

Expected result:
Inkscape selects the text object and displays object information in the status bar.

Actual result:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x000000010427e863 in Glib::ustring::empty ()
(gdb) bt
#0 0x000000010427e863 in Glib::ustring::empty ()
#1 0x000000010072bc35 in Inkscape::FontLister::update_font_list (this=0x10e0b8cc0, document=0x10aec6c00) at font-lister.cpp:158
#2 0x00000001009e0392 in sp_text_toolbox_selection_changed (unnamed_arg=0x10d81a0f0, tbl=0x10b51aa20) at text-toolbar.cpp:867

First encountered with Inkscape 0.48+devel r12588 on OS X 10.7.5

Based on tests with archived builds on OS X:
 - not reproduced with rev <= 12103
 - reproduced with rev >= 12104,
this regression seems related to:
Revision 12104: Add fonts (and font-lists) used in document to top of Text tool-bar font-family drop-down menu.
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/12104>

Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
su_v (suv-lp) wrote :

Note: the sample SVG file was created with (unreleased) lp:inkscape/0.48.x r9968, which includes the backported fix for
- Bug #805238 “Crash when setting empty font family”
  <https://bugs.launchpad.net/inkscape/+bug/805238>

The backported fix has been reverted for now in lp:inkscape/0.48.x r9969.

tags: removed: ui
Revision history for this message
su_v (suv-lp) wrote :

Backtrace

su_v (suv-lp)
Changed in inkscape:
importance: Undecided → High
Revision history for this message
jazzynico (jazzynico) wrote :

Confirmed on Windows XP, Inkscape trunk revision 12688.

Changed in inkscape:
status: New → Triaged
Revision history for this message
Johan Engelen (johanengelen) wrote :

should be fixed in r12740

Revision history for this message
jazzynico (jazzynico) wrote :

Tested on Windows XP, Inkscape trunk revision 12742.
Inkscape no longer crashes when selecting the text object (step 3 in the original description).

But now the following steps lead to another crash:
1. Select one of the text objects.
2. Select the Text tool.
3. Open the font selector in the tools options bar -> at the top of the list, we now have two lines: one with Sans, the other with an apparently random font.
4. Move the mouse cursor on the top of the list -> the random font changes to Sans. We now have two Sans lines.
5. Select the first line (the one that changes in 4) -> Inkscape crashes.

Sorry, I didn't manage to get a gdb trace on Windows.

Revision history for this message
Johan Engelen (johanengelen) wrote :

nice testing, I think Tav should have a look at this too

Revision history for this message
jazzynico (jazzynico) wrote :

Bug from comment #6 reproduced on Crunchbang Waldorf, Inkscape trunk revision 12849.

Console message:
'std::logic_error' what(): basic_string::_S_construct null not valid

GDB trace attached.

Revision history for this message
jazzynico (jazzynico) wrote :

When moving the mouse cursor on the two top fonts, the application outputs the following console messages:
----
(inkscape:5402): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Error on line 1 char 68: 'gray'' is not a valid name: '''
(repeated many times).
----

And just before crashing, I get:
----
** (inkscape:5402): WARNING **: Ignoring font without family that will crash Pango
** Message: Family: (null)
----

 The g_message is a local test on the result of pango_font_description_get_family(descr), in libnrtype/font-lister.cpp:288.

Revision history for this message
Martin Owens (doctormo) wrote :

I've fixed it in r12908 by setting a default if pango fails to get a family name. This not only prevents the crash but looks more consistent in the UI.

Changed in inkscape:
assignee: nobody → Martin Owens (doctormo)
status: Triaged → Fix Committed
Revision history for this message
su_v (suv-lp) wrote :

@Martin - JFYI: the default generic/fallback font in trunk is 'sans-serif', and no longer 'Sans'. Trunk had been switched from 'Sans' to 'sans-serif' in revision 11393:
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/11393>

Revision history for this message
Martin Owens (doctormo) wrote :

Thanks suv, updated in 12909

Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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