Search Unity

ECS exceptions crashing burst and non bursted IL2CPP

Discussion in 'Burst' started by snacktime, Feb 16, 2020.

  1. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Wondering if I'm having really bad luck or maybe the new IL generation stuff might be causing issues? This is burst 1.2.3 lastest 2019.3.

    Two unrelated code paths that both end with an ArgumentException coming from inside ECS due to a non existent entity. One main thread the other in a bursted job. The former is in an IL2CPP dev build, the later a mono burst build. Both crash Unity.

    IL2CPP possibly gives a hint as to what might be going on. Bust just the non descript invalid memory access (which also shows in IL2CPP log)

    This is the code corresponding to the last line in the stack trace:

    Code (csharp):
    1.  
    2. IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void UnsafeUtility_InternalCopyPtrToStructure_TisNavAgent_t90FC6A985EC78C3A0D43A73FCA8C3E8D8535909F_m41C55A0B46A47C73342B9DBF4C5964701DF1F389_gshared (void* ___ptr0, NavAgent_t90FC6A985EC78C3A0D43A73FCA8C3E8D8535909F * ___output1, const RuntimeMethod* method)
    3. {
    4.     DECLARE_METHOD_EXEC_CTX(methodExecutionContext, method, NULL, NULL, NULL);
    5.     CHECK_PAUSE_POINT;
    6.     {
    7.         NavAgent_t90FC6A985EC78C3A0D43A73FCA8C3E8D8535909F * L_0 = ___output1;
    8.         void* L_1 = ___ptr0;
    9.         NavAgent_t90FC6A985EC78C3A0D43A73FCA8C3E8D8535909F  L_2 = (*(NavAgent_t90FC6A985EC78C3A0D43A73FCA8C3E8D8535909F *)L_1);
    10.         *(NavAgent_t90FC6A985EC78C3A0D43A73FCA8C3E8D8535909F *)L_0 = L_2;
    11.         return;
    12.     }
    13. }
    14.  
    This is the C# code that generated the exception:
    Code (csharp):
    1.  
    2. NavAgent agent = EntityManager.GetComponentData<NavAgent>(entity);
    3.  
    So at first glance not knowing how IL2CPP deals with exceptions, it seems like the IL2CPP code is trying to copy the return value to agent post exception, which seems like it shouldn't be.
     
  2. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,853
    I got a few crashes in 2019.3.0f1 that I did not get in 2019.3.0b6 related to not finding an entity.. I think.. I note I get one console error when it didn't crash that claims an entity did not exist. Which one? These errors are often unhelpful.