Search Issue Tracker
Not Reproducible
Votes
1
Found in
2019.4
2020.1
2020.1.5f1
2020.2
Issue ID
1277110
Regression
No
Wild memory leaks leading to StackAllocator::WalkAllocations crashes
Reproduction steps:
1. Create a new project, using Unity Hub 2.4.x
2. Choose the FPS Microgame template
3. Wait for the project to open
4. Select Explore Project from the Tutorial window
- A crash occurs. Reproduced using Unity 2020.1.6f1, Hub 2.4.1, macOS:
Reproducible with, according to user reports: 2019.4.16f1, 2020.1.17f1, 2020.2.0b8
Analyzed causes of a handful of crashes with the same characteristics:
-removed material
-rotated/moved camera (x2 cases)
-changed shader graph precision mode
-created a new scene (x5 cases)
-destroyed Game Object in Play Mode (x4 cases, 3 of them from FPS Microgame)
-code change
-editing Canvas Scaler
-switching scene
-opened project
-entered play mode after save
-saved scene (x2 cases)
Full stacktrace:
0x00007FF6F4D0CEA0 (Unity) StackAllocator::WalkAllocations
0x00007FF6F4D1AB36 (Unity) TLSAllocator::WalkAllocations
0x00007FF6F4D1118A (Unity) TLSAllocator::FrameMaintenance
0x00007FF6F4CEF180 (Unity) MemoryManager::FrameMaintenance
0x00007FF6F545D224 (Unity) `InitPlayerLoopCallbacks'::`2'::PostLateUpdateMemoryFrameMaintenanceRegistrator::Forward
0x00007FF6F5445DD9 (Unity) ExecutePlayerLoop
0x00007FF6F5445EB0 (Unity) ExecutePlayerLoop
0x00007FF6F544B36C (Unity) PlayerLoop
0x00007FF6F66DBD2E (Unity) PlayerLoopController::UpdateScene
0x00007FF6F66DAF20 (Unity) Application::TickTimer
0x00007FF6F6EDBAE4 (Unity) MainMessageLoop
0x00007FF6F6EE4E7E (Unity) WinMain
0x00007FF6F8B60916 (Unity) __scrt_common_main_seh
0x00007FFA7EC77BD4 (KERNEL32) BaseThreadInitThunk
0x00007FFA8008CE51 (ntdll) RtlUserThreadStart
Notes:
- Usually a one time issue
-The start of the memory leak can be noticed when the Editor starts spamming errors like these in the console (take from Editor logs):
"Allocation of 19 bytes at 0000019E700000B0
(Filename: C:\buildslave\unity\build\Runtime/Allocator/BaseAllocator.cpp Line: 75)
TLS Allocator ALLOC_TEMP_THREAD, underlying allocator ALLOC_TEMP_THREAD has unfreed allocations, size 19
(Filename: C:\buildslave\unity\build\Runtime/Allocator/TLSAllocator.cpp Line: 140)
Internal: Stack allocator ALLOC_TEMP_THREAD has unfreed allocations, size 19
(Filename: C:\buildslave\unity\build\Runtime/Allocator/StackAllocator.cpp Line: 192)
To Debug, enable the define: DEBUG_STACK_LEAK in StackAllocator.h. This will output the callstacks of the leaked allocations
(Filename: C:\buildslave\unity\build\Runtime/Allocator/StackAllocator.cpp Line: 194)
Allocation of 19 bytes at 0000019E700000B0
(Filename: C:\buildslave\unity\build\Runtime/Allocator/BaseAllocator.cpp Line: 75)
Allocation of 19 bytes at 0000019E700000B0
(Filename: C:\buildslave\unity\build\Runtime/Allocator/BaseAllocator.cpp Line: 75)
TLS Allocator ALLOC_TEMP_THREAD, underlying allocator ALLOC_TEMP_THREAD has unfreed allocations, size 19
(Filename: C:\buildslave\unity\build\Runtime/Allocator/TLSAllocator.cpp Line: 140)
Internal: Stack allocator ALLOC_TEMP_THREAD has unfreed allocations, size 19
(Filename: C:\buildslave\unity\build\Runtime/Allocator/StackAllocator.cpp Line: 192)
To Debug, enable the define: DEBUG_STACK_LEAK in StackAllocator.h. This will output the callstacks of the leaked allocations
(Filename: C:\buildslave\unity\build\Runtime/Allocator/StackAllocator.cpp Line: 194)
Allocation of 19 bytes at 0000019E700000B0
(Filename: C:\buildslave\unity\build\Runtime/Allocator/BaseAllocator.cpp Line: 75)"
Comments (6)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on ResizeScriptingList<ScriptingObjectPtr> when passing an undeclared variable to the results parameter for GameObject.FindGameObjectsWithTag
- [Android] "Screen.safeArea.y" always returns values outside of the Safe Area when the device is in Portrait orientation
- Frame spike due to many TreeRenderer.TreeUpdated calls when repositioning terrains in large Scenes
- Crash on GameObject::RemoveComponentFromGameObjectInternal when reparenting Text GameObjects
- [IL2CPP-GarbageCollector] Changing GCMode might permanently disable GC in a multithreaded context
mrmelonmonkey
Feb 09, 2022 14:55
I got this in 2021.2.10f1 too.
dont know through what action i might have triggered it, though.
pytechdrae
Aug 01, 2021 01:54
I'm running unit test an get the exact same error. Reimporting all and change .net to 4.x seemed to be a hot fix. But it happened again..
JU4NGUZM4N
Jun 22, 2021 13:15
For me the only way to build successfully (IOS) after this error is to build a clean folder and not append the project already from before.
HiperThi
Feb 13, 2021 05:48
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
EidLoi
Dec 20, 2020 16:20
I have this too after a while as I work in the editor. No stack trace, just the 4 messages in the console repeating eternally (or until I restart the editor). Both in a new project and an upgraded one.
Unity 2020.2.0f1
felipe-shida-afterverse
Nov 18, 2020 16:56
I have a similar issue, but mine happens 100% of the time when I load assets from addressable assets in "Use existing build" mode