Bug 183202

Summary: alarms are strangely missed
Product: [Applications] kalarm Reporter: Jiri Palecek <jpalecek>
Component: generalAssignee: David Jarvie <djarvie>
Status: CLOSED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: The log. Note what happened on the 23rd, 11 o'clock
changes to the calendar.ics file
calendar

Description Jiri Palecek 2009-02-04 18:03:23 UTC
Version:            (using KDE 4.2.0)
OS:                Linux
Installed from:    Debian testing/unstable Packages

I have a periodic alarm recurring every 14 days. Yesterday, this alarm (or its deferral) fired and I deferred it. However, today, the alarm didn't fire. But it did fire simultaneously with another alarm at 17:30. The alarm window itself says 10:01. Another strange thing is, yesterday, I deferred it for 10:01 hours hoping it would fire in the night (the computer is hibernated through the night).
Comment 1 David Jarvie 2009-02-04 20:17:25 UTC
Can you please attach your alarm calendar containing the alarm. Ideally delete all other VEVENT items except the one in question, otherwise please say which alarm to look at if there might be any doubt. The default alarm calendar file is ~/.kde4/share/apps/kalarm/calendar.ics (assuming your KDE4 config files are in ~/.kde4).

When you say "this alarm (or its deferral)", do you mean that it might already have been deferred when you deferred it (again) yesterday, but you're not sure?

To be sure that I understand correctly what you say, please say

- What time did you defer it to? (If you deferred it by 10:01 hours, what time should it have triggered?)
- Was your computer hibernating at the time it should have triggered?
Comment 2 Jiri Palecek 2009-02-06 13:14:45 UTC
I cannot attach the original alarm (since, obviously, it's gone once it has fired), but a similar case:

BEGIN:VEVENT
DTSTAMP:20090204T170331Z
X-KDE-KALARM-ARCHIVE:0
X-KDE-KALARM-FLAGS:DATE;DEFER;601
X-KDE-KALARM-NEXTRECUR:20090218
X-KDE-KALARM-TYPE:ACTIVE
CREATED:20070710T124056Z
UID:KAlarm-1906626020.755
SEQUENCE:441
LAST-MODIFIED:20090204T170331Z
RRULE:FREQ=WEEKLY;INTERVAL=2;BYDAY=WE
DTSTART;TZID=Europe/Prague:20070711T000000
TRANSP:TRANSPARENT
BEGIN:VALARM
DESCRIPTION:123456
ACTION:DISPLAY
TRIGGER;VALUE=DURATION:PT0S
X-KDE-KALARM-FONTCOLOR:#ff0000;#000000;
END:VALARM

BEGIN:VALARM
DESCRIPTION:123456
ACTION:DISPLAY
TRIGGER;VALUE=DURATION:-P12DT19H56M
X-KDE-KALARM-FONTCOLOR:#ff0000;#000000;
X-KDE-KALARM-TYPE:DEFERRAL
END:VALARM

END:VEVENT

AFAIK, it should have fired yesterday 4 am. It hasn't however. (the computer was hibernated at 4 am)

BTW couldn't the to 10:01/by 10:01 inconsistency be caused by the alarm being postponed past its next recurrence? Although I might have just confused the two input boxes.
Comment 3 David Jarvie 2009-02-16 14:04:50 UTC
Am I right in thinking that alarms only show this problem if they are due to fire while the computer is hibernating?
Comment 4 Jiri Palecek 2009-02-18 13:30:07 UTC
It seems so, but it isn't 100% (sometimes, the alarm is normally shown). Can I do something to track it down?
Comment 5 David Jarvie 2009-02-18 13:40:53 UTC
Just to be absolutely sure what you mean, please tell me if my understanding is correct:

1) The problem only occurs when an alarm is due to fire while the computer is hibernating.

2) Sometimes, but not usually, an alarm which was due when the computer was hibernating does fire when the system resumes.
Comment 6 Jiri Palecek 2009-02-18 14:35:21 UTC
Yes, something like that
Comment 7 David Jarvie 2009-02-21 17:13:47 UTC
It works correctly on my system (also Debian testing, but self-compiled KDE, not Debian KDE 4 packages). Would you be able to install the kdepim debug package (kdepim-dbg) and capture KAlarm's debug output? You'd need to make a copy before you hibernated of KAlarm's calendar file, divert KAlarm's debug output to a file using 'kdebugdialog --fullmode', and then send the calendar and debug file to me if the alarm failed to trigger when the system awoke from hibernation.
Comment 8 Jiri Palecek 2009-02-21 22:49:01 UTC
Thanks for the advice, I didn't know about kdebugdialog. I suppose, however, I don't need kdepim-dbg for this, these are debug symbols and I presume it won't crash. However, I got a crash a little while after I got your mail. Maybe you have forseen it :-) Sadly the backtrace is of no use even with kdepim-dbg.

Anyway, I set the debug output to syslog (only kalarm, not kalarm(resources)), and set up filetraq on the config files, so we'll see.
Comment 9 David Jarvie 2009-02-23 00:58:17 UTC
It's better to send the output to a separate file so to avoid mixing it up with other system stuff. Also, if you can enable kalarm(resources), that might help too. Basically you can delete the log file just before you hibernate, so that it doesn't fill up with too much irrelevant stuff. Then, if an alarm fails to trigger when you resume from hibernation, copy the file soon after resuming, and that hopefully will give me a clue as to what's going on.
Comment 10 Jiri Palecek 2009-02-24 13:40:48 UTC
So, the problem doesn't seem to be related to hibernation, but rather to repeated deferrals. I'll send the log, the calendar.ics file and the changes it underwent.
Comment 11 Jiri Palecek 2009-02-24 13:42:43 UTC
Created attachment 31603 [details]
The log. Note what happened on the 23rd, 11 o'clock
Comment 12 Jiri Palecek 2009-02-24 14:00:27 UTC
Created attachment 31606 [details]
changes to the calendar.ics file
Comment 13 Jiri Palecek 2009-02-24 14:03:58 UTC
Created attachment 31607 [details]
calendar
Comment 14 David Jarvie 2009-02-25 18:53:04 UTC
Thanks for the files. Looking at them, it seems that you had an alarm deferred to 04:08 on 23rd February. At that time, your system was hibernating, but the alarm triggered at 11:09 on that day, just after the system resumed. 1.5 minutes later, you then deferred the alarm again to 07:11 on 24th February, but despite not hibernating the system before that, the alarm did not trigger at that time.

Can you please confirm whether that is correct. If not, please indicate what went wrong.
Comment 15 Jiri Palecek 2009-02-28 02:09:57 UTC
Yes, approximately. Your description is only inaccurate in the fact that the system was hibernated on 24th, 07:11. But, I thing that the whole hibernation thing is a red herring here. I may be wrong, but I conclude that from the fact that the checkNextDueAlarm reported alarm ID changes when the event fires (to an alarm that would trigger on 25th), but doesn't reflect the redeferral.
Comment 16 David Jarvie 2009-03-28 20:42:38 UTC
Now fixed for KDE 4.2.3 (SVN commits 946164, 946166).

The bug occurred when a recurring alarm, whose next due recurrence is after the time another alarm is due, is deferred to a time before that alarm is due.