gpt4 book ai didi

c++ - 段错误 : stack overflow

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:59:42 25 4
gpt4 key购买 nike

<分区>

以下发生在 linux 2.6.32-220.7.1.el6.x86_64g++ 4.4.6 中。

以下代码:

#include <iostream>
#include <cstdlib>

int PROB_SIZE = 10000000;
using namespace std;

int main(int argc, char *argv[]) {

unsigned int numbers[PROB_SIZE];
cout << "Generating " << PROB_SIZE << " random numbers... " << flush;

return 0;
}

产生以下 SIGSEGV: (gdb) 运行 启动程序:/home/cpd20202/sorting/error

Program received signal SIGSEGV, Segmentation fault.
0x000000000040093b in main (argc=1, argv=0x7fffffffe4f8) at error.cpp:13
13 cout << "Generating " << PROB_SIZE << " random numbers... " << flush;
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.47.el6_2.5.x86_64 libgcc-4.4.6-3.el6.x86_64 libstdc++-4.4.6-3.el6.x86_64
(gdb) where
#0 0x000000000040093b in main (argc=1, argv=0x7fffffffe4f8) at error.cpp:13

我真的没主意了。

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