Search Unity

ARFoundation crashing on start app

Discussion in 'AR' started by mistergreen2016, Oct 23, 2019.

  1. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    Hey,
    I was working on ARFoundation 3.0 project for a week but since yesterday the app started crashing on start. I could not figure it out so I built out a the TogglePlaneDetection example and that crashed too!
    I don't know what's going on..
    Here's the console output from Xcode on the TogglePlaneDection project.

    Code (CSharp):
    1. 2019-10-22 21:38:02.432754-0400 imagetracker[25080:1639363] Built from '2019.2/staging' branch, Version '2019.2.9f1 (ebce4d76e6e8)', Build type 'Release', Scripting Backend 'il2cpp'
    2. 2019-10-22 21:38:02.438219-0400 imagetracker[25080:1639363] -> registered mono modules 0x105a057b0
    3. -> applicationDidFinishLaunching()
    4. 2019-10-22 21:38:02.515227-0400 imagetracker[25080:1639363] Metal GPU Frame Capture Enabled
    5. -> applicationDidBecomeActive()
    6. [XR] Discovering subsystems at path /private/var/containers/Bundle/Application/9ADEC89C-7E40-495A-B5C9-77687AC0981A/imagetracker.app/Data/UnitySubsystems
    7. [XR] No descriptors matched for  examples in UnitySubsystems/UnityARKit/UnitySubsystemsManifest.json.
    8. [XR] 1 'inputs' descriptors matched in UnitySubsystems/UnityARKit/UnitySubsystemsManifest.json
    9. [XR] No descriptors matched for  cameras in UnitySubsystems/UnityARKit/UnitySubsystemsManifest.json.
    10. [XR] No descriptors matched for  displays in UnitySubsystems/UnityARKit/UnitySubsystemsManifest.json.
    11. [XR] No descriptors matched for  depths in UnitySubsystems/UnityARKit/UnitySubsystemsManifest.json.
    12. [XR] No descriptors matched for  meshings in UnitySubsystems/UnityARKit/UnitySubsystemsManifest.json.
    13. [XR] No descriptors matched for  planes in UnitySubsystems/UnityARKit/UnitySubsystemsManifest.json.
    14. [XR] No descriptors matched for  raycasts in UnitySubsystems/UnityARKit/UnitySubsystemsManifest.json.
    15. [XR] No descriptors matched for  referencePoints in UnitySubsystems/UnityARKit/UnitySubsystemsManifest.json.
    16. [XR] No descriptors matched for  sessions in UnitySubsystems/UnityARKit/UnitySubsystemsManifest.json.
    17. [XR] No descriptors matched for  experience in UnitySubsystems/UnityARKit/UnitySubsystemsManifest.json.
    18. [XR] No descriptors matched for  gestures in UnitySubsystems/UnityARKit/UnitySubsystemsManifest.json.
    19. Initializing Metal device caps: Apple A10 GPU
    20. Initialize engine version: 2019.2.9f1 (ebce4d76e6e8)
    21. XRGeneral Settings awakening...
    22. UnityEngine.XR.Management.XRGeneralSettings:Awake()
    23. (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    24.  
    25. 2019-10-22 21:38:03.040340-0400 imagetracker[25080:1639363] Unbalanced calls to begin/end appearance transitions for <SplashScreenController: 0x108f1d480>.
    26. 2019-10-22 21:38:04.566875-0400 imagetracker[25080:1639434] [ServicesDaemonManager] interruptionHandler is called. -[FontServicesDaemonManager connection]_block_invoke
    27. UnloadTime: 0.712042 ms
    28. [XR] Loading plugin UnityARKit for subsystem ARKit-Input...
    29. [XR] UnityARKit successfully registered Provider for ARKit-Input
    30. Camera "AR Camera" has a non-identity transform (position = (0.0, -0.5, 3.2), rotation = (0.0, 0.4, 0.0, 0.9)). The camera's local position and rotation will be overwritten by the XR device.
    31. UnityEngine.XR.ARFoundation.ARSessionOrigin:Awake()
    32. (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    33.  
    34. Message from debugger: Terminated due to memory issue
     
  2. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    I restarted my iPad and the planeDetection example is working. Looks like my previous app was holding on to the memory or something.
     
  3. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    After running my a little while, I always see this message. JobTempAlloc sounds serious but I wouldn't know how to correct this behavior.

    Code (CSharp):
    1.  
    2. Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak
    3. (Filename: ./Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 539)
    4.  
    5. To Debug, enable the define: TLA_DEBUG_STACK_LEAK in ThreadsafeLinearAllocator.cpp. This will output the callstacks of the leaked allocations
    6. (Filename: ./Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 541)
    7.  
    8. Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 5)
    9. (Filename: ./Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 313)
    10.  
    11. Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 5)
    12. (Filename: ./Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 313)
    13.  
    14. Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 5)
    15. (Filename: ./Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 313)
    16.  
     
  4. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    I found out the memory issue. Once I place in gameObjects in the scene, I had to turn off plane detection or it'll lead to the memory issues.
     
  5. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    Oh, I also had Image tracking on too. It looks like image tracking uses Job too.
     
  6. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    Updating to 2019.3 fix this memory leak issue. I heard it was to do with something called ShaderCompiler.