After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 691186 - Gtk+ 3.6.3 crashes when opening printing dialog: segfault in pango_font_description_hash()
Gtk+ 3.6.3 crashes when opening printing dialog: segfault in pango_font_descr...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GtkStyleContext
3.6.x
Other Linux
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-01-05 13:57 UTC by Alexandre Rostovtsev
Modified: 2013-01-07 00:05 UTC
See Also:
GNOME target: ---
GNOME version: 3.5/3.6


Attachments
stylecontext: Make font hack not crash (2.28 KB, patch)
2013-01-06 22:11 UTC, Benjamin Otte (Company)
committed Details | Review

Description Alexandre Rostovtsev 2013-01-05 13:57:02 UTC
(As reported downstream at https://bugs.gentoo.org/show_bug.cgi?id=450370)

With gtk+-3.6.3, opening the printing dialog in gedit or evince causes a segfault in the program in pango_font_description_hash(); in addition, sometimes all of gnome-shell crashes at the same time too.

This is a regression compared to gtk+-3.6.2

As far as I can tell, this failure was introduced by commit c3508c9fa3854a158c16da4b50e4cbcc321333b9 ("stylecontext: Always recompute font").

Reverting c3508c9fa3854a158c16da4b50e4cbcc321333b9 fixes the crashes for me.
Comment 1 Alexandre Rostovtsev 2013-01-05 13:59:13 UTC
Backtrace from gtk+-3.6.3 + gedit-3.6.2 when opening the printing dialog:



Program received signal SIGSEGV, Segmentation fault.
pango_font_description_hash (desc=0xdbd900) at fonts.c:786
786	    hash = case_insensitive_hash (desc->family_name);

Thread 1 (Thread 0x7fffef198940 (LWP 12662))

  • #0 pango_font_description_hash
    at fonts.c line 786
  • #1 pango_fc_fontset_key_hash
    at pangofc-fontmap.c line 407
  • #2 g_hash_table_lookup_node
    at ghash.c line 401
  • #3 g_hash_table_lookup
    at ghash.c line 1074
  • #4 pango_fc_font_map_load_fontset
    at pangofc-fontmap.c line 1733
  • #5 ??
    from /usr/lib64/gtk-3.0/modules/libpk-gtk-module.so
  • #6 itemize_state_update_for_new_run
    at pango-context.c line 1387
  • #7 itemize_state_process_run
    at pango-context.c line 1426
  • #8 itemize_with_font
    at pango-context.c line 1589
  • #9 pango_context_get_metrics
    at pango-context.c line 1769
  • #10 gtk_combo_box_get_preferred_width
    at gtkcombobox.c line 5475
  • #11 compute_size_for_orientation
    at gtksizerequest.c line 359
  • #12 gtk_grid_request_non_spanning
    at gtkgrid.c line 668
  • #13 gtk_grid_request_run
    at gtkgrid.c line 995
  • #14 gtk_grid_get_size
    at gtkgrid.c line 1160
  • #15 compute_size_for_orientation
    at gtksizerequest.c line 359
  • #16 gtk_widget_get_preferred_width
    at gtksizerequest.c line 552
  • #17 gtk_box_get_size
    at gtkbox.c line 1042
  • #18 compute_size_for_orientation
    at gtksizerequest.c line 359
  • #19 gtk_widget_get_preferred_width
    at gtksizerequest.c line 552
  • #20 gtk_box_get_size
    at gtkbox.c line 1042
  • #21 compute_size_for_orientation
    at gtksizerequest.c line 359
  • #22 gtk_widget_get_preferred_width
    at gtksizerequest.c line 552
  • #23 gtk_box_get_size
    at gtkbox.c line 1042
  • #24 compute_size_for_orientation
    at gtksizerequest.c line 359
  • #25 gtk_widget_get_preferred_width
    at gtksizerequest.c line 552
  • #26 get_preferred_size_for_size
    at gtknotebook.c line 2217
  • #27 gtk_notebook_size_request
    at gtknotebook.c line 2276
  • #28 compute_size_for_orientation
    at gtksizerequest.c line 359
  • #29 gtk_widget_get_preferred_width
    at gtksizerequest.c line 552
  • #30 gtk_box_get_size
    at gtkbox.c line 1042
  • #31 compute_size_for_orientation
    at gtksizerequest.c line 359
  • #32 gtk_widget_get_preferred_width
    at gtksizerequest.c line 552
  • #33 gtk_box_get_size
    at gtkbox.c line 1042
  • #34 compute_size_for_orientation
    at gtksizerequest.c line 359
  • #35 gtk_widget_get_preferred_width
    at gtksizerequest.c line 552
  • #36 gtk_window_get_preferred_width
    at gtkwindow.c line 6513
  • #37 compute_size_for_orientation
    at gtksizerequest.c line 359
  • #38 gtk_widget_get_preferred_size
    at gtksizerequest.c line 694
  • #39 gtk_window_compute_hints
    at gtkwindow.c line 7522
  • #40 gtk_window_compute_configure_request
    at gtkwindow.c line 6844
  • #41 gtk_window_show
    at gtkwindow.c line 4850
  • #42 g_closure_invoke
    at gclosure.c line 777
  • #43 signal_emit_unlocked_R
    at gsignal.c line 3481
  • #44 g_signal_emit_valist
    at gsignal.c line 3300
  • #45 g_signal_emit
    at gsignal.c line 3356
  • #46 gtk_widget_show
    at gtkwidget.c line 4044
  • #47 gtk_widget_show
    at gtkwidget.c line 4021
  • #48 gtk_print_operation_run
    at gtkprintoperation.c line 3223
  • #49 gedit_print_job_print
    at gedit-print-job.c line 828
  • #50 gedit_tab_print_or_print_preview
    at gedit-tab.c line 2772
  • #51 g_closure_invoke
    at gclosure.c line 777
  • #52 signal_emit_unlocked_R
    at gsignal.c line 3551
  • #53 g_signal_emit_valist
    at gsignal.c line 3300
  • #54 g_signal_emit
    at gsignal.c line 3356
  • #55 _gtk_action_emit_activate
    at gtkaction.c line 801
  • #56 gtk_action_activate
    at gtkaction.c line 832
  • #57 button_clicked
    at gtktoolbutton.c line 877
  • #58 _g_closure_invoke_va
    at gclosure.c line 840
  • #59 g_signal_emit_valist
    at gsignal.c line 3211
  • #60 g_signal_emit
    at gsignal.c line 3356
  • #61 gtk_real_button_released
    at gtkbutton.c line 1967
  • #62 g_closure_invoke
    at gclosure.c line 777
  • #63 signal_emit_unlocked_R
    at gsignal.c line 3481
  • #64 g_signal_emit_valist
    at gsignal.c line 3300
  • #65 g_signal_emit
    at gsignal.c line 3356
  • #66 gtk_button_button_release
    at gtkbutton.c line 1802
  • #67 gtk_button_button_release
    at gtkbutton.c line 1794
  • #68 _gtk_marshal_BOOLEAN__BOXEDv
    at gtkmarshalers.c line 130
  • #69 _g_closure_invoke_va
    at gclosure.c line 840
  • #70 g_signal_emit_valist
    at gsignal.c line 3211
  • #71 g_signal_emit
    at gsignal.c line 3356
  • #72 gtk_widget_event_internal
    at gtkwidget.c line 6303
  • #73 gtk_widget_event
    at gtkwidget.c line 5960
  • #74 propagate_event_up
    at gtkmain.c line 2397
  • #75 propagate_event
    at gtkmain.c line 2505
  • #76 gtk_main_do_event
    at gtkmain.c line 1720
  • #77 gdk_event_source_dispatch
    at gdkeventsource.c line 358
  • #78 g_main_dispatch
    at gmain.c line 2715
  • #79 g_main_context_dispatch
    at gmain.c line 3219
  • #80 g_main_context_iterate
    at gmain.c line 3290
  • #81 g_main_loop_run
    at gmain.c line 3484
  • #82 gtk_main
    at gtkmain.c line 1160
  • #83 gedit_main
    at gedit.c line 205
  • #84 main
    at gedit.c line 331

Comment 2 Kamil Páral 2013-01-06 21:19:41 UTC
Transmission crashes as well:
https://bugzilla.redhat.com/show_bug.cgi?id=892359
Comment 3 Alexandre Rostovtsev 2013-01-06 21:42:37 UTC
And evolution-3.6.2 is affected too (crashes when opening a contact): https://bugs.gentoo.org/show_bug.cgi?id=450476
Comment 4 Benjamin Otte (Company) 2013-01-06 22:11:28 UTC
Created attachment 232886 [details] [review]
stylecontext: Make font hack not crash

It's a lot uglier now, but it shouldn't crash anymore.

We must update the font description for animations, but we can't free it
on query, because some paths call gtk_style_context_get_font() twice in
a row without stopping the use of the first call. So us just creating a
new font description all the time and unreffing the old one is not a
good idea. So we just mere the new one into the old one.