我在程序执行后遇到这个错误, 0;已被执行。
I am facing this error after program execution and after "return 0;" has been executed.
我使用了STL的向量。只有当输入文件大小很高(我在图形中有大约10000个节点)时才会抛出此错误。
I have used vectors from STL. This error is thrown only when input file size is very high (I am having around 10000 nodes in graph)
此外,我无法将输出写入文件。目前我已经评论过那部分。
Also, I am not able to write output to a file. Currently I have commented that part.
请帮助我解决问题。 我使用的是Ubuntu 12.10 64位。
Please help me with issue. I am using Ubuntu 12.10 64 bit.
推荐答案从 code>可能是由(至少)造成的:
Errors after returning from main can be caused by (at least):
- dodgy atexit 处理程序;
- dodgy atexit handlers; or
- memory corruption of some description.
在这两种情况下,后者因此您应该在动态内存使用分析工具(如 valgrind )下运行您的代码。您对于导致问题的大型载体的描述也似乎支持此争论。
Of those two, it's more likely to be the latter so you should run your code under a dynamic memory-use analysis tool, like valgrind. Your description of large vectors causing the problem also seems to support this contention.
更多推荐
程序在返回0后接收SIGSEGV错误
发布评论