playercolor mask has wrong size

Bug #1324642 reported by TiborB
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Critical
Chuck Wilder

Bug Description

Hi, when testing current trunk the game crashed couple times with:

terminate called after throwing an instance of '_wexception'
  what():  [/var/widelands/tiborb-ai/src/graphic/animation.cc:212] playercolor mask has wrong size: (24, 32), should be (16, 26) like the animation frame
Aborted

after modifying the source i got also file on which it crashed: tribes/barbarians/miner/idle_00_pc.png, of course there could be more of such wrong files.

Related branches

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Thanks for taking your time to report this issue.

I have played a couple of games with r6970, but I have not seen this issue. Could you please some more information/steps on how to reproduce this issue. I see barbarian miners are mentioned, but nothing they did seemed to trigger a crash in my games. (Also, based on the directory path, it sounds like your branch, so I would like you to verify that this happens in trunk.)

And btw, please state the revision number rather than "current trunk", it's much clearer and easier to deal with if the bug remains open for a longer period of time to see when it was first discovered.

Changed in widelands:
importance: Undecided → Medium
status: New → Incomplete
tags: added: crash
Revision history for this message
TiborB (tiborb95) wrote :

The exemption is thrown by http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/graphic/animation.cc#L197 (in 6970 as well). I reffered to probably trunk 6969 or even 6970. But perhaps some png images could be changed in 6970 and problem no longer exists.
It occured only very rarely and randomly. Sometimes the game crashed after 0.5 hour of game play, sometimes it went 4 hours without crash.

I implemented a mitigation in my latest 6982 version. Now it only reports an error on command line and the games go on

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Digging a bit deeper, I found that the file tribes/barbarians/miner/idle_00_pc.png doesn't exist, only idle_00.png. So there might be something odd going on here. Could you please check if you have this file? Also, if you're printing error messages, does it report the same error for other image files?

Revision history for this message
TiborB (tiborb95) wrote :

well, you are right, no idle_00_pc.png here neither

Revision history for this message
SirVer (sirver) wrote :

The barbarian miner and gamekeeper to not have player color masks. I posted about this here: https://wl.widelands.org/forum/topic/450/?page=5#post-9289

Theoretically, they should be quick to be recreated using our blender repo - however I can no longer use blender 2.5 since it is so different to 2.49 and I did not invest the time to dig how to run our scripts in it (the scripts are already ported to work with blender 2.5).

The only think missing here is somebody willing to recreate those graphics.

Chuck, do you still remember how this works and can provide some tipps?

Changed in widelands:
importance: Medium → Critical
milestone: none → build19-rc1
assignee: nobody → Chuck Wilder (chuckw20)
Revision history for this message
TiborB (tiborb95) wrote :

a while ago I encountered similar crash:
terminate called after throwing an instance of '_wexception'
  what(): [......./src/graphic/animation.cc:225] animation tribes/atlanteans/smelter/idle_?? has no frames

Revision history for this message
Michel Kleidt (kleidt) wrote :

OS: Ubuntu 14.04
Widelands: bzr7075

After checking out and builidng the current relase, I played a game, and it crashes (maybe the first oppent try to appear):

Unerwarteter Fehler im Spielverlauf
[/home/michael/src/widelands/src/graphic/animation.cc:300] playercolor mask has wrong size: (24, 32), should be (16, 26) like the animation frame

Just open the attached game and wait about 5 seconds.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Hi Michel, and thanks for attaching a save game.

Are you able to consistently trigger this error with that save game? Because I tried to load it and let it run for a couple of minutes each time here but I didn't see any errors or crashes.

I'm also running r7075 on Ubuntu 14.04 so I'm scratching my head here. Fwiw. debug build of WL on amd64.

tags: added: graphic savegame
Revision history for this message
Michel Kleidt (kleidt) wrote :

I retry it, and the error occurs immediately.
I have a normal build for amd32.

I add my console output.

I'm not so familiar with debugging c++, what are the next steps I could do, to give you useful informations?

Regards

Michael

Revision history for this message
Michel Kleidt (kleidt) wrote :

Hi Hans,
now I have two versions. A 7.3 MB Release version and a 125.6 MB Debug version. But also the debug version shows the error. The difference is, that Widelands terminate and left the system in a crazy state, where screen resolution and mouse offset is messed up, so that I have to restart...

To be sure, you load the saved game and continue the game? (not try to replay)

Regards

Michael

Revision history for this message
Jens Beyer (qcumber-some) wrote :

The savegame from #7 triggers for me just like described on Gentoo amd64 with r7076.

(gdb) bt
#0 0x00007ffff548e4c5 in raise () from /lib64/libc.so.6
#1 0x00007ffff548f948 in abort () from /lib64/libc.so.6
#2 0x00007ffff5d7199d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/libstdc++.so.6
#3 0x00007ffff5d6fa76 in ?? () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/libstdc++.so.6
#4 0x00007ffff5d6faa3 in std::terminate() () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/libstdc++.so.6
#5 0x00007ffff5d6fd16 in __cxa_rethrow () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/libstdc++.so.6
#6 0x0000000000b890fa in WLApplication::load_game (this=0x1918e60) at /home/beyerj/widelands/widelands/src/wlapplication.cc:1606
#7 0x0000000000b8804f in WLApplication::mainmenu_singleplayer (this=0x1918e60) at /home/beyerj/widelands/widelands/src/wlapplication.cc:1390
#8 0x0000000000b87a79 in WLApplication::mainmenu (this=0x1918e60) at /home/beyerj/widelands/widelands/src/wlapplication.cc:1306
#9 0x0000000000b83318 in WLApplication::run (this=0x1918e60) at /home/beyerj/widelands/widelands/src/wlapplication.cc:480
#10 0x0000000000b8163e in main (argc=1, argv=0x7fffffffdca8) at /home/beyerj/widelands/widelands/src/main.cc:103

Revision history for this message
Michel Kleidt (kleidt) wrote :

Hi Hans,

I extend the error message with the filename causing the error. Now the error message is:
Unerwarteter Fehler im Spielverlauf
[/home/michael/src/widelands/src/graphic/animation.cc:301] playercolor mask has wrong size: (24, 32), should be (16, 26) like the animation frame: tribes/barbarians/miner/idle_00_pc.png

idle_00_pc.png has a size of 16x26. I don't know where playercolor mask size came from.

Regards

Michael

Revision history for this message
Jens Beyer (qcumber-some) wrote :

Some more observations:

It triggers immediately after the forester at the left screen border is finished constructing, right when the forester should come out of HQ.
It only triggers when you do not touch anything after loading the game. Especially it does not trigger when you move the screen a little to the left (or even press pause and inspect the environment).
It triggers much quicker (even before the forester is finished) when hitting the S and C keys a few times, so it is probably not really the forester himself.

I suspect something in the text drawing/rendering...

Revision history for this message
SirVer (sirver) wrote :

Please see #5 - this bug is no mystery. We just need to render animation frames for the barbarian miner and gamekeeper again. Unfortunately there is no resident graphician on the project right now and I do not know enough about blender to do it.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Hm, I don't know why, but I didn't get a crash when loading the attached savegame, though probably not that important since others were able to reproduce it. (And now it won't load at all since goldweaver was renamed in r7085.)

SirVer: so have we always been lacking these frames for the two workers? Has some recent change brought this to life, because one would think missing graphics would have been discovered earlier?

Revision history for this message
SirVer (sirver) wrote :

> SirVer: so have we always been lacking these frames for the two workers?

Yes. I think so.

> Has some recent change brought this to life, because one would think missing graphics would have been discovered earlier?

The spritemap refactoring brought this to the surface. Though you have to see any of these workers on screen with the missing animations to actually have a crash - that seems to be pretty rare.

Revision history for this message
Chuck Wilder (chuckw20) wrote :

The frames exist in Build 18. I'll place this at the TOP of my priorities now that I'm "back", if only in a limited fashion for now. :)

Revision history for this message
SirVer (sirver) wrote :

They have the wrong size though I think.

Revision history for this message
Chuck Wilder (chuckw20) wrote :

From what I see, the file sizes have remained unchanged from Build 18 for both the miner and gamekeeper. That said, the PC mask for the miner's idle graphic (24x32) differs in size from the image file (16x26) in the Build 18 files. This same PC file does not even exist in the most recent release.

As for the gamekeeper files, ALL of the PC files are missing in the most recent release.

The idle_00.png file is actually nothing more than a copy of the walk_se_02 image and pc files and thus easily replaced for the miner.
The gamekeeper PC files I will copy from the Build 18 set as the file sizes have not changed.

I'll also review the rest of the worker files for all three tribes and make any required amendments.

Revision history for this message
Chuck Wilder (chuckw20) wrote :

branch lp:~chuckw20/widelands/bug-1324642 submitted for review with proposal to merge.

Chuck Wilder (chuckw20)
Changed in widelands:
status: Incomplete → In Progress
Revision history for this message
SirVer (sirver) wrote :

The merge proposal will not fix the problem I fear - it will just crash in another place:

http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/7346/src/graphic/animation.cc#L251

I see two solutions: either we can just not crash on missing or wrong pc_mask and not draw a player colored sprite - but that makes discovering errors like that harder to find. Or we need to rerender the images with the correct size. What do you think?

Revision history for this message
Chuck Wilder (chuckw20) wrote : Re: [Bug 1324642] Re: playercolor mask has wrong size

I don't think ignoring missing or wrong pc_mask files is a good idea as you
say. I'll review the matter further and if we need to rerender, I'll make
it so.
Thanks for your review.

On Mon, Jan 12, 2015 at 1:42 AM, SirVer <email address hidden> wrote:

> The merge proposal will not fix the problem I fear - it will just crash
> in another place:
>
> http://bazaar.launchpad.net/~widelands-
> dev/widelands/trunk/view/7346/src/graphic/animation.cc#L251
>
> I see two solutions: either we can just not crash on missing or wrong
> pc_mask and not draw a player colored sprite - but that makes
> discovering errors like that harder to find. Or we need to rerender the
> images with the correct size. What do you think?
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1324642
>
> Title:
> playercolor mask has wrong size
>
> Status in Widelands:
> In Progress
>
> Bug description:
> Hi, when testing current trunk the game crashed couple times with:
>
> terminate called after throwing an instance of '_wexception'
> what(): [/var/widelands/tiborb-ai/src/graphic/animation.cc:212]
> playercolor mask has wrong size: (24, 32), should be (16, 26) like the
> animation frame
> Aborted
>
> after modifying the source i got also file on which it crashed:
> tribes/barbarians/miner/idle_00_pc.png, of course there could be more
> of such wrong files.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/widelands/+bug/1324642/+subscriptions
>

Revision history for this message
Chuck Wilder (chuckw20) wrote :

I have pushed ~chuckw20/widelands/bug-1324642 rel7349 and submit it for review and merge.

Revision history for this message
Chuck Wilder (chuckw20) wrote :

I resized the pc_mask files for the barbarian gamekeeper to match their corresponding image files (ensuring the mask was properly positioned.)

I also reviewed all of the worker files and found the atlantean smoker had walkload files that did not meet the standard naming convention (i.e. walk_load vs. walkload). The files were renamed and the conf file edited accordingly.

Revision history for this message
SirVer (sirver) wrote :

Fix merged in r7351.

Changed in widelands:
status: In Progress → Fix Committed
GunChleoc (gunchleoc)
tags: added: graphics
removed: graphic
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.