Bug 202123

Summary: commit 82c8dbb376b9fa9b831c157cbb15664cb4a343e3 breaks timers
Product: Timers Reporter: H.J. Lu (hjl.tools)
Component: Interval TimersAssignee: timers_interval-timers
Status: NEW ---    
Severity: high CC: carnil, tglx
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.20 Subsystem:
Regression: Yes Bisected commit-id:

Description H.J. Lu 2019-01-03 16:52:15 UTC
On x86-64,

commit 82c8dbb376b9fa9b831c157cbb15664cb4a343e3
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Mon Dec 17 13:31:05 2018 +0100

    posix-timers: Fix division by zero bug
    
    commit 0e334db6bb4b1fd1e2d72c1f3d8f004313cd9f94 upstream.
    
    The signal delivery path of posix-timers can try to rearm the timer even if
    the interval is zero. That's handled for the common case (hrtimer) but not
    for alarm timers. In that case the forwarding function raises a division by
    zero exception.
    
    The handling for hrtimer based posix timers is wrong because it marks the
    timer as active despite the fact that it is stopped.
    
    Move the check from common_hrtimer_rearm() to posixtimer_rearm() to cure
    both issues.

caused:

FAIL: rt/tst-cputimer1
FAIL: rt/tst-cputimer2
FAIL: rt/tst-cputimer3

in glibc tests.
Comment 1 Salvatore Bonaccorso 2019-02-07 22:22:25 UTC
This was fixed with 93ad0fc088c5b4631f796c995bdd27a082ef33a6