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

时间:2022-08-31 17:59:51

检查内存泄漏:

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

 

程序崩溃看错误:

ulimit -c unlimited

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

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

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

相关文章