Description of problem: I'm trying to add an event on the 8th of June. There already is an event on that day in my calendar. Start date is the 8th of June. By default end date is marked as being the 9th of June, but I try to change that to the 8th as it's a short event. When I click on the calendar widget to select the 8th of June, GNOME Calendar crashes. Version-Release number of selected component: gnome-calendar-3.16.2-1.fc22 Additional info: reporter: libreport-2.5.1 backtrace_rating: 4 cmdline: /usr/bin/gnome-calendar --gapplication-service crash_function: ____strtol_l_internal executable: /usr/bin/gnome-calendar global_pid: 32536 kernel: 4.0.4-301.fc22.x86_64 runlevel: N 5 type: CCpp uid: 1000 Truncated backtrace: Thread no. 1 (10 frames) #0 ____strtol_l_internal at ../stdlib/strtol_l.c:297 #1 __strtol at ../stdlib/strtol.c:109 #2 atoi at /usr/include/stdlib.h:280 #3 parse_entries at gcal-date-selector.c:135 #4 date_entry_focus_out at gcal-date-selector.c:114 #5 _gtk_marshal_BOOLEAN__BOXED at gtkmarshalers.c:85 #10 gtk_widget_event_internal at gtkwidget.c:7787 #11 gtk_widget_send_focus_change at gtkwidget.c:16160 #12 do_focus_change at gtkwindow.c:7943 #13 gtk_window_real_set_focus at gtkwindow.c:8229
Created attachment 1033209 [details] File: backtrace
Created attachment 1033210 [details] File: cgroup
Created attachment 1033211 [details] File: core_backtrace
Created attachment 1033212 [details] File: dso_list
Created attachment 1033213 [details] File: environ
Created attachment 1033214 [details] File: limits
Created attachment 1033215 [details] File: maps
Created attachment 1033216 [details] File: mountinfo
Created attachment 1033217 [details] File: namespaces
Created attachment 1033218 [details] File: open_fds
Created attachment 1033219 [details] File: proc_pid_status
Created attachment 1033220 [details] File: var_log_messages
So the crash happens at line 135 of the src/gcal-date-selector.c file: static void parse_entries (GcalDateSelector *selector) { [... snip ...] day = atoi (gtk_entry_get_text (GTK_ENTRY (priv->entries[DAY]))); month = atoi (gtk_entry_get_text (GTK_ENTRY (priv->entries[MONTH]))); year = atoi (gtk_entry_get_text (GTK_ENTRY (priv->entries[YEAR]))); [... snip ...] } That's the "year = ..." line above. I've set a breakpoint on that line with gdb, and here's what I get: (gdb) p priv->entries[YEAR] $4 = 0x0 (gdb) p priv->entries[MONTH] $5 = 0x9bb200 [GtkEntry] (gdb) p priv->entries[DAY] $6 = 0x9bb440 [GtkEntry] So the year entry is pointing to NULL, which doesn't seem like the expected value. :)
Created attachment 1033378 [details] Screenshot of the date editing dialog This is a screenshot of the dialog I get when trying to add an event to my calendar. Clearly, you can see that the year entry is empty. This is what causes the crash, as soon as I do anything that closes the date-picker. (for example, select a date, or just click anywhere outside the date picker) My locale is en_HK.utf8. If I run GNOME Calendar as follows: $ LC_TIME=C gnome-calendar Then everything works as expected. Same with: $ LC_TIME=en_US.utf8 gnome-calendar However, with the en_HK.utf8 locale: $ LC_TIME=en_HK.utf8 gnome-calendar (gnome-calendar:8055): Gtk-CRITICAL **: gtk_label_set_text: assertion 'GTK_IS_LABEL (label)' failed (gnome-calendar:8055): Gtk-CRITICAL **: gtk_label_set_text: assertion 'GTK_IS_LABEL (label)' failed (gnome-calendar:8055): Gtk-CRITICAL **: gtk_entry_set_text: assertion 'GTK_IS_ENTRY (entry)' failed (gnome-calendar:8055): Gtk-CRITICAL **: gtk_entry_set_text: assertion 'GTK_IS_ENTRY (entry)' failed Those critical warnings show up with this locale, indicating that something is wrong with some labels/entries, and then eventually, I get the attached screenshot, and the crash.
So here's what I think is happening. At gcal-date-selector.c:236 there is this line: priv->mask = nl_langinfo (D_FMT); When running with LC_TIME=C, priv->mask will point to the "%m/%d/%y" string. The rest of the code in that same function tries to identify the order in which to show the day, month and year widgets for the user locale, based on that date mask. When running with LC_TIME=C, that will end up being: (gdb) p priv->month_pos $1 = 0 (gdb) p priv->day_pos $2 = 1 (gdb) p priv->year_pos $3 = 2 When showing the entry widgets, the entry 0 will thus contain the month, the entry 1 will contain the day, and the entry 2 will contain the year. However, when running with LC_TIME=en_HK.utf8, priv-mask will point to the "%A, %B %d, %Y" string. As a result, we get: (gdb) p priv->month_pos $1 = 1 (gdb) p priv->day_pos $2 = 2 (gdb) p priv->year_pos $3 = 3 This is because there are two identifiers for the day in this locale (%A and %d), which bumps all values off by one. When showing the entry widgets, the entry 0 will thus contain... well, nothing, as can be seen on my screenshot. :) The entry 1 will contain the month, entry 2 the day. And there's no entry for the year, because entries are only 0, 1 and 2, not 3, which explains why priv->entries[YEAR] is NULL, as shown in comment 13.
Closing this issue as it is old. If you still think that it exists - reopen please. Thanks!