Wesnoth 1.11 crash

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
User avatar
tekelili
Posts: 1039
Joined: August 19th, 2009, 9:28 pm

Wesnoth 1.11 crash

Post by tekelili »

In last 3 versions of development releases a code working in 1.10 crash game. Here is a a very short example of the code to reproduce crash:

Code: Select all

[event]
    name=recruit
    first_time_only=no
    {VARIABLE temp_trait.description "training effects"}
    {VARIABLE temp_trait.male_name "trained"}
    {VARIABLE temp_trait.female_name "trained"}
    [modify_unit]
        [filter]
            x,y=$unit.x,$unit.y
        [/filter]
        [insert_tag]
            name=trait
            variable=temp_trait
        [/insert_tag]
    [/modify_unit]
[/event]
Link provided indicate this place as valid for bug report

Edit: As side note, a very similar crash with high chances of being caused by this code (I didnt isolate code to be sure), is present in 1.10 when used in [event] name=recall instead name=recruit. It looks like the bug was extended to recruit in 1.11
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
User avatar
iceiceice
Posts: 1056
Joined: August 23rd, 2013, 2:10 am

Re: Wesnoth 1.11 crash

Post by iceiceice »

tekelili: This is indeed a valid place to report bugs, but the problem with this report is that unless the exact person who wrote the code that caused the issue reads your post, realizes they made a bug, and realizes how to fix it, (a very optimistic scenario,) there's literally nothing anyone else can do with this, other than try to spot WML syntax errors. You've already told us it works in 1.10 so most likely there aren't those. In fact, because you don't give us a recipe to reproduce, we can't even test at the end whether we actually fixed the issue and can now safely close.

Here are some questions I don't normally have after reading a crash report.

1. What exactly do you mean by "crash game"? When? Do you get a WML error while loading the add-on when you first click multiplayer? Do you get a WML exception when starting the level? When you take certain actions in game? When leaving the game? When saving the game? When reloading the game? Do you get an assertion error? Do you get a segfault? Does your computer run out of memory? Does it affect SP and MP, or just MP? Just networked MP?
2. What platform are you running and what is the exact version of wesnoth you were on?
3. What am I supposed to do with the WML you pasted. Just put it in any scenario? Can I paste it into Den of Onis and expect some kind of crash?

Note that, no Dev is actually going to do (3) here unless you explicitly say to do it. Because as frustrating as it is for you to have to deal with bugs, it is equally frustrating to go on a wild goose hunt for a bug that we don't know how to reproduce / doesn't actually exist. I speak from experience.

On the page you linked to, there are some helpful guidelines:
http://wiki.wesnoth.org/ReportingBugs#N ... nformation
http://wiki.wesnoth.org/ReportingBugs#How_to_be_ignored
User avatar
tekelili
Posts: 1039
Joined: August 19th, 2009, 9:28 pm

Re: Wesnoth 1.11 crash

Post by tekelili »

1. By crash I mean wesnoth closes, its window disspear, it just explodes... when I recruit a unit of course (thats why I encapsulated code in a recruit event)

2. I use one of the last Windows (I am so noob that not sure wich one) on a PC. But dont think is relevant.

3. A full enveiroment to reproduce bug is download my add on World Conquest tek from 1.10 and run it in 1.11. Launch add on (in random maps multiplayer game), recruit a unit to launch invest, pick health training (becasu it has the higher chance to train a unit), recruit until a unit gain a benefic (most likely the first one)... Wesnoth will then just no longer exist, it will explode or however it can be named in English.

4. If really is expected that with my average wml, no lua at all, and unknownledge of developers changes in engine I really do a more accurate description of the bug... then is like is expected I become a developer and fix the engine by myself, imho :|
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Wesnoth 1.11 crash

Post by gfgtdf »

did you check whether there was information in your stderr.txt file?

window disapperating can be related to an expection beeing caught in game.cpp which would normaly print somethign in the file.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
iceiceice
Posts: 1056
Joined: August 23rd, 2013, 2:10 am

Re: Wesnoth 1.11 crash

Post by iceiceice »

tekelili: I'm just trying to help you write a bug report that someone can actually do something with.

1. "when I recruit a unit of course (thats why I encapsulated code in a recruit event)" no one is going to assume anything like that unless you say it, WML can cause all of the different problems I mentioned.
2. "I use one of the last Windows... But dont think is relevant." It's always possibly relevant what platform you are on, and also helpful to know if you have tested on several platforms. It wastes my time if I have to guess, and I know you know the answer.
3. 1.11.1? 1.11.7? 1.11.13? It makes a huge difference. There are many thousands of lines of code changed throughout the project between each of these. It wastes a lot of my time if I have to guess, and I know that you know the answer.
User avatar
tekelili
Posts: 1039
Joined: August 19th, 2009, 9:28 pm

Re: Wesnoth 1.11 crash

Post by tekelili »

The problem was the same in the last 3 versions 1.11

If just anyone launch my add on on a Mac or PC with other operative system and gets a unit trained withouth Wesnoth explodes, I will for sure try to find out what is stdrr.txt file and where can I find it.
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Wesnoth 1.11 crash

Post by gfgtdf »

ok i was able to reproduce the bug with the code you posted above.
I get a "ran out of memorty" or a segfault (rather random wich one) as soon as i my mouse goes over the unit.
I wsa able to invoke same behaviour with this code:

Code: Select all

		[event]
		name=start
		[unit]
			x= 3
			y= 3
			type= "Spearman"
			id= "traitman"
			side= 1
			[modifications]
				[trait]
					description = "asdas"
					female_name = "asdas"
					male_name = "asdas"
				[/trait]
			[/modifications]
		[/unit]
	[/event]
EDIT:
ok i think the error is that in https://github.com/wesnoth/wesnoth/blob ... s.cpp#L289
traits.size() can be greater than trait_ids.size() if a trait has no id.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
tekelili
Posts: 1039
Joined: August 19th, 2009, 9:28 pm

Re: Wesnoth 1.11 crash

Post by tekelili »

Ty for reproduce bug, gfgtdf. I finally know I am not mad :D
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
User avatar
Coffee
Inactive Developer
Posts: 180
Joined: October 12th, 2010, 8:24 pm

Re: Wesnoth 1.11 crash

Post by Coffee »

Looks like this bug was introduced to fix another bug when clickable traits (from the right bar) were introduced to go to the help menu. The problem is that relying on female^trait description instead of a single id that was unique to the unit rather than gender seems to lead to a crash if the id is not present.

Really this should be a bug report, but as I introduced the commit, I'll try to fix it.

EDIT:
Fixed. See https://gna.org/bugs/index.php?21967
Post Reply