rlcevg / CircuitAI

Spring RTS local native AI
GNU General Public License v2.0
18 stars 19 forks source link

Latest circuit AI crashes when launching a campaign battle #94

Closed GoogleFrog closed 5 years ago

GoogleFrog commented 5 years ago

It is fine in normal skirmish games. This is on engine 104.0.1-901-g89b4773.

rlcevg commented 5 years ago

Can't start "mono Zero-K.exe", it always hangs at

[bob@bob-pc ZK]$ export TERM=xterm && mono Zero-K.exe 
Zero-K.exe Error: 0 : Error starting GameAnalytics: System.TypeInitializationException: The type initializer for 'GameAnalyticsSDK.Net.Threading.GAThreading' threw an exception. ---> System.TypeInitializationException: The type initializer for 'GameAnalyticsSDK.Net.Logging.GALogger' threw an exception. ---> NLog.NLogConfigurationException: Error when setting property 'Format' on Layout Renderer: ${date} ---> System.ArgumentException: Object of type 'System.ReadOnlySpan`1[System.Char]' cannot be converted to type 'System.String'.
  at System.RuntimeType.CheckValue (System.Object value, System.Reflection.Binder binder, System.Globalization.CultureInfo culture, System.Reflection.BindingFlags invokeAttr) [0x00071] in <c6745222adcf4e3f90bbf18e4a1af3ac>:0 
  at System.Reflection.MonoMethod.ConvertValues (System.Reflection.Binder binder, System.Object[] args, System.Reflection.ParameterInfo[] pinfo, System.Globalization.CultureInfo culture, System.Reflection.BindingFlags invokeAttr) [0x00069] in <c6745222adcf4e3f90bbf18e4a1af3ac>:0 
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00011] in <c6745222adcf4e3f90bbf18e4a1af3ac>:0 
  at System.Reflection.MonoProperty.SetValue (System.Object obj, System.Object value, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] index, System.Globalization.CultureInfo culture) [0x0005d] in <c6745222adcf4e3f90bbf18e4a1af3ac>:0 
  at System.Reflection.PropertyInfo.SetValue (System.Object obj, System.Object value, System.Object[] index) [0x00000] in <c6745222adcf4e3f90bbf18e4a1af3ac>:0 
  at NLog.Internal.PropertyHelper.SetPropertyFromString (System.Object obj, System.String propertyName, System.String value, NLog.Config.ConfigurationItemFactory configurationItemFactory) [0x00129] in <780b851811e34ba8b86f59a244475f4d>:0 
   --- End of inner exception stack trace ---
  at NLog.Internal.PropertyHelper.SetPropertyFromString (System.Object obj, System.String propertyName, System.String value, NLog.Config.ConfigurationItemFactory configurationItemFactory) [0x001e3] in <780b851811e34ba8b86f59a244475f4d>:0 
  at NLog.Layouts.LayoutParser.ParseLayoutRenderer (NLog.Config.ConfigurationItemFactory configurationItemFactory, NLog.Internal.SimpleStringReader sr) [0x00168] in <780b851811e34ba8b86f59a244475f4d>:0 
  at NLog.Layouts.LayoutParser.CompileLayout (NLog.Config.ConfigurationItemFactory configurationItemFactory, NLog.Internal.SimpleStringReader sr, System.Boolean isNested, System.String& text) [0x000bb] in <780b851811e34ba8b86f59a244475f4d>:0 
  at NLog.Layouts.SimpleLayout.set_Text (System.String value) [0x0002b] in <780b851811e34ba8b86f59a244475f4d>:0 
  at NLog.Layouts.SimpleLayout..ctor (System.String txt, NLog.Config.ConfigurationItemFactory configurationItemFactory) [0x0000d] in <780b851811e34ba8b86f59a244475f4d>:0 
  at NLog.Layouts.Layout.FromString (System.String layoutText, NLog.Config.ConfigurationItemFactory configurationItemFactory) [0x00000] in <780b851811e34ba8b86f59a244475f4d>:0 
  at NLog.Layouts.Layout.FromString (System.String layoutText) [0x00006] in <780b851811e34ba8b86f59a244475f4d>:0 
  at NLog.Layouts.Layout.op_Implicit (System.String text) [0x00000] in <780b851811e34ba8b86f59a244475f4d>:0 
  at GameAnalyticsSDK.Net.Logging.GALogger..ctor () [0x00039] in <780b851811e34ba8b86f59a244475f4d>:0 
  at GameAnalyticsSDK.Net.Logging.GALogger..cctor () [0x00000] in <780b851811e34ba8b86f59a244475f4d>:0 
   --- End of inner exception stack trace ---
  at GameAnalyticsSDK.Net.Threading.GAThreading..ctor () [0x00027] in <780b851811e34ba8b86f59a244475f4d>:0 
  at GameAnalyticsSDK.Net.Threading.GAThreading..cctor () [0x00006] in <780b851811e34ba8b86f59a244475f4d>:0 
   --- End of inner exception stack trace ---
  at GameAnalyticsSDK.Net.GameAnalytics.Initialize (System.String gameKey, System.String gameSecret) [0x00019] in <780b851811e34ba8b86f59a244475f4d>:0 
  at ChobbyLauncher.Program.Main (System.String[] args) [0x0005b] in <780b851811e34ba8b86f59a244475f4d>:0 

(mono:23090): Gtk-WARNING **: 19:40:54.695: Unable to locate theme engine in module_path: "adwaita",

(mono:23090): Gtk-WARNING **: 19:40:54.700: Unable to locate theme engine in module_path: "adwaita",
Zero-K.exe Information: 0 : Checking for self-upgrade
Zero-K.exe Information: 0 : Querying default engine
rlcevg commented 5 years ago

Ripped startscript from windows. 3rd mission: start_script.txt

rlcevg commented 5 years ago

Can't reproduce. After next changes inside start_script.txt:

- shortname=CircuitAIBrutal64;
+ shortname=DevCircuitAIBrutal64;
- gametype=Zero-K $VERSION;
+ gametype=Zero-K v1.6.11.3;

everything works fine with 104.0.1-901-g89b4773.

GoogleFrog commented 5 years ago

I'm on 32 bit windows using the circuits built alongside 104.0.1-901-g89b4773.

rlcevg commented 5 years ago

win32 and start_script also works fine with shortname=DevCircuitAIBrutal32.

GoogleFrog commented 5 years ago

Here is a crash report: https://github.com/ZeroK-RTS/CrashReports/issues/17174

I've attached the script and circuit.

DevCircuitAINormal32.zip

_script.txt

rlcevg commented 5 years ago

Confirmed. AI crashes (linux64 too) with long enough nonsense string inside [modoptions] section of start_script, probably catastrophic regex backtracking.

rlcevg commented 5 years ago

https://github.com/rlcevg/CircuitAI/commit/8014c766c888abfba62c1ee82d92f4275c9c3305 is in spring's develop

rlcevg commented 5 years ago

https://github.com/ZeroK-RTS/CrashReports/issues/17500 Still long strings, but another place.


libstdc++ regex's (recursive) executor can't handle long (50KB) matching sequences.

rlcevg commented 5 years ago

The better way is to add more API into engine, like

springai::SkirmishAI* ai = ...;
OptionValues* options = ai->GetOptionValues();
... = options->GetValueByKey("disabledunits");
delete options;

but for Modoptions, AllyTeam, Team, etc. Alas for now: https://github.com/rlcevg/CircuitAI/commit/8c065e18cd56662d765a3c9a7f9e5f6b7d4a0bdc