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

Debug Stack Leak?? How To Fix It?

Discussion in 'Scripting' started by MrZeker, Apr 11, 2019.

  1. MrZeker

    MrZeker

    Joined:
    Nov 23, 2018
    Posts:
    227
    hello i've been working in unity, and suddenly last night i got a random froze and i started getting this error. it does nothing, except it stops the IA from running, sort of. i looked into in it in google but it only appears in older unity versions as a possible bug. Any idea what causes it? or how to fix it?.


    Internal: Stack allocator ALLOC_TEMP_THREAD has unfreed allocations, size 390
    DEBUG_STACK_LEAK in StackAllocator.h. This will output the callstacks of the leaked allocations
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,160
    If you can, please file a bug report with a reproduction case. Maybe the/a bug regressed, maybe it is completely separate.
     
    Bunny83 likes this.
  3. MrZeker

    MrZeker

    Joined:
    Nov 23, 2018
    Posts:
    227
    I followed what google said and just ignored it until it dissapeared.
    Two or three days after it appeared it just dissapeared, i dont really remember if i changed something or just went away on his own. sorry.
     
  4. armnotstrong

    armnotstrong

    Joined:
    Mar 3, 2017
    Posts:
    21
    We have this same issue, after changing from .net3 -> .net4

    we are using Unity 2018.4.4 LTS
     
  5. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,196
     
    Bunny83 likes this.
  6. TSWessel

    TSWessel

    Joined:
    Mar 14, 2016
    Posts:
    16
    We're getting similar errors and warnings:

    ⯃ Expanding invalid MinMaxAABB
    ⯃ Converting invalid MinMaxAABB
    ⚠ Internal: Stack allocator ALLOC_TEMP_THREAD has unfreed allocations, size -131928686
    ⚠ To Debug, enable the define: DEBUG_STACK_LEAK in StackAllocator.h. This will output the callstacks of the leaked allocations


    We have tracked down the issue, and in our case it is caused by a particle sub emitter having too low of a Max Particles setting. A bug report with minimal repro has been sent to Unity.

    If you have the same issue, try increasing the Max Particles setting of any particle sub emitters.

    We have reproduced the issue in:
    2018.4.7f1
    2018.4.9f1
    2019.1.14f1

    It doesn't reproduce in:
    2019.2.6f1
     
    Last edited: Oct 1, 2019
  7. TSWessel

    TSWessel

    Joined:
    Mar 14, 2016
    Posts:
    16
  8. HiperThi

    HiperThi

    Joined:
    Sep 13, 2013
    Posts:
    2
    I got this issue fixed in my project when:
    1- Reimported all the assets(Assets>Reimport All)
    2- Cleaned all the Console Warnings (Console>Clear)
    3- Then I just hit Play.
    -Unity Version: 2020.2.1f1
    Hope it helps
     
  9. thefalconsok

    thefalconsok

    Joined:
    Feb 7, 2019
    Posts:
    1
    this fixed it for me, just started a new project with limited code and objects.
     
  10. Vaupell

    Vaupell

    Joined:
    Dec 2, 2013
    Posts:
    301
    This good old one is back in 2021.2.8f1 <3 even in a empty scene..
    Clearly i got a memory issue, since the its only running the console spasm when unity editor is selected active, if i select outside the editor it stops until i come back to it.
     
    solkyoshiro and motowija like this.
  11. motowija

    motowija

    Joined:
    Nov 23, 2021
    Posts:
    3
    i can confirm the same in 2020.3.23f1. Even in an empty scene it gives these console spams; the suggestion above with reimporting sadly didn't work.
     
    solkyoshiro likes this.
  12. solkyoshiro

    solkyoshiro

    Joined:
    Aug 25, 2021
    Posts:
    27
    Oh look, I went looking for a solution and came across this page.

    I've reimported all, and even deleted the whole library just to make sure. Just endless amounts of console spam.
     
  13. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,160
    For those of you experiencing this without a connection to particle effects or in versions where this bug is fixed, please report a bug, one each, as this could all be separate causes with the same log message as a symptom.
     
    Bunny83 likes this.
  14. TomazMB

    TomazMB

    Joined:
    Oct 11, 2020
    Posts:
    33
    I can confirm that this bug (DEBUG_STACK_LEAK in StackAllocator.h) is still here in version of Unity 2020.3.27f1 Personal.
     
    MartinTilo likes this.
  15. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,160
    Thanks for confirming. :)
    Could you please report a bug via the editor menu item:
    Help > Report a Bug
    ?
     
  16. TomazMB

    TomazMB

    Joined:
    Oct 11, 2020
    Posts:
    33
    Hello,

    I have send bug report. In the screenshot attached you can see, what happened in the Console Tab. I suspect this happen when downloading new larger assets from Unity store, because it don't happen when downloading smaller assets. Today's was 4,4 Gb. It didn't happened when I was downloading today the other asset which is 590 Mb big. This bug was first intruduced in this version of Unity 2020.3.27f1 as I'm aware off.
    DEBUG_STACK_LEAK-09_02_2022.png
     
  17. prankard

    prankard

    Joined:
    Mar 24, 2010
    Posts:
    19
    Got this bug today. I was being a silly and doing something like this (I typed the function name wrong):

    Code (CSharp):
    1. void Start()
    2. {
    3.    TestLog();
    4. }
    5.  
    6. void TestLog()
    7. {
    8.    UnityEngine.Debug.Log("Test");
    9.    TestLog();
    10. }
    Hope this helps someone...