Search Unity

Bug Own made build tool crashing (Internal_ScriptableRuntimeReflectionSystemWrapper_TickRealtimeProbes)

Discussion in 'Scripting' started by MaartenB, Apr 12, 2021.

  1. MaartenB

    MaartenB

    Joined:
    Nov 6, 2014
    Posts:
    67
    Hey hello!

    So I'm editing a custom made build tool here where it's possible to assign your own scripting define symbols. Now the thing is, is that I would like to wait until the scripting define symbols are done loading. (Which works totally fine!)

    Now after I've waited for the Scripting Define Symbols recompilation, it crashes after executing the BuildPlayer method.

    I do have the stack trace here, but unfortunately, I'm not able to read which method is not found according to the crash. This is my stacktrace:

    ========== OUTPUTTING STACK TRACE ==================

    0x00007FFCB4DED759 (KERNELBASE) RaiseException
    0x00007FFC2B2B6025 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\utils\mono-log-common.c:142] mono_log_write_logfile
    0x00007FFC2B2A4D41 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\eglib\goutput.c:131] monoeg_g_log
    0x00007FFC2B4AA5CE (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini-trampolines.c:187] mini_resolve_imt_method
    0x00007FFC2B4A9768 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini-trampolines.c:575] common_call_trampoline
    0x00007FFC2B4AC068 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini-trampolines.c:926] mono_vcall_trampoline
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 00000230FFCA1823)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 00000230FFCA1823)
    0x00000230FFCA1823 ((<unknown>)) (function-name not available)
    0x0000023185BF9761 (Mono JIT Code) UnityEngine.Experimental.Rendering.ScriptableRuntimeReflectionSystemWrapper:Internal_ScriptableRuntimeReflectionSystemWrapper_TickRealtimeProbes (bool&)
    0x0000023185BF9966 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___intptr& (object,intptr,intptr,intptr)
    0x00007FFC2B3CE480 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini-runtime.c:2812] mono_jit_runtime_invoke
    0x00007FFC2B352902 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\metadata\object.c:2921] do_runtime_invoke
    0x00007FFC2B35B95F (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\metadata\object.c:2968] mono_runtime_invoke
    0x00007FF6E37B12A4 (Unity) scripting_method_invoke
    0x00007FF6E37A9C25 (Unity) ScriptingInvocation::Invoke
    0x00007FF6E37A2B25 (Unity) ScriptingInvocation::Invoke<void>
    0x00007FF6E1E937A5 (Unity) Scripting::UnityEngine::Experimental::Rendering::ScriptableRuntimeReflectionSystemWrapperProxy::Internal_ScriptableRuntimeReflectionSystemWrapper_TickRealtimeProbes
    0x00007FF6E2A54079 (Unity) ScriptableRuntimeReflectionSystem::UpdateRealtimeProbes
    0x00007FF6E2A4B447 (Unity) RenderManager::RenderOffscreenCameras
    0x00007FF6E44B1559 (Unity) PlayerLoopController::UpdateScene
    0x00007FF6E4AE6767 (Unity) EditorSceneManager::NewScene
    0x00007FF6E622F450 (Unity) BuildPlayerData
    0x00007FF6E62389B1 (Unity) DoBuildPlayer_Build
    0x00007FF6E6237617 (Unity) DoBuildPlayer
    0x00007FF6E622C8EC (Unity) BuildPlayer
    0x00007FF6E56F670F (Unity) BuildPipeline::BuildPlayerInternalNoCheck
    0x00007FF6E56A196A (Unity) BuildPipeline_CUSTOM_BuildPlayerInternalNoCheck
    0x00000231859E916C (Mono JIT Code) (wrapper managed-to-native) UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions,string[],bool)
    0x00000231859E7C2B (Mono JIT Code) UnityEditor.BuildPipeline:BuildPlayerInternal (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions,string[])
    0x00000231859E6F4B (Mono JIT Code) UnityEditor.BuildPipeline:BuildPlayer (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions,string[])
    0x00000231859E623B (Mono JIT Code) UnityEditor.BuildPipeline:BuildPlayer (UnityEditor.BuildPlayerOptions)
    0x00000231859E13FB (Mono JIT Code) [P:\Unity Projects\RUMBLE\Assets\Scripts\Editor\BuildTools\Scripts\BuildProcess.cs:119] RUMBLE.Editor.Build.BuildProcess:OnScriptsReloaded ()
    0x000002318522D505 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    0x00007FFC2B3CE480 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini-runtime.c:2812] mono_jit_runtime_invoke
    0x00007FFC2B352902 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\metadata\object.c:2921] do_runtime_invoke
    0x00007FFC2B35B95F (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\metadata\object.c:2968] mono_runtime_invoke
    0x00007FF6E37B12A4 (Unity) scripting_method_invoke
    0x00007FF6E37A9C25 (Unity) ScriptingInvocation::Invoke
    0x00007FF6E374E893 (Unity) CallMethodsWithAttribute
    0x00007FF6E374E7B3 (Unity) CallMethodsWithAttribute
    0x00007FF6E44A2E4A (Unity) MonoDomainWasReloaded
    0x00007FF6E376EC5B (Unity) MonoManager::EndReloadAssembly
    0x00007FF6E3775859 (Unity) MonoManager::ReloadAssembly
    0x00007FF6E4B15911 (Unity) ReloadAllUsedAssemblies
    0x00007FF6E4F7FC99 (Unity) ImportAndPostprocessOutOfDateAssets
    0x00007FF6E4F8A72B (Unity) RefreshInternalV2
    0x00007FF6E4F91AD6 (Unity) StopAssetImportingV2
    0x00007FF6E4F8B709 (Unity) RefreshV2
    0x00007FF6E4EF035E (Unity) AssetDatabase::Refresh
    0x00007FF6E44933CF (Unity) Application::AutoRefresh
    0x00007FF6E4E43643 (Unity) ContainerWindow::ContainerWndProc
    0x00007FFCB6F1E858 (USER32) CallWindowProcW
    0x00007FFCB6F1E3DC (USER32) DispatchMessageW
    0x00007FFCB6F30BC3 (USER32) SendMessageTimeoutW
    0x00007FFCB7610A44 (ntdll) KiUserCallbackDispatcher
    0x00007FFCB54A1064 (win32u) NtUserPeekMessage
    0x00007FFCB6F1A5C3 (USER32) PeekMessageW
    0x00007FFCB6F19AD0 (USER32) PeekMessageA
    0x00007FF6E4E1617B (Unity) MainMessageLoop
    0x00007FF6E4E1A641 (Unity) WinMain
    0x00007FF6E6C8F436 (Unity) __scrt_common_main_seh
    0x00007FFCB7427034 (KERNEL32) BaseThreadInitThunk
    0x00007FFCB75C2651 (ntdll) RtlUserThreadStart

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

    Maybe one of the Unity engineers know more about this? I have concluded that it's coming from this script: https://github.com/Unity-Technologi...a/ScriptableRuntimeReflectionSystemWrapper.cs

    The Unity version I'm working on is 2020.3.0f1.

    I'm looking forward to some of your answers!


    - Maarten
     
    Last edited: Apr 12, 2021
  2. MaartenB

    MaartenB

    Joined:
    Nov 6, 2014
    Posts:
    67
    Alright. It seems that I have more information.

    Even if I have the default packages, upgraded to the newest Unity version (2020.3.3f1), and have stripped all my assets except for the Build Tool, it still happens.

    I have reported the bug and hope this issue will be fixed soon.
     
  3. CheeryLee

    CheeryLee

    Joined:
    Feb 23, 2014
    Posts:
    17
    Confirmed it on 2020.3.21 too. It's so annoying that everything works fine on older versions but this one is very problematic. I wasted on it a lot of time, but found a dirty workaround. It may be helpful for you too @MaartenB .

    So, what you gonna need is... wait a second after asset database become refreshed. That's all.
    Do something like this:

    Code (CSharp):
    1. [DidReloadScripts]
    2. private static void OnScriptsReloaded()
    3. {
    4.     // prepare some static timer
    5.     _time = 0;
    6.  
    7.     EditorApplication.update -= Wait;
    8.     EditorApplication.update += Wait;
    9. }
    10.  
    11. private void Wait()
    12. {
    13.     // wait for 1 second
    14.     if (_time < 1)
    15.     {
    16.         _time += Time.deltaTime;
    17.         return;
    18.     }
    19.  
    20.     EditorApplication.update -= Wait;
    21.  
    22.     ... do your build here
    23. }
     
    MaartenB likes this.
  4. MaartenB

    MaartenB

    Joined:
    Nov 6, 2014
    Posts:
    67
    Interesting. I will try that when I have the time for that. Thanks for your input!