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 569113 - calendar popup crashes on platform with 64-bit time_t
calendar popup crashes on platform with 64-bit time_t
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: clock
2.24.x
Other All
: Normal critical
: ---
Assigned To: Panel Maintainers
Panel Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-01-25 18:51 UTC by Matthias Drochner
Modified: 2009-08-11 18:55 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
patch to calendar-client.c (1.01 KB, patch)
2009-02-18 17:19 UTC, Matthias Drochner
none Details | Review
use time_t instead of GTime (14.37 KB, patch)
2009-03-05 10:16 UTC, Matthias Drochner
committed Details | Review

Description Matthias Drochner 2009-01-25 18:51:04 UTC
Steps to reproduce:
1. on NetBSD-current/i386 (where time_t is 64-bit)
2. have some holiday calendar active
3. click in clock to get calendar popup


Stack trace:


Other information:
Callback confuses time_t and GTime (likely works on native 64-bit
platforms because ABI passes 32-bit argument in 64-bit registers).

$NetBSD: patch-ab,v 1.5 2009/01/25 17:03:31 drochner Exp $

--- applets/clock/calendar-client.c.orig        2009-01-13 01:02:20.000000000 +0100
+++ applets/clock/calendar-client.c
@@ -909,8 +909,8 @@ resolve_timezone_id (const char *tzid,
 
 static gboolean
 calendar_appointment_collect_occurrence (ECalComponent  *component,
-                                        GTime           occurrence_start,
-                                        GTime           occurrence_end,
+                                        time_t           occurrence_start,
+                                        time_t           occurrence_end,
                                         GSList        **collect_loc)
 {
   CalendarOccurrence *occurrence;
Comment 1 Matthias Drochner 2009-02-18 17:19:04 UTC
Created attachment 128999 [details] [review]
patch to calendar-client.c

Attaching the patch the right way.
(slightly modified from the original one to avoid a typecast so that
the compiler has a chance to detect the mismatch)
Comment 2 Vincent Untz 2009-03-03 16:57:56 UTC
Matthias: indeed better to attach it as a patch.

We might have other similar issues. Can you quickly check that we can safely change all the GTime to time_t in the clock applet?
Comment 3 Matthias Drochner 2009-03-05 10:14:05 UTC
> We might have other similar issues

Yes, but the other uses of GTime just lead to silent truncation
of time_values to longs, ie. Y2037 issues, not to crashes.

> Can you quickly check that we can safely
> change all the GTime to time_t in the clock applet?

A little bit more is needed -- the gtk_tree_model uses
G_TYPE_LONG for times. Since there is no G_TYPE for
time_t we need to use the widest possible type (which
is INT64) and do explicit conversions so that it works
for both 32 and 64-bit time_t.
I'll attach a patch which does all this, it is lightly
tested on NetBSD-current/i386.
(With a little change to e-d-s which removes an arbitrary
limitation for recurring events to be valid until 2037 only
I can page beyond 2037 and still get the holidays displayed.
Actually only the fixed ones - easter date etc doesn't
work but I didn't check yet whether this uses a formula or
just a limited table.)
Comment 4 Matthias Drochner 2009-03-05 10:16:04 UTC
Created attachment 130104 [details] [review]
use time_t instead of GTime
Comment 5 Vincent Untz 2009-08-11 18:55:18 UTC
Thanks!