Single word wrapping infinite loop
|Reported by:||bb||Owned by:||bb|
|Priority:||Release Blocker||Milestone:||Alpha 26|
Description (last modified by )
Currently (r26604) when I select the en_GB language and open the replay menu, the game will hang, eat up all RAM and crash.
Trisecting the issue lead to the following string
"%(min)s - %(max)s min" in the durationFilters of the replayMenu. In en_GB this is translated as
"%(min)s–%(max)s min". Notice the em_dash directly (no spaces) between two sprintf variables, both of which will be replaced by a number.
The resulting string is too long for the textbox, however since there are no spaces, we cannot word-warp either.
Since r26522 we have the crash as described.
Before r26522 this issue was hided by blindly adding a full width of the word in case of failure. Notice this is wrong because we could end up with wrapping "too late" (there could be a short word following the long word which stays on the same line this way).
Instead we should not process the line on the first word of the line (unless it is the last word of the string).
This issue could also be fixed by changing the translation and adding some spaces around the em-dash, but that is nowhere near a permanent solution.
Change History (10)
comment:3 by , 11 months ago
|Component:||Internationalization & Localization → Core engine|
|Summary:||Em-dash sprinf combination crash → Single word wrapping infinite loop|