gpt4 book ai didi

c - 仅在没有 valgrind 的情况下出现段错误

转载 作者:太空狗 更新时间:2023-10-29 17:20:46 25 4
gpt4 key购买 nike

我通过 valgrind 收到最后的“完成”消息,并收到此退出报告:

==3434== HEAP SUMMARY:
==3434== in use at exit: 8,432 bytes in 4 blocks
==3434== total heap usage: 4,369 allocs, 8,037 frees, 377,356 bytes allocated
==3434==
==3434== LEAK SUMMARY:
==3434== definitely lost: 152 bytes in 1 blocks
==3434== indirectly lost: 0 bytes in 0 blocks
==3434== possibly lost: 0 bytes in 0 blocks
==3434== still reachable: 8,192 bytes in 2 blocks
==3434== suppressed: 88 bytes in 1 blocks
==3434== Rerun with --leak-check=full to see details of leaked memory
==3434==
==3434== For counts of detected and suppressed errors, rerun with: -v
==3434== ERROR SUMMARY: 100190 errors from 140 contexts (suppressed: 0 from 0)

但是当我在没有 valgrind 的情况下运行它时,它会立即出现段错误。 valgrind 是否会抑制我应该寻找的某种错误?我在网上找不到任何关于这个的信息

最佳答案

Valgrind 在与从 shell 运行程序不同的环境中运行程序。这可以防止与内存耗尽或数组出站有关的一些崩溃。

纠正你的 140 个错误上下文,你会没事的。

关于c - 仅在没有 valgrind 的情况下出现段错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10997031/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com