Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

IL2CPP:AppDomain::InternalIsFinalizingForUnload .Net 4.6

Discussion in 'Experimental Scripting Previews' started by rulk, Feb 20, 2018.

  1. rulk

    rulk

    Joined:
    Aug 1, 2015
    Posts:
    13
    Hi,
    The following code:
    Code (CSharp):
    1.  
    2. public class DrinkMe : MonoBehaviour {
    3.  
    4.    public void DoDrinkMe()
    5.    {
    6.       var task = new Task(() =>
    7.       {
    8.          
    9.          Thread.Sleep(100);
    10.          throw new Exception("Crash fabric");
    11.          
    12.       });
    13.      
    14.       task.Start();
    15.      
    16.      
    17.    }
    18. }
    19.  
    Will produce Unsupported internal call for IL2CPP:AppDomain::InternalIsFinalizingForUnload - "This icall is not supported by il2cpp."
    On Android and iOS on the next Garbage collector run. With. the stack trace similar to the following:

    Code (CSharp):
    1. (_ZN6il2cpp2vm7Runtime18UnhandledExceptionEP15Il2CppException+108)
    2. 02-17 04:41:42.733 21915 21915 F DEBUG   :     #29 pc 0199b770  /lib/arm/libil2cpp.so (_ZN6il2cpp2gc16GarbageCollector12RunFinalizerEPvS2_+60)
    3. 02-17 04:41:42.733 21915 21915 F DEBUG   :     #30 pc 019bfd68  /lib/arm/libil2cpp.so (GC_invoke_finalizers+264)
    4. 02-17 04:41:42.733 21915 21915 F DEBUG   :     #31 pc 0199b620  /lib/arm/libil2cpp.so
    5. 02-17 04:41:42.733 21915 21915 F DEBUG   :     #32 pc 019a1608  /lib/arm/libil2cpp.so (_ZN6il2cpp2os6Thread10RunWrapperEPv+80)

    Unity version I'm using is :2017.3.0f3

    The actual problem is usually with async networking methods from .Net.

    Code (CSharp):
    1. try{
    2. data = await udpClient.ReceiveAsync();
    3. }
    4. catch(Exception ex){
    5.  
    6. }
    7.  
    8. //somewhere on the other thread
    9. udpClient.Close();
    This would eventually generate Unsupported internal call for L2CPP:AppDomain::InternalIsFinalizingForUnload - "This icall is not supported by il2cpp."

    So basically it is almost impossible to use .Net async networking with the current state of things.
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936