https://bugs.kde.org/show_bug.cgi?id=528953

            Bug ID: 528953
           Summary: Infinite loop in rescheduleAlarm() when a
                    working-hours-only floating-time alarm's next
                    occurrence is in the repeated DST hour
    Classification: Applications
           Product: kalarm
      Version First 3.13.2
       Reported In:
          Platform: Fedora RPMs
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Environment
kalarm 26.08.3 (KAlarm 3.13.2), KF6 6.32.0, Qt 6.11.2, Plasma 6.8.3 Wayland,
Fedora 44. Time zone America/Chicago; working hours 10:00-16:30.

SUMMARY
Since I want to help my lifespan by not having a sedentary lifestyle, I set a
kalarm to tell me to get up and walk around at regular intervals. After the DST
change, kalarm stopped working.

Since the fall-back (2026-11-01), KAlarm hangs at 100% CPU on every startup.
KWin's "not responding Wait / Terminate" dialog box then kills it with SIGABRT,
so DrKonqi reports a crash in KCrash, but nothing faults: the core shows the
signal arrived mid-syscall with si_code SI_USER.

ALARM (from calendar.ics)
  X-KDE-KALARM-FLAGS;VALUE=TEXT:LOCAL\;NOINHIBIT\;WORKTIME\;NOTIFY\;
  X-KDE-KALARM-NEXTRECUR;VALUE=TEXT:20261101T010000
  RRULE:FREQ=MINUTELY;INTERVAL=30
  DTSTART:20261019T160000   (floating)

STEPS TO REPRODUCE

1. In a DST time zone, create an alarm recurring every 30 min with "only during
working hours" and a floating (ignore time zone) time.
2. Let its next recurrence fall in the repeated hour on the DST-end night.
3. Start KAlarm afterwards. Result: KAlarm hangs. Expected: it schedules the
next in-hours occurrence.

ANALYSIS
Main thread is in this loop (kalarmapp.cpp ~2105-2154):
    do {
        event.setNextOccurrence(next ? next_dt : now, type);
        next_dt = event.mainDateTime(true).effectiveKDateTime();
        next = event.excludedByWorkTimeOrHoliday(next_dt);
    } while (next && next_dt <= now);
Stack: processQueue → handleEvent → rescheduleAlarm:2152 →
excludedByWorkTimeOrHoliday → KADateTime::toTimeSpec →
QTimeZone::systemTimeZone.
In the core, next_dt = 2026-11-01 01:30 CDT (m2ndOccurrence = false) while now
= 2026-11-16 10:03 CST. next_dt never moves past the repeated hour, and every
candidate there is outside working hours and in the past, so the loop never
exits. The floating occurrences probably always resolve to the first (CDT)
instance; I haven't traced the exact step.

SUGGESTED FIX
Require next_dt to strictly increase each iteration (or cap iterations), and
carry m2ndOccurrence when stepping through a repeated hour.

WORKAROUND
With KAlarm stopped, set X-KDE-KALARM-NEXTRECUR in calendar.ics to a future
time and remove the stale disp-<uid> event from displaying.ics.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to