GNOME Bugzilla – Bug 65109
Crash if no XftConfig file
Last modified: 2004-12-22 21:47:04 UTC
When I ran the libgnomecanvas test program canvas_demo on Solaris it output the message cannot open file "/usr/X11R6/lib/X11/XftConfig" and then crashed with the dbx stack trace as below. I realized that there are probably fonts missing on Solaris but programs should not crash. =>[1] MiniXftPatternFind(0x0, 0xfec9bb08, 0x0, 0x0, 0x0, 0xb4), at 0xfec96a74 [2] MiniXftPatternGet(0x0, 0xfec9bb08, 0x0, 0xffbed4b8, 0x675f71, 0x0), at 0xfec97188 [3] MiniXftPatternGetString(0x0, 0xfec9bb08, 0x0, 0xffbed54c, 0x0, 0xfebb266c), at 0xfec973e4 [4] pango_ft2_pattern_hash(0x0, 0xfec87fc0, 0x0, 0xff3e0000, 0x17578, 0x0), at 0xfec87ff4 [5] g_hash_table_lookup_node(0xb22d0, 0x0, 0xffbed6a4, 0x1, 0xff3e0000, 0xff330ba4), at 0xfea30668 [6] g_hash_table_lookup(0xb22d0, 0x0, 0x0, 0x1d, 0x0, 0xcc638), at 0xfea2eda0 [7] pango_ft2_font_map_new_font(0x2edf0, 0x0, 0x0, 0xfec9bb68, 0xfec9bc40, 0xcc638), at 0xfec89040 [8] pango_ft2_font_map_load_fontset(0x2edf0, 0xb2280, 0xb2348, 0x99bb8, 0xfec89164, 0xfe840d48), at 0xfec89530 [9] pango_font_map_load_fontset(0x2edf0, 0xb2280, 0xb2348, 0x99bb8, 0x0, 0xcc631), at 0xfebcba70 [10] add_engines(0xb2280, 0xb5b70, 0x0, 0xa, 0xb5b88, 0xb5ba0), at 0xfebc9c88 [11] pango_itemize(0xb2280, 0xb5b70, 0x0, 0xa, 0xb5b88, 0xb5ba0), at 0xfebc9060 [12] pango_layout_check_lines(0xcc480, 0xfe8b6000, 0xcc4d0, 0xfe8b6000, 0x21de8, 0xfe841b68), at 0xfebd46a8 [13] pango_layout_get_extents_internal(0xcc480, 0x0, 0xffbedbb8, 0x0, 0x21dc0, 0xfea4a4d4), at 0xfebd1eb8 [14] pango_layout_get_extents(0xcc480, 0x0, 0xffbedbb8, 0x1e, 0x0, 0xcc4d0), at 0xfebd2370 [15] pango_layout_get_pixel_size(0xcc480, 0xc3140, 0xc3144, 0xc3048, 0x0, 0xc3130), at 0xfebd27c4 [16] get_bounds(0xc3048, 0xc3068, 0xc3070, 0xc3078, 0xc3080, 0xb5b70), at 0xff35fbec [17] recalc_bounds(0xc3048, 0xb5b58, 0xffffffff, 0x2d74c, 0x0, 0x0), at 0xff35ffa4 [18] gnome_canvas_text_set_property(0xc3048, 0x1, 0xffbede20, 0x3ff30, 0xff360208, 0x3a), at 0xff360638 [19] object_set_property(0xc3048, 0x3ff30, 0xffbedf30, 0x381d8, 0xfeb623d4, 0xffbedf59), at 0xfeb39124 [20] g_object_set_valist(0xc3048, 0x1a5f8, 0xffbee0e8, 0x0, 0x1, 0xff37dd68), at 0xfeb3397c [21] gnome_canvas_item_construct(0xc3048, 0x2eab0, 0x1a5f8, 0xffbee0e8, 0x0, 0x74), at 0xff36e048 [22] gnome_canvas_item_new(0x2eab0, 0x2314, 0x1a5f8, 0x1a688, 0x1a600, 0x40590000), at 0xff36d7d0 [23] setup_heading(0x2eab0, 0x1a688, 0x0, 0xb5a98, 0x1a628, 0x1a638), at 0x12a28 [24] setup_divisions(0x2ea60, 0x2e848, 0x0, 0x0, 0x0, 0x0), at 0x12ee8 [25] create_canvas_primitives(0x1, 0x1114, 0x4f398, 0x0, 0x0, 0x0), at 0x156f8 [26] create_canvas(0x0, 0x3e4d8, 0xfe8b8588, 0x5, 0x21dc0, 0x12540), at 0x1239c [27] main(0x1, 0xffbee3ec, 0xffbee3f4, 0x2c124, 0x0, 0x0), at 0x12548
You need a XftConfig file, but i agree that it should be robust enough to not crash.
Pango and GTK+ also crash awfully if there is a config file, but no fonts are found. Unfortunately there are a lot of places that need to be changed to fix this issue.
Fri Feb 1 14:50:36 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkrc.c (gtk_rc_parse_string): Handle reparsing any strings if the theme changes. (#69465) * tests/testgtk.c: Add a test for gtk_rc_parse_string().
Oops, didn't mean to close this one.
Don't really know what to do to fix this one short term.
I don't see a way to "fix" it, since there is just no way to render text, get extents or anything if there are no fonts. And a lot of code depends on getting at least some font. We could add a g_warning() somewhere though, so you get some sort of warning instead of just segfaulting later.
Probably the only real way to fix this one would be to ship a font with Pango.
*** Bug 69645 has been marked as a duplicate of this bug. ***
*** Bug 79616 has been marked as a duplicate of this bug. ***
Do we still need XftConfig file on the HEAD with fontconfig?
You should need /etc/fonts/fonts.conf (or something like that) instead.
Yes, and installing etc/fonts.conf to the proper install directory and tuning the contents of the file is each platform's packaging issue. If we're sure XftConfig file is no longer needed and if Sun's sure that they will use post pango-1.0 for their package, I suggest this bug should be closed.
*** Bug 84830 has been marked as a duplicate of this bug. ***
*** Bug 85394 has been marked as a duplicate of this bug. ***
*** Bug 86204 has been marked as a duplicate of this bug. ***
*** Bug 90089 has been marked as a duplicate of this bug. ***
*** Bug 99161 has been marked as a duplicate of this bug. ***
*** Bug 93102 has been marked as a duplicate of this bug. ***
*** Bug 99648 has been marked as a duplicate of this bug. ***
*** Bug 99991 has been marked as a duplicate of this bug. ***
*** Bug 100741 has been marked as a duplicate of this bug. ***
Marking this WONTFIX based on alexl's comment. I don't really like this (to be honest)- we should make it as easy as possible to install things from source, since that is how we attract developers. But... that's probably a bigger-picture question than is appropriate for bugzilla.
*** Bug 101236 has been marked as a duplicate of this bug. ***
*** Bug 101427 has been marked as a duplicate of this bug. ***
*** Bug 101868 has been marked as a duplicate of this bug. ***
*** Bug 101879 has been marked as a duplicate of this bug. ***