Odd error that occurs only when the textdomain is wesnoth-dl
Moderator: Forum Moderators
Forum rules
Before reporting issues in this section, you must read the following topic:
Before reporting issues in this section, you must read the following topic:
Odd error that occurs only when the textdomain is wesnoth-dl
Konrad2 has run into a peculiar error where all translated strings defined in scenario 1 of a UMC campaigns are reported invalid and replaced by empty strings:
He gets that error when he starts playing The Rulers of Irdya. If he changes the first line of the first scenario from
The "invalid string:" errors have some random bytes. For example, one of the invalid strings is
He gets that error when he starts playing The Rulers of Irdya. If he changes the first line of the first scenario from
#textdomain wesnoth-dl
to #textdomain wesnoth-tsg
(that's The South Guard's textdomain), the error goes away. None of his other addons mention wesnoth-dl
in any way or have file named wesnoth-dl
(po, mo, or anything else). He also tried #textdomain wesnoth-tRoI
, that worked yesterday but reproduces the error today. He also tried keeping the textdomain unmodified and removing one or two addons from the ones he has installed (not always the same one or two), that also made the error go away yesterday.The "invalid string:" errors have some random bytes. For example, one of the invalid strings is
"\2tRoI-\4\x81\0The Rising Storm"
. His savefiles are named tRoI--Auto-Save1.gz
, with the scenario name replaced by empty string.Re: Odd error that occurs only when the textdomain is wesnoth-dl
We think it might be caused by a1bbe66acb45a6cfa8cb9f1501f9f6207d1bc192.
Re: Odd error that occurs only when the textdomain is wesnoth-dl
Could this error be explained in plain English for other addon creators . Also do you think the other addon Dragons Lair with text domain wesnoth-dl needs changing?
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: Odd error that occurs only when the textdomain is wesnoth-dl
Sure. In the C++ engine, each textdomain is assigned a numeric id, a nonnegative integer. The id numbers are assigned sequentially. Due to a bug, the addon whose textdomain happened to be assigned id=129 was instead considered to have id=(largest possible integer + 129 - 256). Since that value is (much) larger than the largest id that had been assigned, the string was considered invalid and an error was logged.
That validity check was a safety net that worked as intended. If it hadn't been in place, Wesnoth would have crashed.
The error was platform-dependent (it would only occur on platforms whose
char
type is signed) and would have affected any addon whose textdomain was >=128.edit: jyrkive adds, "
char
is signed on every major platform". (The standard leaves that as implementation-defined but the major platforms all define it the same way.)No. The bug was in the C++ side.
Re: Odd error that occurs only when the textdomain is wesnoth-dl
Thank you! That is really good to know. Very interesting error. Also I would like to say thank you for your help identifying the error, I respect your commitment and also ingenuity in finding such a obscure bug.
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: Odd error that occurs only when the textdomain is wesnoth-dl
You're welcome. For further information, see "Integral conversions" in https://en.cppreference.com/w/cpp/langu ... conversion.
Re: Odd error that occurs only when the textdomain is wesnoth-dl
Yes great I will take a look at that. Also did we ever find out what addon was causing the conflict? Or was it merely the volume of translations installed?
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: Odd error that occurs only when the textdomain is wesnoth-dl
It was just the volume. I could reproduce the problem locally by adding 150 textdomains to AOI, without having more than a few addons installed.