View Issue Details

IDProjectCategoryLast Update
0019326AI War 2Crash/ExceptionFeb 8, 2018 2:40 pm
ReporterBadgerBadger Assigned Tokeith.lamothe  
Status resolvedResolutionfixed 
Product Version0.612 
Fixed in Version0.706 
Summary0019326: Game Lobby: Crash doing faction updating
DescriptionI was messing with the options in the Faction screen. I was trying some weird/random things, like making everything the same colour, and I hit a crash.

12/29/2017 11:03:53 AM Successfully opened host socket
12/29/2017 11:04:02 AM
-----------
NullReferenceException: Object reference not set to an instance of an object
Stack Trace: Arcen.AIW2.External.Window_GameSetup+dFactionType.Helper_GetShouldExclude (Arcen.AIW2.Core.SpecialFactionData row, FactionType requiredFactionType, Arcen.AIW2.Core.SpecialFactionData currentFactionData)
Arcen.AIW2.External.Window_GameSetup+dFactionType.OnUpdate ()
Arcen.Universal.ArcenUI_Dropdown.OnUpdate_Subclass ()
Arcen.Universal.ArcenUI_Element.UpdateFromUI ()
Arcen.Universal.ArcenUI_Window.OnUpdate ()
Arcen.Universal.ArcenUI.OnUpdate ()
Arcen.Universal.Engine_Universal.OnUpdate ()
ArcenGameController.Update () (at C:/vcprojs/arcengames_aiw_ultra/AIW2Unity/Assets/ArcenCode/ArcenGameController.cs:39)



   at System.Environment.get_StackTrace() in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Environment.cs:line 227
   at Arcen.Universal.ArcenDebugging.ArcenDebugLog(System.String Message, DebugLogDestination Destination, Boolean IncludeStackTrace, Verbosity Verbosity)
   at Arcen.Universal.ArcenDebugging.ArcenDebugLog(System.String Message, DebugLogDestination Destination, Verbosity Verbosity)
   at Arcen.Universal.ArcenDebugging.ArcenDebugLog(System.String Message, Verbosity Verbosity)
   at Arcen.Universal.Engine_Universal.LogWritten(System.String LogString, System.String StackTrace, LogType Type, System.Exception Cause, Boolean CameFromUnity)
   at Arcen.Universal.Engine_Universal.LogWrittenFromUnity(System.String LogString, System.String StackTrace, LogType Type)
   at UnityEngine.Application.CallLogCallback(System.String logString, System.String stackTrace, LogType type, Boolean invokedOnMainThread)

I added some debugging code
            private bool Helper_GetShouldExclude(SpecialFactionData row, FactionType requiredFactionType, SpecialFactionData currentFactionData)
            {
                if( row == null)
                    ArcenDebugging.ArcenDebugLogSingleLine("BUG: helper_getshouldexclude was given null row", Verbosity.DoNotShow );
                if(requiredFactionType == null)
                    ArcenDebugging.ArcenDebugLogSingleLine("BUG: helper_getshouldexclude was given null factionType", Verbosity.DoNotShow );
                if(currentFactionData == null)
                    ArcenDebugging.ArcenDebugLogSingleLine("BUG: helper_getshouldexclude was given null currentFactinoData", Verbosity.DoNotShow );

and now I see a bunch of errors like
12/29/2017 11:09:43 AM BUG: helper_getshouldexclude was given null currentFactinoData
this doesn't always lead to a crash because we have a number of exits from this function before we access currentFactionData.
TagsNo tags attached.

Activities

BadgerBadger

Feb 1, 2018 8:53 pm

manager   ~0046820

I hit this again on .703 (pre-push beta)
NullReferenceException: Object reference not set to an instance of an object
  at Arcen.AIW2.External.Window_GameSetup+dFactionType.Helper_GetShouldExclude (Arcen.AIW2.Core.SpecialFactionData row, FactionType requiredFactionType, Arcen.AIW2.Core.SpecialFactionData currentFactionData) [0x00000] in <filename unknown>:0
  at Arcen.AIW2.External.Window_GameSetup+dFactionType.OnUpdate () [0x00000] in <filename unknown>:0
  at Arcen.Universal.ArcenUI_Dropdown.OnUpdate_Subclass () [0x00000] in <filename unknown>:0
  at Arcen.Universal.ArcenUI_Element.UpdateFromUI () [0x00000] in <filename unknown>:0
  at Arcen.Universal.ArcenUI_Window.OnUpdate () [0x00000] in <filename unknown>:0
  at Arcen.Universal.ArcenUI.OnUpdate () [0x00000] in <filename unknown>:0
  at Arcen.Universal.Engine_Universal.OnUpdate () [0x00000] in <filename unknown>:0
  at ArcenGameController.Update () [0x00011] in D:\vclarge\AI_War_2_Ultra\AIW2Unity\Assets\ArcenCode\ArcenGameController.cs:39

I was trying to enable all the factions quickly. I was clicking on random Faction dropdown bars out of order, then enabling them.

Michael

Feb 2, 2018 5:22 pm

administrator   ~0046835

I am bumping this up to number 5 on the Trello card list based on today's crash report.

keith.lamothe

Feb 8, 2018 2:40 pm

administrator   ~0046929

For 0.706:

* Added protections against null exceptions when changing lobby faction settings rapidly.

It should translate those nulls into non-crashing behavior, but it will log them visually (so it's an error message in the corner, not a screen-covering one) so we can hear about them and find out why whatever it was is null.

On a side note, "currentFactionData" being null is perfectly valid and doesn't cause an exception because it's only used for equality testing and is never dereferenced.

Thanks :)

Issue History

Date Modified Username Field Change
Dec 29, 2017 11:14 am BadgerBadger New Issue
Dec 29, 2017 11:14 am BadgerBadger Status new => assigned
Dec 29, 2017 11:14 am BadgerBadger Assigned To => keith.lamothe
Feb 1, 2018 8:53 pm BadgerBadger Note Added: 0046820
Feb 2, 2018 3:56 pm BadgerBadger Summary Crash doing faction updating => Game Lobby: Crash doing faction updating
Feb 2, 2018 5:22 pm Michael Note Added: 0046835
Feb 8, 2018 2:40 pm keith.lamothe Status assigned => resolved
Feb 8, 2018 2:40 pm keith.lamothe Resolution open => fixed
Feb 8, 2018 2:40 pm keith.lamothe Fixed in Version => 0.706
Feb 8, 2018 2:40 pm keith.lamothe Note Added: 0046929