View Issue Details

IDProjectCategoryLast Update
0026106AI War 2Crash/ExceptionJan 13, 2022 6:44 pm
Reporterslake-moth Assigned ToChris_McElligottPark  
Status resolvedResolutionfixed 
Product VersionBeta 3.783 The Return Of Multiplayer! 
Fixed in VersionBeta 3.784 Tractor Recursion 
Summary0026106: DELAYED27 TID40 DoEntityStepLogic_Ship error at debugStage 14000: System.StackOverflowException: The requested operation caused
DescriptionSINGLEP DELAYED27 TID40 DoEntityStepLogic_Ship error at debugStage 14000: System.StackOverflowException: The requested operation caused a stack overflow.
  at (wrapper managed-to-native) System.Object.__icall_wrapper_ves_icall_object_new_specific(intptr)
  at Arcen.Universal.ConcurrentDictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) [0x00001] in <ca3be25228984665bdff92d191715683>:0
  at Arcen.Universal.ConcurrentDictionary`2[TKey,TValue].ContainsKey (TKey key) [0x00019] in <ca3be25228984665bdff92d191715683>:0
  at Arcen.AIW2.Core.World_AIW2.GetEntityByID_Squad (System.Int32 id) [0x0000d] in <07644fce53f54a7c97c10d4a2191120f>:0
  at Arcen.AIW2.Core.GameEntity_Squad.SetWorldLocation (System.Int32 x, System.Int32 y, System.Boolean IsFromDeserialization) [0x00088] in <07644fce53f54a7c97c10d4a2191120f>:0
  at Arcen.AIW2.Core.GameEntity_Squad.SetWorldLocation (System.Int32 x, System.Int32 y, System.Boolean IsFromDeserialization) [0x00101] in <07644fce53f54a7c97c10d4a2191120f>:0
  at Arcen.AIW2.Core.GameEntity_Squad.SetWorldLocation (System.Int32 x, System.Int32 y, System.Boolean IsFromDeserialization) [0x00101] in <07644fce53f54a7c97c10d4a2191120f>:0
  at Arcen.AIW2.Core.GameEntity_Squad.SetWorldLocation (System.Int32 x, System.Int32 y, System.Boolean IsFromDeserialization) [0x00101] in <07644fce53f54a7c97c10d4a2191120f>:0
  at Arcen.AIW2.Core.GameEntity_Squad.SetWorldLocation (System.Int32 x, System.Int32 y, System.Boolean IsFromDeserialization) [0x00101] in <07644fce53f54a7c97c10d4a2191120f>:0
TagsNo tags attached.

Activities

slake-moth

Jan 12, 2022 7:47 pm

reporter  

start2.save (316,957 bytes)
start2.savemet (83 bytes)   
OC
263526251
11458
Random 7
Random
Difficulty 7
1
<color=#0000fb>slake-moth</color>
start2.savemet (83 bytes)   
ArcenDebugLog.txt (1,783,761 bytes)

Chris_McElligottPark

Jan 13, 2022 6:44 pm

administrator   ~0063775

Thanks!

* Fixed a very confusing and semi-rare (but extremely consistent when it does happen) crash bug that seemed to be new in the last build. This was a very subtle code bug from myself that I didn't even recognize after putting in an initial fix until Democracy made a further comment.
** This took an incredibly long time to track down because it left no actual errors and just crashed to the desktop, or left only errors unrelated to itself on linux apparently. It took 80 minutes to find this with a savegame in which I could reproduce the error in 3 seconds, and without that save (thank you BobDobbs!) I couldn't have debugged it at all.
** The issue here was "what happens if two tractor beam units both grab one another and try to pull at the same time?" Unlike the peasant railgun, this is isn't an absurd speed that is reached, but rather a stack overflow that is so harsh it causes a segfault (writing to protected memory).
** The general situation was like this: "tractor A grabs B, which is also a tractor, which grabs A. A moves, dragging B with it. B has moved, so it pushes A with it, which causes B to be pulled, which moves A, etc." Actually it probably does work like a railgun, except it essentially accelerates them both to infinity speed within a nanosecond, so the world collapses in a singularity.
** I'm pretty sure that Zeus and I had talked about this a long time ago as a possibility with some DLC2 stuff, but the units in question at the time were set up so that we never had to test this corner case. I take it that the balance has changed such that this corner case became relevant.
** Anyhow, originally I was just going to just make tractors not grab tractors, but then Democracy noted that this case was safely working before (Ensnarer Battlestations would do it). So that reminded me of the code change I did last build, and reviewed earlier today without seeing the issue. Based on that, I managed to let tractors drag tractors again, but keep them from infinite looping.
** Thanks to Bummeri, william montag, and BobDobbs for reporting, to BobDobbs for the super helpful save, and to Democracy for the added notes about tractor dragging. Also thanks to abjohnsonzz and slake-moth for an error log. I could have fixed this in under 5 minutes if I'd seen their report firsts, because it did not crash to desktop silently, but instead had a useful log -- however, in fairness, I probably would not have been positive it was the same bug.

Issue History

Date Modified Username Field Change
Jan 12, 2022 7:47 pm slake-moth New Issue
Jan 12, 2022 7:47 pm slake-moth File Added: start2.save
Jan 12, 2022 7:47 pm slake-moth File Added: start2.savemet
Jan 12, 2022 7:47 pm slake-moth File Added: ArcenDebugLog.txt
Jan 13, 2022 6:44 pm Chris_McElligottPark Assigned To => Chris_McElligottPark
Jan 13, 2022 6:44 pm Chris_McElligottPark Status new => resolved
Jan 13, 2022 6:44 pm Chris_McElligottPark Resolution open => fixed
Jan 13, 2022 6:44 pm Chris_McElligottPark Fixed in Version => Beta 3.784 Tractor Recursion
Jan 13, 2022 6:44 pm Chris_McElligottPark Note Added: 0063775