megaglest-source icon indicating copy to clipboard operation
megaglest-source copied to clipboard

crash when using a 'less than' sign within the unitDied section of scenario xml

Open andy5995 opened this issue 1 year ago • 0 comments

If using a less than sign (<) within the unitDied section of scenario xml, MG crashes when attempting to load the scenario.

I encountered this bug while working on a custom scenario, then confirmed it by altering L173 of the Amazones Pro scenario by swapping the sign ('elseif enemyCount<=3 then`)

$ ./MegaGlest-x86_64.AppImage 
MegaGlest-x86_64.AppImage v3.13-dev
Compiled using: GNUC: 70500 [64bit] platform: Linux-X64 endianness: little
GIT: [Rev: $5608.a3c8464$] - using STREFLOP [SSE] - [no-denormals]
*ERROR* [2023-03-14 11:37:42] In [window.cpp::handleEvent Line: 485] (a2) Couldn't process event: [Error loading XML: /home/andy/.megaglest/scenarios/egypt_has_fallen/egypt_has_fallen.xml
Message: expected element name] codeLocation = h
Error saved to logfile [/home/andy/.megaglest/error.log]
*ERROR* [2023-03-14 11:37:42] In [/__w/megaglest-source/megaglest-source/source/glest_game/main/main.cpp::handleRuntimeError Line: 649] [Error loading XML: /home/andy/.megaglest/scenarios/egypt_has_fallen/egypt_has_fallen.xml
Message: expected element name
Stack Trace:
./MegaGlest-x86_64.AppImage:()address [0x556ab6c01a7c] line: 0
./MegaGlest-x86_64.AppImage:()address [0x556ab6c11d89] line: 0
./MegaGlest-x86_64.AppImage:()address [0x556ab67fb218] line: 0
./MegaGlest-x86_64.AppImage:()address [0x556ab67ffd01] line: 0
./MegaGlest-x86_64.AppImage:()address [0x556ab67ffefd] line: 0
/usr/lib/libc.so.6:()address [0x7f008363c790] line: 0
/usr/lib/libc.so.6:__libc_start_main()address [0x7f008363c84a] line: 0
./MegaGlest-x86_64.AppImage:()address [0x556ab662efba] line: 0
] gameInitialized = 1, program = 0x556ab873cfe0
*ERROR* [2023-03-14 11:37:42] In [window.cpp::handleEvent Line: 485] (a2) Couldn't process event: [Error loading XML: /home/andy/.megaglest/scenarios/egypt_has_fallen/egypt_has_fallen.xml
Message: expected element name] codeLocation = h
terminate called after throwing an instance of 'Shared::Platform::megaglest_runtime_error'
  what():  Error loading XML: /home/andy/.megaglest/scenarios/egypt_has_fallen/egypt_has_fallen.xml
Message: expected element name
Stack Trace:
./MegaGlest-x86_64.AppImage:()address [0x556ab6c01a7c] line: 0
./MegaGlest-x86_64.AppImage:()address [0x556ab6c11d89] line: 0
./MegaGlest-x86_64.AppImage:()address [0x556ab67e7d1a] line: 0
./MegaGlest-x86_64.AppImage:()address [0x556ab67e7fc4] line: 0
./MegaGlest-x86_64.AppImage:()address [0x556ab67f55fd] line: 0
./MegaGlest-x86_64.AppImage:()address [0x556ab67ffd01] line: 0
./MegaGlest-x86_64.AppImage:()address [0x556ab67ffefd] line: 0
/usr/lib/libc.so.6:()address [0x7f008363c790] line: 0
/usr/lib/libc.so.6:__libc_start_main()address [0x7f008363c84a] line: 0
./MegaGlest-x86_64.AppImage:()address [0x556ab662efba] line: 0

Aborted (core dumped)

andy5995 avatar Mar 14 '23 17:03 andy5995