Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
545 views
in Technique[技术] by (71.8m points)

.net - What of this C# code can result in a call to free() in compiled form?

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...