Warzone2100 / warzone2100

Command the forces of The Project in a battle to rebuild the world after mankind has been nearly destroyed by nuclear missiles. A 100% free and open source real-time strategy game for Windows, macOS, Linux, BSD+
https://wz2100.net
GNU General Public License v2.0
3.15k stars 521 forks source link

Skirmish mode autogame crashes immediately when loading / including bonecrusher ai bot - Version: 4.3.5 #4012

Open Chewbakka-Wakka opened 1 month ago

Chewbakka-Wakka commented 1 month ago

To reproduce: run attached file, change AI from bonecrusher to any other AI and will work again.

4p-ffa.json

Linux cd /home/<>/.local/share/warzone2100/tests warzone2100 --skirmish=4p-ffa.json --autogame --headless

Output:

~/.local/share/warzone2100/tests$ warzone2100 --skirmish=4p-ffa.json --autogame --headless
--------------------------------------------------------------------------------------
 * Warzone 2100 - Headless Mode
 * Version: 4.3.5, Built: 2023-11-01
--------------------------------------------------------------------------------------
info    |21:15:15: [NEThostGame:4050] spectatorHost flag will be ignored
info    |21:15:15: [NEThostGame:4050] Assert in Warzone: /builddir/build/BUILD/warzone2100/lib/netplay/netplay.cpp:4050 (!spectatorHost), last script event: ''
/usr/include/c++/13/bits/stl_vector.h:1125: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = AIDATA; _Alloc = std::allocator<AIDATA>; reference = AIDATA&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
/usr/bin/gdb: warning: Couldn't determine a path for the index cache directory.
No frame at level 0x7ffe8d7d0690.
Saved dump file to '/home/ss/.local/share/warzone2100//logs/warzone2100.gdmp-FYfHfU'
If you create a bugreport regarding this crash, please include this file.
Aborted (core dumped)

P.S. "spectatorHost flag will be ignored", but as seen "spectatorHost" is set to true.

KJeff01 commented 1 month ago

The file you are looking for will be at bonecrusher/bonecrusher.js (as shown here)

Chewbakka-Wakka commented 1 month ago

Seems a bit strange with the pathing, note as below comparing 2p-bc-broken.json which fails but 2p-bc-fix.json works. Compare with "ai": "multiplay/skirmish/Cobra.js", that remains static in both cases. 2p-bc-broken.json 2p-bc-fix.json

It'd be good if the error and crash dump was a bit more verbose as to where the issue is too