Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

UWP build crashes: System.ExecutionEngineException

Discussion in 'Windows' started by mr_zog, May 28, 2018.

  1. mr_zog

    mr_zog

    Joined:
    Jan 21, 2014
    Posts:
    165
    Hi,

    using:
    * Unity 2017.4.4f1 (64-bit)
    * UWP
    * XAML
    * Scripting Runtime: Stable (3.5)
    * Scripting Backend: .NET
    * API Level: 2.0, 2.0 Subset, 4.6
    * C# Project export and NOT.
    * Building with VS 2017.

    I keep getting crashes after x seconds:
    An unhandled exception of type 'System.ExecutionEngineException' occurred in WHATEVER, e.g:


    An unhandled exception of type 'System.ExecutionEngineException' occurred in WinRTBridge.winmd
    Code (CSharp):
    1. WinRTBridge.winmd!WinRTBridge.ObjectInstantiation.CreateArray(int typeId, int size)   Unknown
    2.  [Native to Managed Transition]  
    3.  [Managed to Native Transition]  
    4.  UnityEngineProxy.dll!UnityEngineProxy.InternalCalls.GameObject_CUSTOM_GetComponentsInternal(object self, System.Type type, bool useSearchTypeAsArrayReturnType, bool recursive, bool includeInactive, bool reverse, object resultList)   Unknown
    5.  UnityEngine.CoreModule.dll!UnityEngine.GameObject.GetComponentsInParent<UnityEngine.UI.RectMask2D>(bool includeInactive)   Unknown
    6.  UnityEngine.CoreModule.dll!UnityEngine.GameObject.GetComponentsInParent<UnityEngine.UI.RectMask2D>(bool includeInactive, System.Collections.Generic.List<UnityEngine.UI.RectMask2D> results)   Unknown
    7.  UnityEngine.UI.dll!UnityEngine.UI.MaskUtilities.GetRectMaskForClippable(UnityEngine.UI.IClippable clippable)   Unknown
    8.  UnityEngine.UI.dll!UnityEngine.UI.MaskableGraphic.UpdateClipParent()   Unknown
    9.  UnityEngine.UI.dll!UnityEngine.UI.MaskableGraphic.RecalculateClipping()   Unknown
    10. >   Assembly-CSharp-firstpass.dll!TMPro.TextMeshProUGUI.RecalculateClipping() Line 352   C#
    11.  Assembly-CSharp-firstpass.dll!TMPro.TextMeshProUGUI.OnEnable() Line 183   C#
    12.  Assembly-CSharp-firstpass.dll!TMPro.TextMeshProUGUI.$Invoke36OnEnable(long instance, long* args)   Unknown
    13.  UnityEngine.CoreModule.dll!UnityEngine.Internal.$MethodUtility.InvokeMethod(long instance, long* args, System.IntPtr method)   Unknown
    14.  [Native to Managed Transition]  
    15.  [Managed to Native Transition]  
    16.  UnityEngineProxy.dll!UnityEngineProxy.InternalCalls.GameObject_CUSTOM_SetActive(object self, bool paramValue)   Unknown
    17.  UnityEngine.CoreModule.dll!UnityEngine.GameObject.SetActive(bool value)   Unknown
    18.  Assembly-CSharp.dll!MA.Shooter.Main.UiRefsMainMenu.ShowNoAdsBtn(bool show) Line 138   C#


    Or e.g.:
    An unhandled exception of type 'System.ExecutionEngineException' occurred in System.Private.CoreLib.ni.dll

    Code (CSharp):
    1.  System.Private.CoreLib.ni.dll!string.Concat(string str0, string str1, string str2)   Unknown
    2.  System.Private.CoreLib.ni.dll!System.RuntimeType.AssemblyQualifiedName.get()   Unknown
    3.  UnityEngine.CoreModule.dll!UnityEngine.Events.UnityEventBase.UnityEventBase()   Unknown
    4.  UnityEngine.UI.dll!UnityEngine.UI.CoroutineTween.ColorTween.AddOnChangedCallback(UnityEngine.Events.UnityAction<UnityEngine.Color> callback)   Unknown
    5.  UnityEngine.UI.dll!UnityEngine.UI.Graphic.CrossFadeColor(UnityEngine.Color targetColor, float duration, bool ignoreTimeScale, bool useAlpha, bool useRGB)   Unknown
    6.  UnityEngine.UI.dll!UnityEngine.UI.Graphic.CrossFadeColor(UnityEngine.Color targetColor, float duration, bool ignoreTimeScale, bool useAlpha)   Unknown
    7.  UnityEngine.UI.dll!UnityEngine.UI.Selectable.StartColorTween(UnityEngine.Color targetColor, bool instant)   Unknown
    8.  UnityEngine.UI.dll!UnityEngine.UI.Selectable.DoStateTransition(UnityEngine.UI.Selectable.SelectionState state, bool instant)   Unknown
    9.  UnityEngine.UI.dll!UnityEngine.UI.Selectable.InternalEvaluateAndTransitionToSelectionState(bool instant)   Unknown
    10.  UnityEngine.UI.dll!UnityEngine.UI.Selectable.OnEnable()   Unknown
    11.  UnityEngine.UI.dll!UnityEngine.UI.Selectable.$Invoke35OnEnable(long instance, long* args)   Unknown
    12.  UnityEngine.CoreModule.dll!UnityEngine.Internal.$MethodUtility.InvokeMethod(long instance, long* args, System.IntPtr method)   Unknown
    13.  [Native to Managed Transition]  
    14.  [Managed to Native Transition]  
    15.  UnityEngineProxy.dll!UnityEngineProxy.InternalCalls.GameObject_CUSTOM_SetActive(object self, bool paramValue)   Unknown
    16.  UnityEngine.CoreModule.dll!UnityEngine.GameObject.SetActive(bool value)   Unknown
    17. >   Assembly-CSharp.dll!MA.Shooter.Main.UiRefsMainMenu.ShowNoAdsBtn(bool show) Line 138   C#
    18.  

    Or e.g. in:
    An unhandled exception of type 'System.ExecutionEngineException' occurred in UnityEngine.IMGUIModule.dll
    (IMGUI, not sure why ... must be the built in debug console, we don't use IMGUI.)




    Now I think the issue could be related to
    https://forum.unity.com/threads/uwp...own-on-system-reflection-monoproperty.528517/
    but I cannot post in that thread.

    It reads like, the solution is to use IL2CPP ... can anybody confirm this?
    I gave it a quick shot and it seemed more stable, but my problem is, we use Vungle and it seems, Vungle doesn't support IL2CPP.


    I am also seeing suspicious logs:
    "Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.ni.dll" (my second sample exception is exactly in that dll ... coincidence?)

    Or what about this:
    "Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak"



    Grateful for any tips!

    Thanks!
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,504
    That error you linked is unrelated. Are you using any native plugins? What you're describing sounds like a serious memory corruption.
     
  3. mr_zog

    mr_zog

    Joined:
    Jan 21, 2014
    Posts:
    165
    Hi,
    thanks for the reply.
    We use tons of extensions and this project is an upgraded one from 5.6. So possibly still some extensions not working but compiling ...

    I have done some further research and I also have crashes with 5.6 and our current codebase. We recently added asset bundles* and some other stuff, so I am beginning to think, this could be related to that (all other platforms work fine though!).
    But I am not sure, if these crashes themselves (5.6 <-> 2017) are related.

    And on top of that, a new Windows SDK got installed which messed up the exported projects ... I figured that one out, thanks to forum search ;)

    I'll keep this thread updated.


    *: Just yesterday I also found out, that when building AssetBundles, it is relevant to have the scripting backend set correctly.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,504
    You could either report a bug, or use application verifier + native debugger to see if you can pinpoint where the memory gets corrupted.
     
  5. mr_zog

    mr_zog

    Joined:
    Jan 21, 2014
    Posts:
    165
    Hi,

    @Tautvydas-Zilys I tried doing some native debugging, but that isn't my world. I submitted a bug report case 1045982 (UWP (ARM) Possible heap corruption with scripting backend .NET).

    Would be more than grateful if someone could help us out and tell us if it's an extension issue, Unity or Microsoft :)
    Edit: Or tell us, if we arent to expect any support for Windows 10 ARM, cause maybe MS themselves arent interested anymore.