# \[Linux\] FMOD logging in Unity causes stack overflow

**URL:** <https://qa.fmod.com/t/linux-fmod-logging-in-unity-causes-stack-overflow/23951>\
**Category:** Unity\
**Tags:** linux, unity\
**Created:** [January 29, 2026, 2:10pm UTC](https://qa.fmod.com/t/linux-fmod-logging-in-unity-causes-stack-overflow/23951 "2026-01-29T14:10:13Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [May 29, 2026, 4:45am UTC](https://qa.fmod.com/t/linux-fmod-logging-in-unity-causes-stack-overflow/23951/11 "2026-05-29T04:45:54Z")

</div>

Hi,

I think I have found another workaround that will allow you to have the logs enabled. The issue seems to be related to changes to stack sizes on Linux.

It is possible to allow the FMOD system to function with threads using the following [Unity Integration | Examples Callback Handler](https://fmod.com/docs/2.03/unity/examples-callback-handler.html).

```csharp
using System;
using UnityEngine;

[CreateAssetMenu(menuName = "My FMOD Callback Handler")]
public class MyFMODCallbackHandler : FMODUnity.PlatformCallbackHandler {
    public override void PreInitialize(FMOD.Studio.System studioSystem, Action<FMOD.RESULT, string> reportResult)
    {
        FMOD.RESULT result;

        FMOD.System coreSystem;
        result = studioSystem.getCoreSystem(out coreSystem);
        reportResult(result, "studioSystem.getCoreSystem");

        // Test increasing stack size
        const uint linuxStackSize = 1024 * 1024;

        for (int i = 0; i < (int)FMOD.THREAD_TYPE.MAX; ++i)
        {
            FMOD.Thread.SetAttributes(
                (FMOD.THREAD_TYPE)i,
                FMOD.THREAD_AFFINITY.GROUP_DEFAULT,
                FMOD.THREAD_PRIORITY.DEFAULT,
                (FMOD.THREAD_STACK_SIZE)linuxStackSize);
        }
    }
}

```

Where were are just setting all FMOD threads to a default value. I found this allowed me to run the Unity Editor with logging enabled. Would it be possible to test if this works on your end too? More info can be read here: [Hard crash on Linux/Kubuntu: pthread\_create returns 22 followed by NULL critical section in Unity 6](https://qa.fmod.com/t/hard-crash-on-linux-kubuntu-pthread-create-returns-22-followed-by-null-critical-section-in-unity-6/24068)

---

_[View the full topic](https://qa.fmod.com/t/linux-fmod-logging-in-unity-causes-stack-overflow/23951)._
