C语言编程的两个工具:valgrind和core

检查内存泄漏:

valgrind --leak-check=full ./ecox_rws_helper 来检查内存泄漏

程序崩溃看错误:

ulimit -c unlimited

然后执行程序,会在当前目录下生成一个文件,如:core.3945

再使用gdb看错误:gdb ./ecox_rws_helper ./core.3945

在gdb中输入where可以看到更详细的错误

原文地址:https://www.cnblogs.com/kuang17/p/7834298.html