Using SDL 2.0.8 and Ubuntu 18.04 LTS, changing the system time ‘backwards’ appears to cause timers created with
SDL_AddTimer() not to fire. For example if I set a timer to fire every second, on issuing the following command my callback is not called for 10 seconds, after which normal operation resumes:
sudo date --set='-10 seconds'
I thought SDL2 used only monotonic time, when available (which I would have expected it to be in modern Linux), but this behavior suggests that ‘clock time’ is still being used for timers, at least in some circumstances.
This issue is a serious problem for one of my users, who is changing the time zone on-the-fly: it can cause my app to freeze for several hours! Can somebody confirm (or not) this behavior, and if possible suggest a workaround?