Search Issue Tracker

Fixed in 2021.1.X

Fixed in 2019.4.X, 2020.2.X



Found in





Issue ID




[Shaders] 'TLS Allocator' errors and Allocation logs are continuously thrown after cancelling a build in progress

Shader System


How to reproduce:
1. Open the tester-attached project(
2. Open the build settings window(File > Build Settings)
3. In Player Settings change the scripting backend to Mono(can be left as IL2CPP if an appropriate module is installed)
4. Start building the player by clicking the 'Build' button
5. Once the progress is more than halfway finished, cancel the build
6. See the Console window. If nothing is thrown, repeat from step 4(may take up to 3-4 tries)

Expected result: no warnings/errors are thrown
Actual: Allocation of N bytes at [Memory Address] logs are spammed in the Console. This eventually may lead to a crash

Reproducible with: 2019.3.0f6, 2019.4.15f1, 2020.1.0a21, 2020.1.15f1, 2020.2.0b13, 2021.1.0a8
Not reproducible with: 2018.4.29f1, 2019.3.0f5, 2020.1.0a1, 2020.1.0a20

Reproduced on Windows and MacOS

TLS Allocator ALLOC_TEMP_THREAD, underlying allocator ALLOC_TEMP_THREAD has unfreed allocations, size N

Internal: Stack allocator ALLOC_TEMP_THREAD has unfreed allocations, size N
To Debug, enable the define: DEBUG_STACK_LEAK in StackAllocator.h. This will output the callstacks of the leaked allocations

  1. Resolution Note (fix version 2021.1):

    Some memory allocations were not freed properly when canceling the build during shader compilation. Fix is incoming.

    Fixed in 2021.1.0a9

  2. Resolution Note (fix version 2020.2):

    Fixed in 2020.2.2f1

  3. Resolution Note (fix version 2019.4):

    Fixed in 2019.4.17f1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.