New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Timer period modifications may violate invariants of TimerManager::base_timer_sorter std::set sorting #12509
Comments
JGRennison
added a commit
to JGRennison/Upstream-OpenTTD
that referenced
this issue
Apr 20, 2024
Use this as the primary sort key for TimerGameTick::TPeriod, to avoid container sort order changes on timer period saveload. See: OpenTTD#12509
JGRennison
added a commit
to JGRennison/Upstream-OpenTTD
that referenced
this issue
Apr 20, 2024
JGRennison
added a commit
to JGRennison/OpenTTD-patches
that referenced
this issue
Apr 21, 2024
rubidium42
pushed a commit
that referenced
this issue
Apr 25, 2024
Use this as the primary sort key for TimerGameTick::TPeriod, to avoid container sort order changes on timer period saveload. See: #12509
PeterN
pushed a commit
to PeterN/OpenTTD
that referenced
this issue
Apr 30, 2024
Use this as the primary sort key for TimerGameTick::TPeriod, to avoid container sort order changes on timer period saveload. See: OpenTTD#12509
PeterN
pushed a commit
to PeterN/OpenTTD
that referenced
this issue
Apr 30, 2024
PeterN
pushed a commit
that referenced
this issue
Apr 30, 2024
Use this as the primary sort key for TimerGameTick::TPeriod, to avoid container sort order changes on timer period saveload. See: #12509
PeterN
pushed a commit
that referenced
this issue
Apr 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version of OpenTTD
master
Expected result
Invariants are always maintained, etc
Actual result
TimeoutTimer::Reset(const TPeriod timeout)
,IntervalTimer::SetInterval
and savegame load of_new_competitor_timeout.period
can directly change theBaseTimer::period
field of timers which are already in theTimerManager
std::set, which usesTimerManager::base_timer_sorter
. This can violate the ordering invariants of std::set, which may result in undefined behaviour.Steps to reproduce
See
src/timer/
.The text was updated successfully, but these errors were encountered: