Segmentation fault in game_preload_packet.cc

Bug #1388829 reported by Tino
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
High
Unassigned

Bug Description

Hi,

current trunk does segfault:

Program received signal SIGSEGV, Segmentation fault.
At c:\data\bzr\widelands\working\src\game_io\game_preload_packet.cc:117

It does happen in tutorial 2-4 and in a single player game at some point.
For me the easiest way to trigger:
Start tutorial 4 - economy. After the second message the view moves and then the game crashes.

Tags: crash

Related branches

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

Thanks for reporting this issue.

I'm able to reproduce this simply by starting and clicking through the dialogs in the Economy tutorial. (r7249 on Ubuntu 14.04)

Changed in widelands:
importance: Undecided → High
milestone: none → build19-rc1
status: New → Triaged
Revision history for this message
Hans Joachim Desserud (hjd) wrote :
tags: added: crash
Revision history for this message
SirVer (sirver) wrote :

Fixed in r7251. A one character fix that was very hard to track down :).

Changed in widelands:
status: Triaged → Fix Committed
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Ok, wow. :)

Could we prefer non-abbreviated variable names in the future? It's usually makes the names more descriptive/readable (also benefits new contributors), and would make it harder to introduce such bugs in the future. Don't think we can make a code check rule for this (easily), but should be possible to catch it during code review.

Revision history for this message
SirVer (sirver) wrote :

I agree that no abberviated names are preferable. however, brn (bottom right neighbor), bln, tln, trn, rn, ln are idioms in Widelands - they are used in many places. I opted for local style instead of non-abbreviation.

Also, this was just a copy & pasto. It is kinda obvious that you would check the variable you just calculated and not one that you've used a few lines further up already. Especially since the pattern is repeated multiple times.

No, I think this mistake was hard to avoid. And I am happy if it stays the only bug in the new rendering code - that was a very difficult rewrite.

Revision history for this message
GunChleoc (gunchleoc) wrote :

All bow before the sharp eyes!

Revision history for this message
SirVer (sirver) wrote :

Well, I wrote that code and seing an index of -1 trying to be accessed while I remembered explicitly checking for this index made it rather obvious that I had this error some place.

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

Bug attachments

Remote bug watches

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