crash when taking a screenshot with libpng 1.5.6 and later

Bug #905930 reported by Nasenbaer
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Critical
Unassigned

Bug Description

during network game I wanted to take a screenshot of my economy. The game crashed with:

terminate called after throwing an instance of '_wexception'
  what(): [/home/development/widelands/widelands/src/graphic/graphic.cc:749] Graphic::save_png: could not set png setjmp

libpng used is v. 1.5.7
I ran Widelands in opengl mode.

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

Could you check if this is reproducible
* in single player games
* in local multiplayer games (just run two instances of WL on your computer)

I have not been able to reproduce this, but then again I haven't tried with a network game, so there might be some strange edge case somewhere.

tags: added: crash
Revision history for this message
Nasenbaer (nasenbaer) wrote :

happens everytime over here... even in sdl mode, so the problem must lie somewhere deep inside libpng. :-/

Revision history for this message
Shevonar (shevonar) wrote :

Recently someone changed some code to make it work with libpng 1.5.x. Most probably that is the reason for this bug.

Revision history for this message
Borim (borim) wrote :

I tested it with tinos windows build (revision 6153) and no problems, but I dont know which libpng is used there.

Also I tested it with my own build on linux and everything works fine. revision 6153, installed libpng: libpng12-0 version 1.2.46-3ubuntu

so the older libs seems to work.

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

Also works fine with libpng 1.4.8-1 on Arch, fwiw. Looks like some 1.5.x issue...

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

The crash happens with libpng-1.5.6 and later.

With libpng-1.5.5 it works perfectly.

If you get rid of that strange dummy flush function in graphic.cc you get the error message

libpng error: internal write transform logic error

This message has been introduced in libpng-1.5.6.

I guess something in the vicinity of this error message is the real culprit.

Revision history for this message
Nasenbaer (nasenbaer) wrote :

From pngwrite.c :

   /* At this point the row_info pixel depth must match the 'transformed' depth,
    * which is also the output depth.
    */
   if (row_info.pixel_depth != png_ptr->pixel_depth ||
      row_info.pixel_depth != png_ptr->transformed_pixel_depth)
      png_error(png_ptr, "internal write transform logic error");

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

Libpng 1.5.8 recently hit Arch, so now I'm able to reproduce it here as well.

Changed in widelands:
status: New → Confirmed
summary: - crash when taking a screenshot
+ crash when taking a screenshot with libpng 1.5.6 and later
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Seems like this also affects campaign maps! Bug 931141.

Shevonar (shevonar)
Changed in widelands:
milestone: none → build17-rc1
importance: Medium → Critical
Revision history for this message
SirVer (sirver) wrote :

I have not investigated this, but campaign maps are the only maps that ship with images as extra data (the portraits of the speeking characters). Likely the loading code there is not valid for libpng 1.5. Also, the writing code (when savegames are written) will not be working anymore and need to be investigated further.

SirVer (sirver)
Changed in widelands:
status: Confirmed → Fix Committed
Revision history for this message
SirVer (sirver) wrote :

Released in build17-rc1.

Changed in widelands:
status: Fix Committed → Fix Released
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.