Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Visual "Exception User-Unhandled" on Unity 2022.1.17f1
#1
Hello,

We are currently in the process of upgrading our project from Unity 2020.3.26f1 to Unity 2022.1.17f1, using Obi 6.4

When we attach Visual to Unity Editor, we get these "Exception User-Unhandled" multiples times (20-30x) when we hit Play / Unplay / open a scene in the Editor.


Code:
System.ObjectDisposedException: The UNKNOWN_OBJECT_TYPE has been deallocated, it is not allowed to access it
  at (wrapper managed-to-native) Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckDeallocateAndThrow_Injected(Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle&)
  at Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckDeallocateAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) [0x00000] in <790a43858b4b404fbe02a2b7b4a0d9d6>:0
  at Obi.ObiNativeList`1[T].Dispose (System.Boolean disposing) [0x0003d] in H:\MyUser\Dev\Unity\MyProject-01-unity2022\Assets\Obi\Scripts\Common\DataStructures\NativeList\ObiNativeList.cs:110
  at Obi.ObiNativeList`1[T].Finalize () [0x00002] in H:\MyUser\Dev\Unity\MyProject-climb-01-unity2022\Assets\Obi\Scripts\Common\DataStructures\NativeList\ObiNativeList.cs:90
 

Any workaround around this?
Thanks
Reply
#2
(07-11-2022, 03:36 PM)bagelbaker Wrote: Hello,

We are currently in the process of upgrading our project from Unity 2020.3.26f1 to Unity 2022.1.17f1, using Obi 6.4

When we attach Visual to Unity Editor, we get these "Exception User-Unhandled" multiples times (20-30x) when we hit Play / Unplay / open a scene in the Editor.


Code:
System.ObjectDisposedException: The UNKNOWN_OBJECT_TYPE has been deallocated, it is not allowed to access it
  at (wrapper managed-to-native) Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckDeallocateAndThrow_Injected(Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle&)
  at Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckDeallocateAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) [0x00000] in <790a43858b4b404fbe02a2b7b4a0d9d6>:0
  at Obi.ObiNativeList`1[T].Dispose (System.Boolean disposing) [0x0003d] in H:\MyUser\Dev\Unity\MyProject-01-unity2022\Assets\Obi\Scripts\Common\DataStructures\NativeList\ObiNativeList.cs:110
  at Obi.ObiNativeList`1[T].Finalize () [0x00002] in H:\MyUser\Dev\Unity\MyProject-climb-01-unity2022\Assets\Obi\Scripts\Common\DataStructures\NativeList\ObiNativeList.cs:90
 

Any workaround around this?
Thanks

Hi there,

I've been unable to reproduce this so far, it's also weird that it happens only when attaching Visual Studio. If you could provide exact steps to reproduce it, it would be very useful Sonrisa

These checks are only performed when safety checks are enabled in the Jobs->Burst menu, disabling them should get rid of the exceptions.

let me know if I can help in any way,

kind regards
Reply
#3
Hello,

Just to be clear, the exception occurs in Visual and nothing is logged in Unity.
https://www.dropbox.com/s/s7b29dk8zbrj3h...n.png?dl=0

I just managed to reproduce it in a simple project with Obi 4.6 imported.
  1. Open RopeShowcase
  2. "Attach to Unity" in Visual (2019)
  3. Hit "Play" in the Editor.
  4. The exception should occur in Visual.
This occurs in Unity 2022.1.17f1 but not in 2021.3.2f1

Oh and disabling safety checks doesn't get rid of the issue.

Cheers
Reply
#4
(08-11-2022, 08:24 PM)bagelbaker Wrote: Hello,

Just to be clear, the exception occurs in Visual and nothing is logged in Unity.
https://www.dropbox.com/s/s7b29dk8zbrj3h...n.png?dl=0

I just managed to reproduce it in a simple project with Obi 4.6 imported.
  1. Open RopeShowcase
  2. "Attach to Unity" in Visual (2019)
  3. Hit "Play" in the Editor.
  4. The exception should occur in Visual.
This occurs in Unity 2022.1.17f1 but not in 2021.3.2f1

Oh and disabling safety checks doesn't get rid of the issue.

Cheers

Hi,

Thanks for the details! I was able to reproduce this, I can't identify any issues in Obi's code that would lead to this behavior. It seems like a bug in either VS or Unity. I'll be trying to create a minimal reproducible example and raise a bug report with Unity, will keep you informed.

kind regards,
Reply
#5
There's a workaround for this issue, which is to follow this answer https://stackoverflow.com/a/60083330

For us, the "Break when this exception type..." option doesn't appear so we had to do it like this:

  1. When the break on exceptions occurs, open the "Exception settings" window and uncheck "Common Language Runtime Exceptions". 
  2. The next time it breaks, the option to "Break when this exception type..." will appear and you can uncheck it. 
  3. The break will not occur anymore. 
Reply