ExecutionEngineException: Attempting to call method 'Unity.Entities.FastEquality+CompareImpl`1

@elliotc-unity I tried 0.51 release at Unity 2021.3.4f1 and build android build but the android failed to run properly and get the following error:

2022/06/16 23:36:05.710 8764 8797 Error Unity ExecutionEngineException: Attempting to call method ‘Unity.Entities.FastEquality+CompareImpl1[[Unity.Physics.PhysicsWorldIndex, Unity.Physics, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::CompareFunc' for which no ahead of time (AOT) code was generated. 2022/06/16 23:36:05.710 8764 8797 Error Unity at Unity.Entities.FastEquality.Equals[T] (T& lhs, T& rhs, Unity.Entities.FastEquality+TypeInfo typeInfo) [0x00000] in <00000000000000000000000000000000>:0 2022/06/16 23:36:05.710 8764 8797 Error Unity at Unity.Entities.TypeManager.Equals[T] (T& left, T& right) [0x00000] in <00000000000000000000000000000000>:0 2022/06/16 23:36:05.710 8764 8797 Error Unity at Unity.Entities.ManagedComponentStore.FindSharedComponentIndex[T] (System.Int32 typeIndex, T newData) [0x00000] in <00000000000000000000000000000000>:0 2022/06/16 23:36:05.710 8764 8797 Error Unity at Unity.Entities.ManagedComponentStore.InsertSharedComponent_Managed[T] (T newData) [0x00000] in <00000000000000000000000000000000>:0 2022/06/16 23:36:05.710 8764 8797 Error Unity at Unity.Entities.EntityDataAccess.InsertSharedComponent[T] (T newData) [0x00000] in <00000000000000000000000000000000>:0 2022/06/16 23:36:05.710 8764 8797 Error Unity at Unity.Entities.EntityQueryImpl.AddSharedComponentFilter[Shar 2022/06/16 23:36:05.939 8764 8797 Error Unity ExecutionEngineException: Attempting to call method 'Unity.Entities.FastEquality+CompareImpl1[[Unity.Physics.PhysicsWorldIndex, Unity.Physics, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::CompareFunc’ for which no ahead of time (AOT) code was generated.
2022/06/16 23:36:05.939 8764 8797 Error Unity at Unity.Entities.FastEquality.Equals[T] (T& lhs, T& rhs, Unity.Entities.FastEquality+TypeInfo typeInfo) [0x00000] in <00000000000000000000000000000000>:0
2022/06/16 23:36:05.939 8764 8797 Error Unity at Unity.Entities.TypeManager.Equals[T] (T& left, T& right) [0x00000] in <00000000000000000000000000000000>:0
2022/06/16 23:36:05.939 8764 8797 Error Unity at Unity.Entities.ManagedComponentStore.FindSharedComponentIndex[T] (System.Int32 typeIndex, T newData) [0x00000] in <00000000000000000000000000000000>:0
2022/06/16 23:36:05.939 8764 8797 Error Unity at Unity.Entities.ManagedComponentStore.InsertSharedComponent_Managed[T] (T newData) [0x00000] in <00000000000000000000000000000000>:0
2022/06/16 23:36:05.939 8764 8797 Error Unity at Unity.Entities.EntityDataAccess.InsertSharedComponent[T] (T newData) [0x00000] in <00000000000000000000000000000000>:0
2022/06/16 23:36:05.939 8764 8797 Error Unity at Unity.Entities.EntityQueryImpl.AddSharedComponentFilter[Shar
2022/06/16 23:36:06.186 8764 8797 Error Unity ExecutionEngineException: Attempting to call method ‘Unity.Entities.FastEquality+CompareImpl1[[Unity.Physics.PhysicsWorldIndex, Unity.Physics, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::CompareFunc' for which no ahead of time (AOT) code was generated. 2022/06/16 23:36:06.186 8764 8797 Error Unity at Unity.Entities.FastEquality.Equals[T] (T& lhs, T& rhs, Unity.Entities.FastEquality+TypeInfo typeInfo) [0x00000] in <00000000000000000000000000000000>:0 2022/06/16 23:36:06.186 8764 8797 Error Unity at Unity.Entities.TypeManager.Equals[T] (T& left, T& right) [0x00000] in <00000000000000000000000000000000>:0 2022/06/16 23:36:06.186 8764 8797 Error Unity at Unity.Entities.ManagedComponentStore.FindSharedComponentIndex[T] (System.Int32 typeIndex, T newData) [0x00000] in <00000000000000000000000000000000>:0 2022/06/16 23:36:06.186 8764 8797 Error Unity at Unity.Entities.ManagedComponentStore.InsertSharedComponent_Managed[T] (T newData) [0x00000] in <00000000000000000000000000000000>:0 2022/06/16 23:36:06.186 8764 8797 Error Unity at Unity.Entities.EntityDataAccess.InsertSharedComponent[T] (T newData) [0x00000] in <00000000000000000000000000000000>:0 2022/06/16 23:36:06.186 8764 8797 Error Unity at Unity.Entities.EntityDataAccess.SetSharedComponentData[T] (U 2022/06/16 23:36:06.361 8764 8797 Error Unity ExecutionEngineException: Attempting to call method 'Unity.Entities.FastEquality+GetHashCodeImpl1[[Unity.Entities.SceneSection, Unity.Entities, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::GetHashCodeFunc’ for which no ahead of time (AOT) code was generated.
2022/06/16 23:36:06.361 8764 8797 Error Unity at Unity.Entities.TypeManager.GetHashCode (System.Void* val, System.Int32 typeIndex) [0x00000] in <00000000000000000000000000000000>:0
2022/06/16 23:36:06.361 8764 8797 Error Unity at Unity.Entities.TypeManager.GetHashCode (System.Object val, System.Int32 typeIndex) [0x00000] in <00000000000000000000000000000000>:0
2022/06/16 23:36:06.361 8764 8797 Error Unity at Unity.Entities.Serialization.SerializeUtility.ReadSharedComponents (Unity.Entities.ExclusiveEntityTransaction manager, Unity.Entities.Serialization.ManagedObjectBinaryReader managedDataReader, Unity.Collections.NativeArray1[T] sharedComponentRemap, Unity.Collections.NativeArray1[T] sharedComponentRecordArray) [0x00000] in <00000000000000000000000000000000>:0
2022/06/16 23:36:06.361 8764 8797 Error Unity at Unity.Entities.Serialization.SerializeUtility.EndDeserializeWorld (Unity.Entities.ExclusiveEntityTra

4 Likes

i have this same error.
to reproduce, the project should have com.unity.physics@0.51.0-preview.32 and the project should build for il2cpp

1 Like

Yeah, we pulled the trigger too early for several different purposes. People seem reasonably hair on fire about it. We’ll publish another round with fixes soon™.

8 Likes

I obviously can’t speak for everyone, but I think substantially more detailed dev logs on a much more regular basis would go a long way toward assuaging my frustration with these packages and their development. “Seems like soon” is better than radio silence, but we’re still experiencing an infuriating cycle where we can neither work with the thing nor do we have any idea what’s going on behind the scenes.

Unity is not just software we use, it’s the beating heart of our products, and DOTS represents a paradigm shift that’s likely to govern the course of our careers. This particular dev hell has been so alienating that I’m no longer sure if I’m a Unity loyalist, or just don’t like the competition. Please communicate more.

1 Like

@optimise @EugenyN1 can one of you try enabling full generic sharing for your build via project settings → player → configuration section → IL2CPP Code Generation → Faster (smaller) builds? We have a theory that this might be a workaround.

4 Likes

yes, that fixes the problem. Thanks.

2 Likes

The setting mentioned doesn’t appear under project settings for us, but rather under the classic Build Settings menu.
The workaround appears to work for us as well, thank you!

2 Likes

@elliotc-unity Looks like IL2CPP Code Generation not able to serialize into ProjectSettings. Can u make sure it will be serialize into ProjectSettings at next Unity 2020.3.x version? With this current limitation I can’t make sure the same project able to get working build at another machine.

Eh? This is only an issue in 21.3, I thought, not 20.3? Also, all of Unity is off today, and yes we agree it was a mistake to release before a long weekend, as well as releasing without checking all these things.

3 Likes

Ya. It’s 21.3 only issue. What I want to say is IL2CPP Code Generation option is actually at Build Settings instead of at ProjectSettings which make not able to save this option into ProjectSettings. I would like to see this option moves to ProjectSettings in future 21.3.x release.

Btw I also curious I need to choose Faster (smaller) builds in order to fix the issue? Is that il2cpp codegen has some bugs?

1 Like

It is probably the Full Generic Sharing feature of IL2CPP. In 2021LTS it’s only active with “Faster (smaller) builds”. In 2022 it’s always on. Got this from a forum post some time ago that I can’t find anymore.

1 Like

Where is “project settings → player → configuration section → IL2CPP Code Generation → Faster (smaller) builds” menu? I cant find it.

Its in the old build settings :

8317629--1091586--upload_2022-7-28_8-20-22.png

I can verify that the error is still occurring under 0.51.1-preview.21.

Also, does anyone know how to change disable full generic sharing mode in the scriptable build pipeline (WindowsClassicBuildConfiguration)?

I don’t have that option:
8340900--1096848--upload_2022-8-5_15-27-28.png

Also, I’m using the build configuration pipeline because it supports subscenes and I don’t see that option there either.
8340900--1096851--upload_2022-8-5_15-29-31.png

I’m using 0.51.1-preview.21 in unity 2021.3.7f1 and I’m trying to fix the error: ExecutionEngineException: Attempting to call method ‘Unity.Entities.FastEquality+CompareImpl’1[[Unity.Physics.PhysicsWorldIndex…]]:CompareFunct’ for which no ahead of time (AOT) code was generated".

It gets triggered in an async coroutine when loading prefabs via addressables’ LoadAssetsAsync().

1 Like

That was one of the first places I looked, but for some reason I don’t have it there:

8340978--1096866--upload_2022-8-5_16-20-49.png

Is there something I need to do in order to make the option appear?

…
8341008--1096878--upload_2022-8-5_15-32-26.png

1 Like

Ah. I actually had the scripting backend set for il2cpp already, but I had two projects open and I accidentally looked at the settings for the wrong one when I sent my last post :face_with_spiral_eyes::smile:. Anyway, thanks for the help - the error is gone!!

1 Like

I’m happy to announce that the fix for this has landed in 2021.3.9f1, which is now live! You can all set your builds back to “faster runtime” if you like. :slight_smile:

4 Likes

Just updated to 2021.3.9f1 and I now get the crash with both faster builds, and faster runtime. On Mac, with IL2CPP.

The crash log looks like this for both settings:

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000021b00000005
Exception Codes: 0x0000000000000001, 0x0000021b00000005
Exception Note: EXC_CORPSE_NOTIFY

Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [10618]

VM Region Info: 0x21b00000005 is not in any region. Bytes after previous region: 1833951035398 Bytes before following region: 103238128893947
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
commpage (reserved) 1000000000-7000000000 [384.0G] —/— SM=NUL …(unallocated)
—> GAP OF 0x5f9000000000 BYTES
MALLOC_NANO 600000000000-600008000000 [128.0M] rw-/rwx SM=PRV

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 0x10228eefc ???
1 0x10228ee2c ???
2 ??? 0x12cd297f2 86876c11ad8b63968805b88bf0d31953_x64_sse4 + 18
3 UnityPlayer.dylib 0x10c7650b9 0x10c307000 + 4579513
4 UnityPlayer.dylib 0x10c30ab7e 0x10c307000 + 15230
5 GameAssembly.dylib 0x1215b551b 0x11f4bd000 + 34571547
6 GameAssembly.dylib 0x121526556 0x11f4bd000 + 33985878
7 GameAssembly.dylib 0x1201ee1b0 0x11f4bd000 + 13832624
8 GameAssembly.dylib 0x120114a83 0x11f4bd000 + 12941955
9 GameAssembly.dylib 0x12011a2af 0x11f4bd000 + 12964527
10 GameAssembly.dylib 0x120114a83 0x11f4bd000 + 12941955
11 GameAssembly.dylib 0x120aabeca 0x11f4bd000 + 22998730
12 GameAssembly.dylib 0x120ab2b8a 0x11f4bd000 + 23026570
13 GameAssembly.dylib 0x12188832d 0x11f4bd000 + 37532461
14 GameAssembly.dylib 0x120abc4fc 0x11f4bd000 + 23065852
15 GameAssembly.dylib 0x12164bd57 0x11f4bd000 + 35188055
16 GameAssembly.dylib 0x120abca2f 0x11f4bd000 + 23067183
17 GameAssembly.dylib 0x120114a83 0x11f4bd000 + 12941955
18 GameAssembly.dylib 0x12011a2af 0x11f4bd000 + 12964527
19 GameAssembly.dylib 0x120114a83 0x11f4bd000 + 12941955
20 GameAssembly.dylib 0x120aabeca 0x11f4bd000 + 22998730
21 GameAssembly.dylib 0x120aaaeb8 0x11f4bd000 + 22994616
22 GameAssembly.dylib 0x120114a83 0x11f4bd000 + 12941955
23 GameAssembly.dylib 0x12011a2af 0x11f4bd000 + 12964527
24 GameAssembly.dylib 0x120114a83 0x11f4bd000 + 12941955
25 GameAssembly.dylib 0x11f9e5974 0x11f4bd000 + 5409140
26 GameAssembly.dylib 0x11f9e57ee 0x11f4bd000 + 5408750
27 UnityPlayer.dylib 0x10c95333c 0x10c307000 + 6603580
28 UnityPlayer.dylib 0x10c959310 0x10c307000 + 6628112
29 UnityPlayer.dylib 0x10c7a08f6 0x10c307000 + 4823286
30 UnityPlayer.dylib 0x10c7a0984 0x10c307000 + 4823428
31 UnityPlayer.dylib 0x10c7a0c03 0x10c307000 + 4824067
32 UnityPlayer.dylib 0x10d27eef5 0x10c307000 + 16219893
33 Foundation 0x7ff815583ef1 __NSFireTimer + 67
34 CoreFoundation 0x7ff8147c8016 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20
35 CoreFoundation 0x7ff8147c7b07 __CFRunLoopDoTimer + 923
36 CoreFoundation 0x7ff8147c766b __CFRunLoopDoTimers + 307
37 CoreFoundation 0x7ff8147aded2 __CFRunLoopRun + 2014
38 CoreFoundation 0x7ff8147ad034 CFRunLoopRunSpecific + 562
39 HIToolbox 0x7ff81d8c95e6 RunCurrentEventLoopInMode + 292
40 HIToolbox 0x7ff81d8c934a ReceiveNextEventCommon + 594
41 HIToolbox 0x7ff81d8c90e5 _BlockUntilNextEventMatchingListInModeWithFilter + 70
42 AppKit 0x7ff81711dfad _DPSNextEvent + 927
43 AppKit 0x7ff81711c66a -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1394
44 AppKit 0x7ff81710ed19 -[NSApplication run] + 586
45 AppKit 0x7ff8170e2c97 NSApplicationMain + 817
46 UnityPlayer.dylib 0x10d28259d PlayerMain(int, char const**) + 989
47 dyld 0x20229752e start + 462