Search Unity

Bug Crash when Switching to MacOS

Discussion in 'Editor & General Support' started by koobazaur, Apr 29, 2020.

  1. koobazaur

    koobazaur

    Joined:
    Nov 6, 2013
    Posts:
    46
    We've been developing a project with Unity 2019.2.10f1 on Windows 10 for months and everything has been going great until today. I tried to switch the Builder Settings to MacOS and as soon as it finishes "Determining assets that need to be reimported for target platform" it crashes:




    I checked the editor log and this is the output:

    Code (CSharp):
    1.  Determining assets that need to be reimported for target platform ... 21.733512 seconds.
    2. Hashing assets (4526 files)... 1.320 seconds
    3.    file read: 0.336 seconds (966.962 MB)
    4.    wait for write: 0.408 seconds (I/O thread blocked by consumer, aka CPU bound)
    5.    wait for read: 0.019 seconds (CPUT thread waiting for I/O thread, aka disk bound)
    6.    hash: 1.210 seconds
    7. Hashing assets (13 files)... 0.003 seconds
    8.    file read: 0.001 seconds (0.073 MB)
    9.    wait for write: 0.000 seconds (I/O thread blocked by consumer, aka CPU bound)
    10.    wait for read: 0.002 seconds (CPUT thread waiting for I/O thread, aka disk bound)
    11.    hash: 0.000 seconds
    12. Updating Packages/com.unity.postprocessing/PostProcessing/Shaders/Debug/Histogram.compute - GUID: 18183ebfeeab97749b43e38b928604a7...
    13. DynamicHeapAllocator allocation probe 1 failed - Could not get memory for large allocation 6020836937801926408.
    14. DynamicHeapAllocator allocation probe 2 failed - Could not get memory for large allocation 6020836937801926408.
    15. DynamicHeapAllocator allocation probe 3 failed - Could not get memory for large allocation 6020836937801926408.
    16. DynamicHeapAllocator allocation probe 4 failed - Could not get memory for large allocation 6020836937801926408.
    17. DynamicHeapAllocator out of memory - Could not get memory for large allocation 6020836937801926408!
    18. Could not allocate memory: System out of memory!
    19. Trying to allocate: 6020836937801926408B with 16 alignment. MemoryLabel: DynamicArray
    20. Allocation happened at: Line:77 in C:\buildslave\unity\build\Runtime/Utilities/dynamic_array.h
    21. Memory overview
    22. [ ALLOC_DEFAULT ] used: 250674813B | peak: 0B | reserved: 311589109B
    23. [ ALLOC_TEMP_JOB_1_FRAME ] used: 0B | peak: 0B | reserved: 1048576B
    24. [ ALLOC_TEMP_JOB_2_FRAMES ] used: 0B | peak: 0B | reserved: 1048576B
    25. [ ALLOC_TEMP_JOB_4_FRAMES ] used: 1953866B | peak: 0B | reserved: 4194304B
    26. [ ALLOC_TEMP_JOB_ASYNC ] used: 0B | peak: 0B | reserved: 2097152B
    27. [ ALLOC_GFX ] used: 83060947B | peak: 0B | reserved: 91495211B
    28. [ ALLOC_CACHEOBJECTS ] used: 556351632B | peak: 0B | reserved: 615514112B
    29. [ ALLOC_TYPETREE ] used: 515027360B | peak: 0B | reserved: 538968064B
    30. [ ALLOC_PROFILER ] used: 8230456B | peak: 8231048B | reserved: 16777216B
    31. [ ALLOC_PROFILER_EDITOR ] used: 200040456B | peak: 201437176B | reserved: 207618048B
    32. [ ALLOC_TEMP_THREAD ] used: 11930420B | peak: 0B | reserved: 21561344B
    33. Could not allocate memory: System out of memory!
    34. Trying to allocate: 6020836937801926408B with 16 alignment. MemoryLabel: DynamicArray
    35. Allocation happened at: Line:77 in C:\buildslave\unity\build\Runtime/Utilities/dynamic_array.h
    36. Memory overview
    37. [ ALLOC_DEFAULT ] used: 250674813B | peak: 0B | reserved: 311589109B
    38. [ ALLOC_TEMP_JOB_1_FRAME ] used: 0B | peak: 0B | reserved: 1048576B
    39. [ ALLOC_TEMP_JOB_2_FRAMES ] used: 0B | peak: 0B | reserved: 1048576B
    40. [ ALLOC_TEMP_JOB_4_FRAMES ] used: 1953866B | peak: 0B | reserved: 4194304B
    41. [ ALLOC_TEMP_JOB_ASYNC ] used: 0B | peak: 0B | reserved: 2097152B
    42. [ ALLOC_GFX ] used: 83060947B | peak: 0B | reserved: 91495211B
    43. [ ALLOC_CACHEOBJECTS ] used: 556351632B | peak: 0B | reserved: 615514112B
    44. [ ALLOC_TYPETREE ] used: 515027360B | peak: 0B | reserved: 538968064B
    45. [ ALLOC_PROFILER ] used: 8230456B | peak: 8231048B | reserved: 16777216B
    46. [ ALLOC_PROFILER_EDITOR ] used: 200040456B | peak: 201437176B | reserved: 207618048B
    47. [ ALLOC_TEMP_THREAD ] used: 11930420B | peak: 0B | reserved: 21561344B
    48.  
    49. (Filename: C:\buildslave\unity\build\Runtime/Allocator/MemoryManager.cpp Line: 1175)
    The Histogram.compute is like a 3kb file, no idea why it's causing a crash. The Mac build worked just fine a few days ago. It works fine if I switch to Linux, and mac works fine if I use a different project. I already tried deleting the GI cache and Library inside our project folder but no dice :/

    Any idea what the heck is going on?
     
  2. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
    Hi @koobazaur,

    From the message that you're having, it looks like your system is unable to use enough memory.

    What you can do is to open the "Task Manager" and check how much free memory you have while you're performing such operation.

    If you find out that you have not so much memory, you can also quit the applications that are using memory apart from Unity, before trying again, in order to have more memory available on the process.


    Good luck with it!
     
  3. koobazaur

    koobazaur

    Joined:
    Nov 6, 2013
    Posts:
    46
    Hi Diego,

    Thanks for the tip but it's definitely not an issue with running out of memory. The log says it's trying to allocate 6020836937801926408 bytes of memory, which is an absurd number. Short of missing a 6 exabyte memory stick, I think something screwy is going on there?

    - Jakub
     
    Last edited: Apr 30, 2020
  4. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
    Hi Jakub,

    What I can suggest in that case is to try to do the same operation but in multiple, progressive steps in order to find out where is exactly the problem happening.

    What I mean by that is for example following the next steps:
    1. Clone your project
    2. Reduce the complexity of your project to some extent by removing some assets
    3. Try the same operation in this less complex project
    4. Add some of the removed assets
    5. Try the step 3. and 4. over and over, until you find the crash
    The good aspect of this approach is that if for example, your project is still crashing after removing a lot of assets, the issue is more likely not related to your assets.

    On the other hand, if crashes while adding one specific asset, maybe the file got corrupted on the reimporting process.


    I hope it helps!
     
  5. koobazaur

    koobazaur

    Joined:
    Nov 6, 2013
    Posts:
    46
    Yea I figured it's something we added recently, was hoping to avoid playing the guessing game :/

    Decided to try upgrading to latest Unity version and that fixed the build issue. Seems like nothing broke with the upgrade, so I guess I'll stick to it then!
     
  6. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
    Great,

    I'm glad that you found the solution.


    Good luck with the project!
     
  7. thanhle

    thanhle

    Joined:
    May 2, 2013
    Posts:
    162
    I got same Bug
    What unity version you use to Fixed it ?
     
  8. koobazaur

    koobazaur

    Joined:
    Nov 6, 2013
    Posts:
    46
    We're on 2019.3.12f now