Topic: NetworkGamingMessages::get_message() throws random strings at format()
tothxa Topic Opener |
Posted at: 2022-09-10, 09:38
I've noticed many format() error messages in the crash logs in #5548 and #5555. I tried to track them down, and I think they come from With edit: I tried to track down callers, and I don't think it is supposed to receive format strings as arguments. So the strange practice is only there because the message templates in the map Now I have to go, so I'll try it later if it's OK. Edited: 2022-09-10, 10:26
Top Quote |
Nordfriese |
Posted at: 2022-09-10, 10:40
Storing the expected number of format arguments along with the string sounds good to me. Caching shouldn't be a problem, we only cache the unformatted source string and its nodes tree (which is valid even if the string has zero placeholders), not any replacement instantiations. Top Quote |
tothxa Topic Opener |
Posted at: 2022-09-10, 23:38
Yes, I know. My concern is that normally we would have more or less a fixed set of format strings, but here all kind of argument strings are treated as format strings, each of them being added to the cache. But OK, that probably shouldn't be a big issue. I tried to review once again in format/tree.h whether throwing these exceptions is safe in the regard of properly cleaning up, but I don't really know how to do it. Top Quote |