Linux下和core说再见之:栈溢出(2)

两个信息:
1)Program terminated with signal 11, Segmentation fault.
Signal 11, or officially know as "segmentation fault", means that theprogram accessed a memory location that was not assigned. That'susually a bug in the program.

2) core在 cout << "stack  " << group << endl;
在栈溢出的时候,并不一定会马上core,这也是为啥你core的地方常常离出问题的代码很远。

4. 解决

1)在需要占用大内存的时候(例如,大数组),别偷懒,乖乖的用堆!
2)尽量避免层次多的递归函数

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwgfzz.html