0

I'm investigating a stack trace of a compiled Unity C# code. It results in an error inside the standard C free() function. The frame where the free() is called is a pretty simple method, which looks like this:

void Method()
{
    SomeOtherMethod();

    if (StaticClass.StaticProperty == SomeMethod())
    {
        StaticClass.StaticProperty = 0;

        StopCoroutine("Coroutine name");

        if (m_privateField < CONSTANT)
            YetAnotherMethod();
        else
            AndOneMoreMethod();
    }
}

It seems to me that all I do here is calling other code and doing very basic equality comparisons and conditions; however, there is no other frames between this code and free(). What part of this could possibly call it?

Here's this part of the stack trace symbolized by xcode:

11  libsystem_c.dylib               0x3aa5be90 _sigtramp + 40
12  libsystem_c.dylib               0x3aa272dc free + 168
13  dev                             0x002ea644 ___lldb_unnamed_function10628$$dev + 176

I was able to determined that line 13 is this method with the help of atoc.

Community
  • 1
  • 1
Max Yankov
  • 12,551
  • 12
  • 67
  • 135

0 Answers0