Author Topic: [fixed] r3455: Many units on small map cause SegF (custom xml)  (Read 1301 times)

Pizza90

  • Draco Rider
  • *****
  • Posts: 282
    • View Profile
Hi, i like playing megaglest in single mod, especially playing mods that are not played so much as the megapack. I usually modify the xml files to make the game more fast at the start (so i usually skip the "gather resources" phase). Today i played a game on the latest svn with the mod "enemies and allies" with the modified xml file and i got a segmentation fault! I think (but i am not sure) the error happened because the map i played was too small to contain all the units. It's not the first i have too many units for a map, it happened two other times and i got 2 different results:

1 time ) megaglest shown me an error message saying like "there are too many units for the map"
2 time ) megaglest loaded/shown just one faction (of the two that should have been loaded/shown)

And this time (the third) i got a segmentation fault as i said above.

This error is reproducible (at the least on my system: lucid linx 32 bits,4gb of ram (but just 3 and something used), amd athlon x2,ATI HD raedon 3200) following these steps:

1) modify the xml file called "enemies_and_allies.xml" that you can find in: /home/yourusername/.megaglest/techs/enemies_and_allies/factions/enemies_and_allies
like this:
Code: [Select]
<?xml version="1.0" standalone="no"?>

<faction>
   <starting-resources>
      <resource name="gold" amount="4000"/>
      <resource name="wood" amount="2000"/>   
      <resource name="stone" amount="2000"/>   
      <resource name="oil" amount="2000"/>   
   </starting-resources>
   <starting-units>
      <unit name="oil" amount="200"/>
      <unit name="headquarters" amount="1"/>
      <unit name="recruit" amount="10"/>
      <unit name="rifleman" amount="150"/>
      <unit name="outpost_i" amount="20"/>
      <unit name="flame_thrower" amount="50"/>
      <unit name="gun_trap" amount="0"/>
      <unit name="nuclear_missile_launcher" amount="0"/>
      <unit name="sleeping_gas_solder" amount="0"/>
      <unit name="uragan_vehicle" amount=""/>
      <unit name="carbine_solder" amount="100"/>
      <unit name="leclerc_tank" amount="0"/>
      <unit name="conqueror_tank" amount="0"/>
      <unit name="boeing_bomber" amount="0"/>
      <unit name="motorcycle" amount="0"/>
   </starting-units>   
   <music value="true" path="music/the_shining_city.ogg"/>
</faction>

2) run megaglest (svn r3455) from the terminal

3) create an offline game with the following specs: 
-map: conflict
-player0: you, player1: CPU easy,player 2: CPU easy, player 3: CPU easy
-2vs2
-pathfinder type: regular
-fog of war: on
-tileset: pine peat
-techtree: enemies and allies

4) start the game

5) megaglest will load everything but then the screen will become black and after some seconds you will get a segmentation fault  similar to this (at the least i got it two times):

http://pastebin.com/XMk8ZLSR

I know that the first part is truncated but that's all i got in the terminal!

 :)
« Last Edit: 22 July 2012, 00:38:48 by tomreyn »
I translated Megaglest in italian and i keep the translation updated.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
This error is reproducible (at the least on my system: lucid linx 32 bits,4gb of ram (but just 3 and something used), amd athlon x2,ATI HD raedon 3200) following these steps:
Dude, you don't even have a discrete graphics card. The Radeon 3200 is an integrated card, and a very, very bad one at that. As well, you never stated the specific CPU (the Athlon X2 is a whole series of processors spanning multiple generations), but overall, they all suck (AMD cards are pretty much inferior to their Intel counterparts unless you got a lousy budget). Seems to me like you are just overloading your computer.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
OK its completly offtopic, but I still use my
AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ ;-)
to play its usually enough, but only combined with a better gfx card ( nvidia 9600GT in my case )

ABout the bug itself, I think its a buggy debug output. I will checkin a fix soon.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
back to main problem, I have no idea whats going on there, but here is how to reproduce it much more easy:

In faction magic set in magic.xml:

<unit name="summoner" amount="5000"/>
so 5000 summoners  and start with map conflict using magic .....

The line/file reported for the crash on the console is different from the line/file one reported by the core file !?!
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Pizza90

  • Draco Rider
  • *****
  • Posts: 282
    • View Profile
It's obvious that the map conflict is too small for all those units, if i play with a larger map it's works perfectly, the problem is that megaglest should not get a segmentation fault if there are too many units, but it should tell you it and dont start the game (i remember i saw an error like this, the problem is that is not shown).
I translated Megaglest in italian and i keep the translation updated.

Pizza90

  • Draco Rider
  • *****
  • Posts: 282
    • View Profile
I tried to reproduce the bug on the latest stable version and guess what? I get the error that tells me (correctly) something like "there is not enough space for all the units", so the bug was introduced in one of the svn version (dont ask me which because i dont know  ;D ).
I translated Megaglest in italian and i keep the translation updated.

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
This should be fixed now, please confirm

Pizza90

  • Draco Rider
  • *****
  • Posts: 282
    • View Profile
I tried to reproduce it the day you had fixed it and i saw the error message about the space (so the bug was fixed), but then i tried 1 minute ago with the latest svn (r3488) and i got this buffer overflow (i dont know if it's related to the segmentation fault):  http://pastebin.com/PREXSRUg (i know the first part of the output is missing but that's all i got on the terminal).
I translated Megaglest in italian and i keep the translation updated.

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
To ensure you capture the entire --verbose output, you can redirect the output to a file (as suggested on the FAQ in the How can I run the game from a shell / command line and capture the verbose output? section).
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
This is fixed now (tested with Pizza last evening)