Page MenuHomePhabricator

[Core] Crash-inducing racing condition in TimeGeometry
Open, NormalPublic

Description

During work on D512 I encountered multiple seemingly random crashes with incompatible vector iterators within mitk::TimeGeometry::UpdateBoundingBox(). An experimental fix was done by introducing a mutex lock_guard in front of anything not thread-safe within that method (m_BoundingBox->SetPoints(points); and m_BoundingBox->ComputeBoundingBox();). This solved the problem, so it seems the cause was a racing condition between multiple calls to UpdateBoundingBox(). However, simply blocking with a mutex might increase runtime, the degree of this was not checked (although it was not directly noticeable in my case).
It would be good to take a look at this and see if there is another way to make this method thread-safe, or if a mutex is the best solution.

Event Timeline

s434n triaged this task as Normal priority.Mar 14 2022, 1:01 PM
s434n created this task.
floca added a subscriber: floca.

Question to discuss: Should we invistigate it further or reactivate if there is realy a performance problem evident?