C++ Program Always Crashes While doing a std::string assign

前端 未结 4 866
半阙折子戏
半阙折子戏 2021-02-05 23:11

I have been trying to debug a crash in my application that crashes (i.e. asserts a * glibc detected * free(): invalid pointer: 0x000000000070f0c0 ***) while I\

4条回答
  •  梦毁少年i
    2021-02-05 23:17

    Can you repeat the crash with a basic two line program?

    #include 
    
    int main()
    {
        std::string abc;
        abc = "testString";
    }
    

    If that crashes, please post your exact compile / link options?

    If not, start paring down your code. Remove things lines a handful at a time until the bug goes away. Once you have some other change you can add to cause the crash and remove to make it go away, that should help you locate the problem.

提交回复
热议问题