Gamestate Inspector crashes (also with 1.9.13)

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

Moderators: Forum Moderators, Developers

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
SlowThinker
Posts: 876
Joined: November 28th, 2008, 6:18 pm

Gamestate Inspector crashes (also with 1.9.13)

Post by SlowThinker » December 29th, 2010, 7:24 pm

The Gamestate Inspector causes Wesnoth to crash if I click on a variable that contains a too long line (123 characters without formatting and indentation was too much)
I recreated the crash with different variables, a long line always implied a crash.

Wesnoth 1.8.5 (english-US)
Widows XP Pro
Last edited by SlowThinker on January 5th, 2012, 11:47 am, edited 1 time in total.
I work on Conquest Minus • I use DFoolWide, Retro Terrain Package and the add-on 'High Contrast Water'
I moved to Nosebane's corner (Doc Paterson's signature); I am spending my time there, so PM me if I don't answer your post in forums

Anonymissimus
Developer
Posts: 2458
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: Gamestate Inspector crashes if too long line

Post by Anonymissimus » December 29th, 2010, 7:47 pm

Doesn't crash in 1.9. Nothing's going to be fixed in 1.8 any more but thx anyway.
Spoiler:
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign

SlowThinker
Posts: 876
Joined: November 28th, 2008, 6:18 pm

Re: Gamestate Inspector crashes if too long line

Post by SlowThinker » January 5th, 2012, 11:28 am

With 1.9.13 I can still force the Gamestate Inspector to crash BfW.
And it looks the length of a line is not the problem:
details
I tried a string with 440 chars
Spoiler:
and I got no problem.

This container (retrieved from a savefile) cannot be inspected:

Code: Select all

[unit_spawns]
	explanation="Definitions of unit spawns follow. You can edit them."
	name="definitions of unit spawns"
	[side_turn]
		[turn]
		[/turn]
		[turn]
			[side]
			[/side]
			[side]
				[spawn]
					activated=yes
					explanation="Next you can edit the position (x,y) of individual units. This way you can control the spawn of players. Don't forget to edit the Neutral spawn an appropriate way."
					name="capitol mode: Human spawn definition"
					[timing_info]
						event="side_turn"
						side=1
						turn=1
					[/timing_info]
					[unit]
						moves=1
						side=1
						type="Spearman"
						x=4
						y=23
					[/unit]
					[unit]
						moves=1
						side=1
						type="Spearman"
						x=10
						y=19
					[/unit]
					[unit]
						moves=1
						side=1
						type="Spearman"
						x=10
						y=14
					[/unit]
					[unit]
						moves=1
						side=2
						type="Spearman"
						x=36
						y=6
					[/unit]
					[unit]
						moves=1
						side=2
						type="Spearman"
						x=37
						y=12
					[/unit]
					[unit]
						moves=1
						side=2
						type="Spearman"
						x=32
						y=13
					[/unit]
					[unit]
						moves=1
						side=3
						type="Spearman"
						x=31
						y=20
					[/unit]
					[unit]
						moves=1
						side=3
						type="Spearman"
						x=26
						y=24
					[/unit]
					[unit]
						moves=1
						side=3
						type="Spearman"
						x=33
						y=25
					[/unit]
					[unit]
						moves=1
						side=4
						type="Spearman"
						x=27
						y=7
					[/unit]
					[unit]
						moves=1
						side=4
						type="Spearman"
						x=31
						y=2
					[/unit]
					[unit]
						moves=1
						side=4
						type="Spearman"
						x=38
						y=2
					[/unit]
					[unit]
						moves=1
						side=5
						type="Spearman"
						x=10
						y=1
					[/unit]
					[unit]
						moves=1
						side=5
						type="Spearman"
						x=4
						y=4
					[/unit]
					[unit]
						moves=1
						side=5
						type="Spearman"
						x=2
						y=1
					[/unit]
					[unit]
						moves=1
						side=6
						type="Spearman"
						x=4
						y=9
					[/unit]
					[unit]
						moves=1
						side=6
						type="Spearman"
						x=11
						y=6
					[/unit]
					[unit]
						moves=1
						side=6
						type="Spearman"
						x=16
						y=1
					[/unit]
				[/spawn]
			[/side]
			[side]
			[/side]
			[side]
			[/side]
			[side]
			[/side]
			[side]
			[/side]
			[side]
			[/side]
			[side]
				[spawn]
					activated=yes
					explanation="Next you can edit the types (e.g. type=Dragoon) of individual units. This way you can control the Neutral spawn"
					name="capitol mode: Neutral spawn definition"
					[timing_info]
						event="side_turn"
						side=7
						turn=1
					[/timing_info]
					[unit]
						max_moves=0
						type="Dwarvish Guardsman"
						x=38
						y=25
					[/unit]
					[unit]
						max_moves=0
						type="Dragoon"
						x=38
						y=19
					[/unit]
					[unit]
						max_moves=0
						type="Dwarvish Stalwart"
						x=25
						y=3
					[/unit]
					[unit]
						max_moves=0
						type="Dwarvish Guardsman"
						x=20
						y=15
					[/unit]
					[unit]
						max_moves=0
						type="Dwarvish Guardsman"
						x=19
						y=21
					[/unit]
					[unit]
						max_moves=0
						type="Dwarvish Guardsman"
						x=2
						y=17
					[/unit]
				[/spawn]
			[/side]
		[/turn]
	[/side_turn]
[/unit_spawns]
  • Inspecting a variable which is equal to unit_spawns.side_turn.turn[1].side[1].spawn works well, but again unit_spawns.side_turn.turn[1] causes the container to be too "fat" probably and crashes the game again
  • If I shorten the long strings then everyting is ok.
I work on Conquest Minus • I use DFoolWide, Retro Terrain Package and the add-on 'High Contrast Water'
I moved to Nosebane's corner (Doc Paterson's signature); I am spending my time there, so PM me if I don't answer your post in forums

Anonymissimus
Developer
Posts: 2458
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: Gamestate Inspector crashes (also with 1.9.13)

Post by Anonymissimus » January 5th, 2012, 4:58 pm

Again, can't reproduce. This doesn't mean none else can however.
You probably will have to provide more information. Ideally a backtrace. Resolution used or other GUI-related settings can be relevant.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign

SlowThinker
Posts: 876
Joined: November 28th, 2008, 6:18 pm

Re: Gamestate Inspector crashes (also with 1.9.13)

Post by SlowThinker » January 6th, 2012, 12:13 pm

I have run several tests.
Operating system: Win XP Pro; 2 GB memory (I just tested it for errors)
BfW had been run in the debug mode with the -d switch.

Sometimes I wasn't able to reproduce the crash even with an identical scenario, but I always found ways how to reproduce it again.

After tests I reported in my last posts, the original scenario and the container 'unit_spawns' still crashed the GI (Gamestate Inspector).
Then I created a tiny scenario "minimum WML code" (it is in the attachment, in a directory 'Scenarios'), that just created the container 'unit_spawns' - and now the GI didn't crash. So a given variable content can cause the crash or not.
Then I removed all scenarios and all add-ons, except the one that crashed before ("full scenario" in the attachment), and it didn't crash now. So a given scenario can cause the crash or not.
Then I returned to the original state of BfW (I moved the addons back) and now the previously 'bad' scenario stopped to crash at all. So a given state of BfW can cause the crash or not.

Most tests were done with the resolution 1600x1144x32. Resolutions 1044x749x32 and
FullScreen (800*600?) usually didn't crash GI.

It appears that a higher chance to a crash cause
  • a higher resolution
  • a larger container that is inspected
  • more WML installed
  • more programs that run in the system besides Wesnoth
  • rather "capitol mode" than the simpler "all-villages mode" (maybe because "capitol mode" produces a bit bigger container 'unit_spawns' that crashes the GI)
Maybe the crash is related to some incorrect memory management? Like this bug, which is reported by more players: Very strange problem with many add ons.Please try to help
Attachments
Conquest-.7z
In case you want to test: inspect the container 'unit spawns'
(199.38 KiB) Downloaded 61 times
assertion failure.jpg
assertion failure.jpg (24.92 KiB) Viewed 1082 times
I work on Conquest Minus • I use DFoolWide, Retro Terrain Package and the add-on 'High Contrast Water'
I moved to Nosebane's corner (Doc Paterson's signature); I am spending my time there, so PM me if I don't answer your post in forums

Anonymissimus
Developer
Posts: 2458
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: Gamestate Inspector crashes (also with 1.9.13)

Post by Anonymissimus » January 6th, 2012, 8:13 pm

Well, judging from all what you wrote there appears to be a memory problem involved. Crashing sometimes and sometimes not is typical.
A computer has a limited amount of memory and if there's a lot of wml to read then there's some spot when it is used up so it's perhaps not really a bug.
Also, don't be too strict with gui2. It is known to not be the most stable thing. ^_^
some related looking reports:
http://gna.org/bugs/index.php?15615
http://gna.org/bugs/index.php?16114
http://gna.org/bugs/index.php?18002
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign

Anonymissimus
Developer
Posts: 2458
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: Gamestate Inspector crashes (also with 1.9.13)

Post by Anonymissimus » January 14th, 2012, 3:03 pm

Slow, you may be interested in this one: http://gna.org/bugs/?19283
Which I was able to reproduce with some easy code. The code position of the crash at least is the same.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign

SlowThinker
Posts: 876
Joined: November 28th, 2008, 6:18 pm

Re: Gamestate Inspector crashes (also with 1.9.13)

Post by SlowThinker » January 14th, 2012, 10:11 pm

I tested it on my system (1.9.3, Win XP) and the bug was reproduced:

Assertion failed!
File: src/gui/widgets/grid.cpp
Line: 542
Expression: false

The name 'inspect' of your event confused me a bit, I didn't know whether it was not a predefined undocumented event name.
Anyway I fired it by [fire_event].

The bug depended on the resolution of the Wesnoth window: It happened on lower resolutions rather than high ones.
The scroll bar doesn't necessarily cause the bug:
Attachments
Inspector.jpg
I work on Conquest Minus • I use DFoolWide, Retro Terrain Package and the add-on 'High Contrast Water'
I moved to Nosebane's corner (Doc Paterson's signature); I am spending my time there, so PM me if I don't answer your post in forums

Post Reply