Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
541 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 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...