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 585589 - GtkCalendar with LC_TIME specified: Segfault
GtkCalendar with LC_TIME specified: Segfault
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkCalendar
2.14.x
Other All
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-06-12 16:55 UTC by Mephinet
Modified: 2009-09-30 20:20 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
minimal glade file to reproduce (584 bytes, application/xml)
2009-06-12 16:56 UTC, Mephinet
Details

Description Mephinet 2009-06-12 16:55:23 UTC
Steps to reproduce:
When clicking on the xfce datetime plugin in the xfce panel, xfce4-panel dies
with a segmentation fault. In order to reproduce the behavior, I tried glade, with the same result:
when you download the minimal glade file attached (only contains a main window and gtkcalendar) and start glade with the locale settings specified, below, I receive a segmentation fault. If I set LC_TIME back to C, glade starts fine.
My locate settings:
$ locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC=de_AT@euro
LC_TIME=de_AT@euro
LC_COLLATE="C"
LC_MONETARY=de_AT@euro
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=

Seen on a Gentoo Linux amd64 notebook.

Stack trace:
  • #0 strlen
    from /lib/libc.so.6
  • #1 pango_layout_set_text
    at pango-layout.c line 1059
  • #2 gtk_calendar_size_request
    at gtkcalendar.c line 1790
  • #3 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #4 ??
    from /usr/lib/libgobject-2.0.so.0
  • #5 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #6 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #7 do_size_request
    at gtksizegroup.c line 620
  • #8 _gtk_size_group_compute_requisition
    at gtksizegroup.c line 820
  • #9 IA__gtk_widget_size_request
    at gtkwidget.c line 3695
  • #10 gtk_frame_size_request
    at gtkframe.c line 625
  • #11 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #12 ??
    from /usr/lib/libgobject-2.0.so.0
  • #13 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #14 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #15 do_size_request
    at gtksizegroup.c line 620
  • #16 _gtk_size_group_compute_requisition
    at gtksizegroup.c line 820
  • #17 IA__gtk_widget_size_request
    at gtkwidget.c line 3695
  • #18 gtk_window_size_request
    at gtkwindow.c line 4740
  • #19 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #20 ??
    from /usr/lib/libgobject-2.0.so.0
  • #21 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #22 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #23 do_size_request
    at gtksizegroup.c line 620
  • #24 _gtk_size_group_compute_requisition
    at gtksizegroup.c line 820
  • #25 IA__gtk_widget_size_request
    at gtkwidget.c line 3695
  • #26 gtk_window_compute_configure_request
    at gtkwindow.c line 5609
  • #27 gtk_window_show
    at gtkwindow.c line 4291
  • #28 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #29 ??
    from /usr/lib/libgobject-2.0.so.0
  • #30 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #31 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #32 IA__gtk_widget_show
    at gtkwidget.c line 3003
  • #33 gtk_container_show_all
    at gtkcontainer.c line 2551
  • #34 IA__gtk_widget_show_all
    at gtkwidget.c line 3151
  • #35 pop_calendar_window
    at datetime.c line 383
  • #36 datetime_clicked
    at datetime.c line 415
  • #37 _gtk_marshal_BOOLEAN__BOXED
Other information:
Comment 1 Mephinet 2009-06-12 16:56:08 UTC
Created attachment 136454 [details]
minimal glade file to reproduce
Comment 2 Gilles Dartiguelongue 2009-09-07 19:56:57 UTC
Update from our downstream bug:

------ Comment #11 From Gilles Dartiguelongue 2009-09-07 19:01:58 0000 [reply] -------
So a null size string is passed to pango which calls strlen which goes crazy
because it's null. The selected locale might have a problem, does it fail if
you select another locale for your LC_TIME ?

------- Comment #12 From mephinet 2009-09-07 19:17:02 0000 [reply] -------
(In reply to comment #11)
> The selected locale might have a problem, does it fail if
> you select another locale for your LC_TIME ?

Segfault also occurs with LC_TIME=fr_FR and es_ES, with the rest of the LC_*
variables left unchanged (as listed in the bug description).
If I also set LC_ALL to es_ES or fr_FR, no segfault happens.
This might indicate that the bug is only triggered if multiple locales are
mixed.

------- Comment #13 From mephinet 2009-09-07 19:21:50 0000 [reply] -------
Further examination shows:
if LC_TIME is set to a non-C value, then LC_CTYPE must not be set to C.
E.g.:

This one segfaults:
LC_CTYPE=C
LC_TIME=fr_FR
(all other) = C

This one does not:
LC_CTYPE=de_AT
LC_TIME=fr_FR
(all other) = C
Comment 3 Mart Raudsepp 2009-09-28 14:17:43 UTC
I believe it crashes because we had a packaging bug in some versions of pango (passing of --disable-debug instead of --enable-debug=minimal) and the g_return_val_if_fail (length == 0 || text != NULL) code wasn't included therefore, and it got to go forward and then crash on strlen.

However, g_return_val_if_fail is used to catch bad API usage and with --enable-debug=minimal (the default) it will signal a critical warning instead. This still is a problem that warrants fixing
Comment 4 Mephinet 2009-09-30 20:20:27 UTC
(In reply to comment #3)
> I believe it crashes because we had a packaging bug in some versions of pango
> (passing of --disable-debug instead of --enable-debug=minimal) and the
> g_return_val_if_fail (length == 0 || text != NULL) code wasn't included
> therefore, and it got to go forward and then crash on strlen.
> 
> However, g_return_val_if_fail is used to catch bad API usage and with
> --enable-debug=minimal (the default) it will signal a critical warning instead.
> This still is a problem that warrants fixing

Dear Mart,
thanks for the hint, when compiling pango without the --disable-debug configure switch, the segfault no longer occurs. Instead, the expected output shows:

(glade-3:28484): Pango-CRITICAL **: pango_layout_set_text: assertion `length == 0 || text != NULL' failed