editor crashes upon placing resources

Bug #1550568 reported by king of nowhere
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Critical
Unassigned

Bug Description

when placing resources (iron, gold, coal, granite) the editor sometimes crashes unexpectedly. I haven't been able to figure out why, but it happened twice in a row. The first time I had been putting ores around for at least ten minutes before it crashed, the second it did after a minute or two. The second time the game crashed after I pressed ctrl-z, i don't know what was the last command i issued the first time. and that's all the information i can give.

Tags: crash editor

Related branches

Revision history for this message
king of nowhere (lainluigi86) wrote :

forgot to mention: build is 7852

Revision history for this message
king of nowhere (lainluigi86) wrote :

i made a few more experiments (not intentionally, i didn't want to crash the editor; on the plus side, i had saved shortly before, and i isolated the problem) and i saw that ctrl-z is the problem. starting with a new map, place some mineable terrain, place some resources, press ctrl-z and instant crash. perfectlly reproducible.
Also, the problem is soomewhat older; i tried to use the editor of 7749 to place resources, but it still crashed.

GunChleoc (gunchleoc)
tags: added: crash editor
Changed in widelands:
milestone: none → build19-rc1
importance: Undecided → Critical
Revision history for this message
GunChleoc (gunchleoc) wrote :

I tried reproducing this on Ubuntu and Windows and no crash.

Could you try getting us some log output, maybe we will get lucky and there is an error message?

https://wl.widelands.org/wiki/Technical%20FAQ/#how-do-i-get-log-output-in-windows-for-debugging

Revision history for this message
GunChleoc (gunchleoc) wrote :

Could you also make sure that you have build 7847. or newer? Maybe that commit happened to fix it, because it's also related to undo/redo.

Revision history for this message
king of nowhere (lainluigi86) wrote :

I did that. First thing, I can confirm that I used 7852. By the way, the windows instyaller may be malfunctioning: first, it did not ask me in which folder I wanted to install the game (and for that reason it overwrote the folder of version 7826, which is why the version number is indicated as such in the log file folder. But it is 7852; 7826 didn't have the editor help implemented yet, this one does), and second, I choose custom installation but it diid not give me any additional option.
Anyway, I can confirm that the bug is reproducible. I entered the editor, placed a mountain, placed a resource on it, pressed ctrl-z, instant crash. I tried again with water and fish, and again crash. Strangely enough, when I was working on my map I was able to use ctrl-z when I was placing fish.
I also produced a log, but it doesn't seem useful. It appears it didn't produce any output after the loading of the editor:
This is Widelands Version (Release)
Set home directory: C:\Users\luigi\.widelands
Widelands executable directory: C:\Widelands7826
Adding directory: C:\Widelands7826\data
selected language: en
Graphics: Try to set Videomode 1600x900
Graphics: OpenGL: Version "4.5.0 NVIDIA 353.54"
Graphics: SDL_GL_RED_SIZE is 8
Graphics: SDL_GL_GREEN_SIZE is 8
Graphics: SDL_GL_BLUE_SIZE is 8
Graphics: SDL_GL_ALPHA_SIZE is 0
Graphics: SDL_GL_BUFFER_SIZE is 24
Graphics: SDL_GL_DOUBLEBUFFER is 1
Graphics: SDL_GL_DEPTH_SIZE is 24
Graphics: SDL_GL_STENCIL_SIZE is 0
Graphics: SDL_GL_ACCUM_RED_SIZE is 16
Graphics: SDL_GL_ACCUM_GREEN_SIZE is 16
Graphics: SDL_GL_ACCUM_BLUE_SIZE is 16
Graphics: SDL_GL_ACCUM_ALPHA_SIZE is 16
Graphics: SDL_GL_STEREO is 0
Graphics: SDL_GL_MULTISAMPLEBUFFERS is 0
Graphics: SDL_GL_MULTISAMPLESAMPLES is 0
Graphics: SDL_GL_ACCELERATED_VISUAL is 1
Graphics: SDL_GL_CONTEXT_MAJOR_VERSION is 2
Graphics: SDL_GL_CONTEXT_MINOR_VERSION is 1
Graphics: SDL_GL_CONTEXT_FLAGS is 0
Graphics: SDL_GL_CONTEXT_PROFILE_MASK is 2
Graphics: SDL_GL_SHARE_WITH_CURRENT_CONTEXT is 0
Graphics: SDL_GL_FRAMEBUFFER_SRGB_CAPABLE is 0
Graphics: OpenGL: Double buffering enabled
Graphics: OpenGL: Max texture size: 16384
Graphics: OpenGL: ShadingLanguage: "4.50 NVIDIA"
**** GRAPHICS REPORT ****
 VIDEO DRIVER windows
 pixel fmt 370546692
 size 1600 900
**** END GRAPHICS REPORT ****
SoundHandler: songset "intro" does not exist!
SoundHandler: songset "menu" does not exist!
Loading the world took 857ms
Loading Ships
Loading Wares
Loading Immovables
Loading Workers
Loading Warehouses
Loading Productionsites
Loading Trainingsites
Loading Militarysites
Loading Partially Finished Buildings
Loading Atlanteans
Loading Barbarians
Loading Empire
Finished loading tribes
Loading the tribes took 4058ms

Revision history for this message
GunChleoc (gunchleoc) wrote :

I just tried a release build rather than a debug build on Windows, and I still can't reproduce this :(

Revision history for this message
king of nowhere (lainluigi86) wrote :

maybe it's an idiosincrasy of my situation, where a faulty installer has overwritten a previous version. or maybe it is a bug related to window 10 specifically.

Revision history for this message
kaputtnik (franku) wrote :

I got a crash on Linux when using 'undo' much times:

widelands: /home/kaputtnik/Quellcode/widelands-repo/trunk/src/logic/map_objects/world/world.cc:163: const Widelands::ResourceDescription* Widelands::World::get_resource(Widelands::DescriptionIndex) const: Zusicherung »res < resources_->size() || res == Widelands::kNoResource« nicht erfüllt.
Abgebrochen (Speicherabzug geschrieben)

I am not sure, but i believe this happens if you try to place resources to adjacent non mountainous terrain. F.e. if the toolsize is 3 and you place resources, the tool sometimes protrude the mountainous area. Clicking then 'undo' (or press CTRL z) leads to uncommon behavior: Suddenly ressources appear where the tool has protrude the mountain and the appeared ressources are different from the one you have set. F.e. you place Gold and after 'undo' fish or coal appears. Sometimes the editor crashes.

This happens also to fish resource and water.

This reminds on bug 1534209.

Revision history for this message
kaputtnik (franku) wrote :
Revision history for this message
GunChleoc (gunchleoc) wrote :

Yes, the tool size made all the difference! I can reproduce this now :D

Revision history for this message
king of nowhere (lainluigi86) wrote :

yeah, it was the tool size. when placing ores in bulk, i always use a big tool size, so i never noticed that the crash was only related to that

kaputtnik (franku)
Changed in widelands:
status: New → Confirmed
Revision history for this message
TiborB (tiborb95) wrote :

Funny, I tried to add coal to grass - nothing (visible) happened, but the undo crashed the game, resource in assertion was 108, so completely nonsensical. After further tests, it crashed with different resource indexes. So my ideas:
1) default resources are random numbers
2) Undo saves random numbers somewhere.
3) Why undo saves any action if no action happened (new resources were rejected on all fields)?

Revision history for this message
GunChleoc (gunchleoc) wrote :

The problem is definitely undefined resource indices - I haven't found out where they are coming from though. We still need to do more digging.

GunChleoc (gunchleoc)
Changed in widelands:
status: Confirmed → Fix Committed
GunChleoc (gunchleoc)
Changed in widelands:
status: Fix Committed → Fix Released
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.