I spend some time looking into this bug today - I ran a full game with a lot of AI under ASAN[1]. It did not report a single error - so I doubt that we use a dangling pointer or have use after free anywhere here. We could still use uninitialized memory - I think that is the likely problem. Unfortunately MSAN is much harder to get up and running.
I read through the code again and have another hunch: Could it be related to text with shadows? At [2] we do some special handling of texts with a shadow background - we render the text twice and overlay it in a new surface. And I am not sure if we do that correctly. It also has a comment that says we could do better with SDL2 - I did not investigate this yet.
For now, I temporarily disabled rendering with shadows in r8055 - could somebody with a buggy machine test again and report back?
I spend some time looking into this bug today - I ran a full game with a lot of AI under ASAN[1]. It did not report a single error - so I doubt that we use a dangling pointer or have use after free anywhere here. We could still use uninitialized memory - I think that is the likely problem. Unfortunately MSAN is much harder to get up and running.
I read through the code again and have another hunch: Could it be related to text with shadows? At [2] we do some special handling of texts with a shadow background - we render the text twice and overlay it in a new surface. And I am not sure if we do that correctly. It also has a comment that says we could do better with SDL2 - I did not investigate this yet.
For now, I temporarily disabled rendering with shadows in r8055 - could somebody with a buggy machine test again and report back?
[1] https:/ /github. com/google/ sanitizers/ wiki/AddressSan itizer bazaar. launchpad. net/~widelands- dev/widelands/ trunk/view/ 8054/src/ graphic/ text/sdl_ ttf_font. cc#L83
[2] http://