Exception 4.3.11+4.3.12 Nintendo Switch

Hi,

we area playing around with the new Beta versions which support Burst compiler. On PC everything runs fine, but when we build for Nintendo Switch we get the following error:

InvalidOperationException: A job tries to read from the native array JobCheckCollisions.collisionResult which contains uninitialized data
  at Pathfinding.Jobs.JobDependencyAnalyzer1[T].GetDependencies (T& data, Pathfinding.Jobs.JobDependencyTracker tracker, Unity.Jobs.JobHandle additionalDependency, System.Boolean useAdditionalDependency) [0x00000] in <00000000000000000000000000000000>:0 
  at Pathfinding.Jobs.JobDependencyAnalyzer1[T].GetDependencies (T& data, Pathfinding.Jobs.JobDependencyTracker tracker) [0x00000] in <00000000000000000000000000000000>:0 
  at Pathfinding.Jobs.IJobExtensions.ScheduleManagedInMainThread[T] (T data, Pathfinding.Jobs.JobDependencyTracker tracker) [0x00000] in <00000000000000000000000000000000>:0 
  at Pathfinding.GridGraph+GridGraphScanData.CollisionCheck (Pathfinding.GraphCollision collision) [0x00000] in <00000000000000000000000000000000>:0 
  at Pathfinding.GridGraph+<UpdateAreaBurstCoroutine>d103.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
  at Pathfinding.Jobs.JobHandleWithMainThreadWork+<CompleteTimeSliced>d6.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
  at Pathfinding.GridGraph+<ScanInternalBurst>d98.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
  at Pathfinding.GridGraph+<ScanInternal>d106.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
  at AstarPath+<ScanGraph>d142.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
  at AstarPath+<ScanInternal>d141.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
  at GraphUpdateManager+<ScanGraphs>d__7.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in <00000000000000000000000000000000>:0

I also looked into the code, however i can’t seem to find the “branch” between PC and Switch. We have other Jobs running fine in our game (however not as complicated as the A* Project ones). I thought it might have to do with the UninitializedMemory option somehow? Maybe on Switch they are “even more” uninitialized? :smiley:

Would love a fix or at least an idea on how to fix this.

Thanks & Best regards
Bennet

Hi

Do you think you could try if version beta 4.3.12 fixes this?

Hi,

like written in the Subject we already tried 4.3.12.

Best regards
Bennet

Hi

Oh, sorry. For some reason I only noticed 4.3.11 in the subject.

Do you think you could try to replace your JobDependencyTracker.cs script with this: https://pastebin.com/E99N6Upy.

Then run the game on the switch and send the log file to me?

Here you go:
https://pastebin.com/deGYer2u

Maybe another important note: We use Physics2D raycasting, not sure if JobCheckCollisions should be activated anyway?

Hmmm… Something strange is going on. My code thinks two arrays have the same pointer, even though they really do not.

Switch uses IL2CPP, right? Do you think you could send me the C++ source code that Unity generates for your standalone game?

Hi,

just tried a PC IL2CPP (Master) build and it now also produces the exception. Maybe you can reproduce it with this?

I’ll upload the IL2CPP stuff and send it via mail.

Best regards
Bennet

I can’t seem to find a functioning e-mail address of you?

You can also send him the DL link over a direct message here on the forums :slight_smile:

Haha, just searched for the feature by clicking his username. But now i found it. Thank you @ToastyStoemp!

EDIT: Unfortunately there is no option for a new message, just the inbox with a message from a bot, but no way to send a new message. Maybe I have not enough posts to get the privilege or something?

Hi

I figured it out. This was due to a bug in IL2CPP. I have reported this bug to Unity and worked around it. 4.3.13 has now been uploaded which fixes this.

Hi!

Thanks for the super fast fix, it works on IL2CPP PC. Will test it on Monday for the Switch.

1 Like