fullinspector icon indicating copy to clipboard operation
fullinspector copied to clipboard

Unity Editor crashes when reloading the assemblies.

Open Tagette opened this issue 7 years ago • 2 comments

Hello,

I am having an issue with Full Inspector where the editor crashes when reloading the assemblies. I have crash reports with stack traces pointing to the insides of unity. When I take Full Inspector out of our project, it no longer crashes.

  • We have recently updated unity from 5.4 to 5,6.
  • We have updated FullSerializer and FullInspector to the latest version from GitHub.
  • We have tried moving full inspector into a fresh project with the editor scripts that seem to trigger the crash but it does not crash.
  • I've tried to isolate the code that causes the crash, however the problem seems to be widespread across our project. Only editor scripts seems to cause the crash. It seems none of the editor script code is actually run however because debug logs are not called and neither is code that simply writes text to a file.
  • I noticed that the editor log contains a lot of TypeLoadException's before the crash occurs.
  • We were able to repro the crash by putting a single editor script back into the project with the following code: All lines are required for it to crash. If any are removed it would not crash.
public override void OnInspectorGUI()
{
    SchoolController controller = target as SchoolController;
    SchoolController.DrawGizmos = EditorGUILayout.Toggle("Draw All School Gizmos", SchoolController.DrawGizmos);
    controller.DrawMySchoolGizmos = EditorGUILayout.Toggle("Draw This School Gizmos", controller.DrawMySchoolGizmos);
}

Here is the stacktrace for the crash that occurs when we leave our editor scripts in the codebase:

========== OUTPUTING STACK TRACE ==================

0x0000000141065A12 (Unity) scripting_field_get_type
0x0000000140E2B59F (Unity) LinearCollectionField::LinearCollectionField
0x0000000140E31D61 (Unity) EmitSerializationCommandsForLinearCollectionField
0x0000000140E3222C (Unity) EmitSerializationCommandsForField
0x0000000140E36B52 (Unity) BuildSerializationCommandQueueFor
0x0000000140E36CAC (Unity) WriteQueueForTransferSignatureIntoCache
0x0000000140E36E48 (Unity) BuildSerializationCacheFor
0x0000000140E37F40 (Unity) TransferScriptingObject<SafeBinaryRead>
0x0000000140E17CCD (Unity) MonoBehaviour::TransferSafeBinaryInstanceOnly
0x0000000140E1A0F1 (Unity) MonoBehaviour::RestoreInstanceStateFromBackup
0x00000001414A65FD (Unity) MonoManager::EndReloadAssembly
0x00000001414A6EE7 (Unity) MonoManager::ReloadAssembly
0x00000001401B5314 (Unity) ReloadAllUsedAssemblies
0x0000000141723342 (Unity) Application::TickTimer
0x00000001417EEA1C (Unity) CrashCallback
0x00000001417F0664 (Unity) WinMain
0x0000000141AD38E4 (Unity) strnlen
0x00000000775759CD (kernel32) BaseThreadInitThunk
0x00000000776AA561 (ntdll) RtlUserThreadStart

========== END OF STACKTRACE ===========

We've also submitted a crash report to Unity, however I don't expect them to reply since we don't really have reproduction steps without sending our 50+ GB project to them.

Any help would be appreciated, I've already spent a few days trying to find this crash.

Thanks, Tristan

Tagette avatar Apr 11 '17 00:04 Tagette

We were able to stop the crashing by converting code into dll's. It seems we hit some sort of bug in the compiler when we had so many scripts. Removing Full Inspector was just enough scripts to prevent the crash.

Tagette avatar Apr 27 '17 19:04 Tagette

@Tagette Thanks for the write-up here. I've run into a similar issue - by any chance, do you happen to have any add'l info, record or documentation about that compiler bug?

JayArrrgh avatar Sep 10 '18 17:09 JayArrrgh