Bug 464251 - If you pause a timer, KClock will ring an alarm at the moment the timer would have finished.
Summary: If you pause a timer, KClock will ring an alarm at the moment the timer would...
Status: RESOLVED FIXED
Alias: None
Product: KClock
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Manjaro Linux
: NOR major
Target Milestone: ---
Assignee: Devin Lin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-13 20:08 UTC by pawlowski486
Modified: 2023-01-19 16:19 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pawlowski486 2023-01-13 20:08:23 UTC
SUMMARY
If you start an timer then pause it, KClock will ring the next active alarm at the moment the timer would have reached zero (if the timer hadn't been paused.)

STEPS TO REPRODUCE
1. Create an alarm. Any type of alarm will work (one time, repeating, custom name, custom sound, etc.).
2. Create a timer. The glitch will probably work with a timer of any length, but I have only tried it with timers 10 seconds or shorter.
3. Start the timer, then pause it.
4. Wait the remaining time of the paused timer. For example, if you pause the timer when there are 8 seconds remaining, you'll need to wait 8 seconds.

OBSERVED RESULT
Even though the timer is paused and the alarm shouldn't go off until some time in the distant future, the alarm will ring.

EXPECTED RESULT
Since the timer is paused and the alarm is set for a long time in the future, you would expect nothing to happen.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Kernel Version 5.15.85-1-MANJARO (64-bit)
(available in About System)
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7
App version 22.11, Distributed by Flathub.

ADDITIONAL INFORMATION
1. An alarm must be enabled when you pause the timer. If you pause the timer first, then enable the alarm second, the alarm will not ring.
2. If you resume the timer, the alarm will not ring. The timer will ring when it reaches 0. However, if you pause the timer again, the alarm will ring after the remaining timer time.
3. Resetting or deleting a paused timer will not stop the alarm from ringing. Closing the app won't stop the alarm from ringing, either.
4. Disabling and re-enabling the alarm, changing the alarm time, or deleting the alarm will stop the alarm from ringing.
Comment 1 Devin Lin 2023-01-14 07:18:38 UTC
I am having a hard time trying to reproduce this bug. Could you please try running kclockd manually (flatpak run --command=kclockd org.kde.kclock) and giving me the output when triggering the bug?
Comment 2 pawlowski486 2023-01-15 01:46:39 UTC
(In reply to Devin Lin from comment #1)
> I am having a hard time trying to reproduce this bug. Could you please try
> running kclockd manually (flatpak run --command=kclockd org.kde.kclock) and
> giving me the output when triggering the bug?

First, here's a video of me performing the glitch: https://icefangvault.myusa.cloud/index.php/s/PL5aJstzJCPjfFd OBS used a format that Firefox can't play, so you may need to open it in VLC.

Here's the console output, but it doesn't seem to have anything to do with the issue I'm having:

[wolfi@The-Iceberg ~]$ flatpak run --command=kclockd org.kde.kclock
[wolfi@The-Iceberg ~]$ flatpak run org.kde.kclock
qrc:/qml/time/TimePage.qml:18:1: QML TimePage: Binding loop detected for property "implicitHeight"
file:///usr/lib/qml/org/kde/kirigami.2/ContextDrawer.qml:132:9: QML ListView: Binding loop detected for property "topMargin"
qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected for property "y"
qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected for property "y"
qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected for property "y"
qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected for property "y"
qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected for property "y"
qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected for property "y"
qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected for property "y"
qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected for property "y"
qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected for property "y"
qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected for property "y"
qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected for property "y"
qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected for property "y"
file:///usr/lib/qml/org/kde/kirigami.2/ContextDrawer.qml:132:9: QML ListView: Binding loop detected for property "topMargin"
file:///usr/lib/qml/org/kde/kirigami.2/ContextDrawer.qml:132:9: QML ListView: Binding loop detected for property "topMargin"
Comment 3 Devin Lin 2023-01-19 05:49:50 UTC
(In reply to pawlowski486 from comment #2)
> (In reply to Devin Lin from comment #1)
> > I am having a hard time trying to reproduce this bug. Could you please try
> > running kclockd manually (flatpak run --command=kclockd org.kde.kclock) and
> > giving me the output when triggering the bug?
> 
> First, here's a video of me performing the glitch:
> https://icefangvault.myusa.cloud/index.php/s/PL5aJstzJCPjfFd OBS used a
> format that Firefox can't play, so you may need to open it in VLC.
> 
> Here's the console output, but it doesn't seem to have anything to do with
> the issue I'm having:
> 
> [wolfi@The-Iceberg ~]$ flatpak run --command=kclockd org.kde.kclock
> [wolfi@The-Iceberg ~]$ flatpak run org.kde.kclock
> qrc:/qml/time/TimePage.qml:18:1: QML TimePage: Binding loop detected for
> property "implicitHeight"
> file:///usr/lib/qml/org/kde/kirigami.2/ContextDrawer.qml:132:9: QML
> ListView: Binding loop detected for property "topMargin"
> qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected
> for property "y"
> qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected
> for property "y"
> qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected
> for property "y"
> qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected
> for property "y"
> qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected
> for property "y"
> qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected
> for property "y"
> qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected
> for property "y"
> qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected
> for property "y"
> qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected
> for property "y"
> qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected
> for property "y"
> qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected
> for property "y"
> qrc:/qml/timer/TimerFormWrapper.qml:98:9: QML Dialog: Binding loop detected
> for property "y"
> file:///usr/lib/qml/org/kde/kirigami.2/ContextDrawer.qml:132:9: QML
> ListView: Binding loop detected for property "topMargin"
> file:///usr/lib/qml/org/kde/kirigami.2/ContextDrawer.qml:132:9: QML
> ListView: Binding loop detected for property "topMargin"

Ahh, sorry for the delay.

So if there are no logs when running kclockd, it means that it is already running, so we will need to stop it first with flatpak kill org.kde.kclock
Comment 4 Devin Lin 2023-01-19 06:44:04 UTC
Aha, seems you actually found an issue in Plasma, here is the fix: https://invent.kde.org/plasma/powerdevil/-/merge_requests/129
Comment 5 Devin Lin 2023-01-19 15:41:56 UTC
Git commit a5575edc8bb7da61a7ae0e4237f699203b367b38 by Devin Lin.
Committed on 19/01/2023 at 15:32.
Pushed by devinlin into branch 'master'.

daemon: Fix wakeup removal not rescheduling the timerfd wakeup

Fixes wakeup removal for the current event from sometimes not rescheduling the timerfd wakeup for the next event, causing the current event to trigger for another cookie.

This happens because error checking condition was invalid; events can get removed from the middle of the list as well.

We experienced this issue in kclock, which can be read about here: https://bugs.kde.org/show_bug.cgi?id=464251

M  +4    -2    daemon/powerdevilcore.cpp

https://invent.kde.org/plasma/powerdevil/commit/a5575edc8bb7da61a7ae0e4237f699203b367b38
Comment 6 Devin Lin 2023-01-19 16:19:10 UTC
Git commit 0dfefa03038650830c0797b03c66e6eb61ba3e40 by Devin Lin.
Committed on 19/01/2023 at 16:18.
Pushed by devinlin into branch 'Plasma/5.27'.

daemon: Fix wakeup removal not rescheduling the timerfd wakeup

Fixes wakeup removal for the current event from sometimes not rescheduling the timerfd wakeup for the next event, causing the current event to trigger for another cookie.

This happens because error checking condition was invalid; events can get removed from the middle of the list as well.

We experienced this issue in kclock, which can be read about here: https://bugs.kde.org/show_bug.cgi?id=464251

Fix

M  +5    -3    daemon/powerdevilcore.cpp

https://invent.kde.org/plasma/powerdevil/commit/0dfefa03038650830c0797b03c66e6eb61ba3e40