Game crashes when you try to move over the northern border.

Bug #509327 reported by Milo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
RTS-peli
Fix Released
Medium
Milo

Bug Description

Here are the final debugging print lines and a backtrace. Obviously it tries to move out of the range of vector, meaning it tries to access index below zero. Probably should check for below zero (x, y) values.

Click on 0 at 141988,-714265
109472 -728726 -718026

fps: 45, rps: 198
terminate called after throwing an instance of 'std::out_of_range'
  what(): vector::_M_range_check

Program received signal SIGABRT, Aborted.
0x00007ffff6460ec5 in raise () from /lib/libc.so.6
(gdb) bt
#0 0x00007ffff6460ec5 in raise () from /lib/libc.so.6
#1 0x00007ffff64623c1 in abort () from /lib/libc.so.6
#2 0x00007ffff6ce38cc in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.4/libstdc++.so.6
#3 0x00007ffff6ce1bc6 in ?? ()
   from /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.4/libstdc++.so.6
#4 0x00007ffff6ce1bf3 in std::terminate() ()
   from /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.4/libstdc++.so.6
#5 0x00007ffff6ce1cfa in __cxa_throw ()
   from /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.4/libstdc++.so.6
#6 0x00007ffff6c7e7bc in std::__throw_out_of_range(char const*) ()
   from /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.4/libstdc++.so.6
#7 0x000000000042d736 in std::vector<Tile, std::allocator<Tile> >::_M_range_check(unsigned long) const ()
#8 0x000000000042d755 in std::vector<Tile, std::allocator<Tile> >::at(unsigned long) const ()
#9 0x000000000042eb98 in Map::getTileAt(int, int) const ()
#10 0x0000000000428643 in View::renderUnits() ()
#11 0x0000000000428feb in View::updateScreen() ()
#12 0x0000000000432232 in Engine::runGame() ()
#13 0x0000000000407b9a in main ()

Related branches

Milo (meelo)
Changed in rts-peli:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Milo (meelo)
milestone: none → 0.3
Revision history for this message
Milo (meelo) wrote :

Created MapLimits.h which has some magical constants for those that need some static information about map.
Also added a "validateCoordinates()" function to CoordinateAction, so it validates parameters before it assigns them to the object.

Changed in rts-peli:
status: Confirmed → Fix Committed
Milo (meelo)
Changed in rts-peli:
status: Fix Committed → Fix Released
Milo (meelo)
description: updated
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.