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 588678 - pango crash: install a new theme from gnome-appearance-properties
pango crash: install a new theme from gnome-appearance-properties
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.24.x
Other All
: Normal critical
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2009-07-15 16:09 UTC by Romain Perier
Modified: 2009-07-15 19:49 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26



Description Romain Perier 2009-07-15 16:09:05 UTC
Steps to reproduce:
1. open gnome-appearance-properties 
2. install black-white_2-Style icons theme
3. gnome-appearance-properties crash


Stack trace:
Distribution: Gentoo Base System release 2.0.1
Gnome Release: 2.26.3 2009-07-14 (Gentoo)
BugBuddy Version: 2.26.0

System: Linux 2.6.30-gentoo-r2 #6 SMP Tue Jul 14 03:26:55 CEST 2009 x86_64
X Vendor: The X.Org Foundation
X Vendor Release: 10602000
Selinux: No
Accessibility: Disabled
GTK+ Theme: BlackRain
Icon Theme: gnome
GTK+ Modules: canberra-gtk-module, gnomebreakpad

Memory status: size: 322437120 vsize: 322437120 resident: 25313280 share: 14319616 rss: 25313280 rss_rlim: 18446744073709551615
CPU usage: start_time: 1247562181 rtime: 47 utime: 43 stime: 4 cutime:0 cstime: 0 timeout: 0 it_real_value: 0 frequency: 100

Backtrace was generated from '/usr/bin/gnome-appearance-properties'

[Thread debugging using libthread_db enabled]
[New Thread 0x7f3f499d1740 (LWP 18123)]
[New Thread 0x7f3f3b7e5910 (LWP 18130)]
0x00007f3f483bca6f in __libc_waitpid (pid=18131, stat_loc=0x7fffab3f55b0, 
    options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:41
	in ../sysdeps/unix/sysv/linux/waitpid.c

Thread 1 (Thread 0x7f3f499d1740 (LWP 18123))

  • #0 __libc_waitpid
    at ../sysdeps/unix/sysv/linux/waitpid.c line 41
  • #1 IA__g_spawn_sync
    at gspawn.c line 382
  • #2 IA__g_spawn_command_line_sync
    at gspawn.c line 694
  • #3 bugbuddy_segv_handle
    at gnome-breakpad.cc line 369
  • #4 <signal handler called>
  • #5 pango_shape
    at shape.c line 120
  • #6 shape_run
    at pango-layout.c line 3133
  • #7 process_item
    at pango-layout.c line 3243
  • #8 pango_layout_check_lines
    at pango-layout.c line 3538
  • #9 pango_layout_get_extents_internal
    at pango-layout.c line 2444
  • #10 gtk_label_size_request
    at gtklabel.c line 2605
  • #11 IA__g_closure_invoke
    at gclosure.c line 767
  • #12 signal_emit_unlocked_R
    at gsignal.c line 3177
  • #13 IA__g_signal_emit_valist
    at gsignal.c line 2980
  • #14 IA__g_signal_emit_by_name
    at gsignal.c line 3074
  • #15 _gtk_size_group_compute_requisition
    at gtksizegroup.c line 820
  • #16 gtk_box_size_request
    at gtkbox.c line 280
  • #17 IA__g_closure_invoke
    at gclosure.c line 767
  • #18 signal_emit_unlocked_R
    at gsignal.c line 3177
  • #19 IA__g_signal_emit_valist
    at gsignal.c line 2980
  • #20 IA__g_signal_emit_by_name
    at gsignal.c line 3074
  • #21 _gtk_size_group_compute_requisition
    at gtksizegroup.c line 820
  • #22 gtk_box_size_request
    at gtkbox.c line 280
  • #23 IA__g_closure_invoke
    at gclosure.c line 767
  • #24 signal_emit_unlocked_R
    at gsignal.c line 3177
  • #25 IA__g_signal_emit_valist
    at gsignal.c line 2980
  • #26 IA__g_signal_emit_by_name
    at gsignal.c line 3074
  • #27 _gtk_size_group_compute_requisition
    at gtksizegroup.c line 820
  • #28 gtk_window_size_request
    at gtkwindow.c line 4913
  • #29 IA__g_closure_invoke
    at gclosure.c line 767
  • #30 signal_emit_unlocked_R
    at gsignal.c line 3177
  • #31 IA__g_signal_emit_valist
    at gsignal.c line 2980
  • #32 IA__g_signal_emit_by_name
    at gsignal.c line 3074
  • #33 _gtk_size_group_compute_requisition
    at gtksizegroup.c line 820
  • #34 gtk_window_compute_configure_request
    at gtkwindow.c line 5782
  • #35 gtk_window_check_resize
    at gtkwindow.c line 5994
  • #36 IA__g_closure_invoke
    at gclosure.c line 767
  • #37 signal_emit_unlocked_R
    at gsignal.c line 3285
  • #38 IA__g_signal_emit_valist
    at gsignal.c line 2980
  • #39 IA__g_signal_emit
    at gsignal.c line 3037
  • #40 gtk_container_idle_sizer
    at gtkcontainer.c line 1350
  • #41 gdk_threads_dispatch
    at gdk.c line 498
  • #42 IA__g_main_context_dispatch
    at gmain.c line 1824
  • #43 g_main_context_iterate
    at gmain.c line 2455
  • #44 IA__g_main_loop_run
    at gmain.c line 2663
  • #45 IA__gtk_main
    at gtkmain.c line 1205
  • #46 main
    at appearance-main.c line 201


----------- .xsession-errors ---------------------
** (evolution:17722): DEBUG: mailto URL command: evolution %s
** (evolution:17722): DEBUG: mailto URL program: evolution
gnome-session[7676]: WARNING: Could not connect to ConsoleKit: Could not get owner of name 'org.freedesktop.ConsoleKit': no such name
gnome-session[7676]: WARNING: Could not connect to ConsoleKit: Could not get owner of name 'org.freedesktop.ConsoleKit': no such name
(gnome-appearance-properties:18124): Gtk-WARNING **: Impossible de trouver le moteur de thème dans module_path : « hcengine »
(gnome-appearance-properties:18124): Gtk-WARNING **: Impossible de trouver le moteur de thème dans module_path : « hcengine »
(gnome-appearance-properties:18124): Gtk-WARNING **: Impossible de trouver le moteur de thème dans module_path : « hcengine »
(gnome-appearance-properties:18124): Gtk-WARNING **: Impossible de trouver le moteur de thème dans module_path : « hcengine »
(gnome-appearance-properties:18123): Pango-WARNING **: shaping failure, expect ugly output. shape-engine='BasicEngineFc', font='DejaVu Sans Bold 12', text=''
41	../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
--------------------------------------------------


Other information:
Hi,
When I try to install black-white_2-Style icons theme, or a Gtk theme (like Overglossed theme) gnome-appearance-properties crash.

Apparently due to pango_shape function (pango/shape.c line 120 from pango tarball), due to this line "last_cluster = glyphs->log_clusters[0] - 1;"
In the case where glyphs->log_clusters is NULL, this gint * is unreferenced, which causes the segfault.

A ugly way to solve the problem could be add a g_return_if_fail (glyphs->log_clusters != NULL) before this line, however pango_shape needs to shape even in case of criticals problem (the for loop would be skipped in this case)

I had a quick look into pango source code, and apparently the problem could be happen in _pango_engine_shape_shape (but I'm not really sure).

Feel free to ask me, more details if necessary.
mrpouet
Comment 1 Behdad Esfahbod 2009-07-15 17:01:49 UTC
Indeed, the question is why glyphs->log_clusters may be zero-length.  Helps if you can debug this yourself. 
Comment 2 Behdad Esfahbod 2009-07-15 18:02:23 UTC
This doesn't look right:

  • #5 pango_shape
    at shape.c line 120

the text is not 41 bytes long and pango-layout doesn't allow NUL bytes.  So I'm not sure how it has got there.  Committed some changes to handle such cases anyway.  Can you try with master?
Comment 3 Romain Perier 2009-07-15 19:41:47 UTC
Patch imported from master into my personnal overlay (I need to test it before commit it into the gentoo main tree) It's works ! good works , and nice code :)

Actually I don't know pango source code well enough, otherwise It would be a pleasure to attach a patch and to help you :)

thanks again ;)
Comment 4 Behdad Esfahbod 2009-07-15 19:49:01 UTC
Cool.  Lets close then.  Still I'm not sure how that NUL byte got there.  So there may be a bug somewhere else.