Author Topic: Fixed: r1163: Issue in resource cache causes segmentation fault  (Read 1151 times)

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
I played r1163 and it worked fine for a long time (>=20 minutes?). But then, at once, it segfaulted. I was unable to pinpoint any trigger for this, but the backtrace seems to indicate that this is a bug in the resource cache:
Quote from: backtrace
Core was generated by `./glest.bin'.
Program terminated with signal 11, Segmentation fault.
#0  getResource (this=0xfb83788, unit=<value optimised out>, type=<value optimised out>) at glest_game/type_instances/object.h:51
51      Resource *getResource() const      {return resource;}
#0  getResource (this=0xfb83788, unit=<value optimised out>, type=<value optimised out>) at glest_game/type_instances/object.h:51
#1  getResource (this=0xfb83788, unit=<value optimised out>, type=<value optimised out>) at glest_game/world/map.h:113
#2  Glest::Game::Faction::getClosestResourceTypeTargetFromCache (this=0xfb83788, unit=<value optimised out>, type=<value optimised out>) at glest_game/type_instances/faction.cpp:741
#3  0x00000000005bf485 in Glest::Game::Map::isResourceNear (this=0x396b610, pos=..., rt=0x36dcf00, resourcePos=<value optimised out>, size=1, unit=<value optimised out>, fallbackToPeersHarvestingSameResource=true) at glest_game/world/map.cpp:278
#4  0x00000000005b448f in Glest::Game::UnitUpdater::updateHarvest (this=0x396bb50, unit=0xfdcfa10) at glest_game/world/unit_updater.cpp:666
#5  0x00000000005ae527 in Glest::Game::UnitUpdater::updateUnitCommand (this=0x396bb50, unit=0xfdcfa10) at glest_game/world/unit_updater.cpp:187
#6  0x00000000005b1ef3 in Glest::Game::UnitUpdater::updateUnit (this=0x396bb50, unit=0xfdcfa10) at glest_game/world/unit_updater.cpp:134
#7  0x00000000005c9b24 in updateAllFactionUnits (this=0x396b578) at glest_game/world/world.cpp:251
#8  Glest::Game::World::update (this=0x396b578) at glest_game/world/world.cpp:324
#9  0x0000000000446013 in Glest::Game::Game::update (this=0x396b560) at glest_game/game/game.cpp:696
#10 0x00000000004a55c1 in Glest::Game::Program::loopWorker (this=0x286c9d0) at glest_game/main/program.cpp:297
#11 0x00000000004a1ed5 in Glest::Game::glestMain (argc=<value optimised out>, argv=<value optimised out>) at glest_game/main/main.cpp:972
#12 0x00007f6d21605d8e in __libc_start_main () from /lib/libc.so.6
#13 0x000000000040a209 in _start ()

Please inspect my log file dump megaglest_btrunk+r1163_d20101025-232213UTC_ptomreyntrunk_tsegfault.tar.gz which is available in the usual location.
« Last Edit: 26 October 2010, 22:06:58 by tomreyn »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Bug in r1163: Issue in resource cache causes segmentation fault
« Reply #1 on: 26 October 2010, 15:26:56 »
Fixed in svn. Had to check the co-ordinates to ensure they were correct map positions while looking for resources.

Thanks for reporting.

 

anything