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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…