linux - 制作-j 8 g++ : internal compiler error: Killed (program cc1plus)

标签 linux ubuntu gcc g++ mesos

当我在ubuntu12.04上部署apache mesos时,我按照官方文档“make -j 8”遵循官方文档,我在控制台中遇到此错误:

g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.
make[2]: *** [slave/containerizer/mesos/libmesos_no_3rdparty_la-containerizer.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f log/.deps/liblog_la-log.Tpo log/.deps/liblog_la-log.Plo
mv -f slave/containerizer/.deps/libmesos_no_3rdparty_la-docker.Tpo slave/containerizer/.deps/libmesos_no_3rdparty_la-docker.Plo
mv -f log/.deps/liblog_la-consensus.Tpo log/.deps/liblog_la-consensus.Plo

mv -f slave/containerizer/.deps/libmesos_no_3rdparty_la-external_containerizer.Tpo slave/containerizer/.deps/libmesos_no_3rdparty_la-external_containerizer.Plo
mv -f log/.deps/liblog_la-coordinator.Tpo log/.deps/liblog_la-coordinator.Plo
mv -f slave/.deps/libmesos_no_3rdparty_la-slave.Tpo slave/.deps/libmesos_no_3rdparty_la-slave.Plo
mv -f master/.deps/libmesos_no_3rdparty_la-master.Tpo master/.deps/libmesos_no_3rdparty_la-master.Plo
make[2]: Leaving directory `/root/Mesos/mesos/build/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/Mesos/mesos/build/src'
make: *** [all-recursive] Error 1

我该怎么办?

最佳答案

尝试运行(在失败之后)dmesg

你看到这样的一行吗?

Out of memory: Kill process 23747 (cc1plus) score 15 or sacrifice child
Killed process 23747, UID 2243, (cc1plus) total-vm:214456kB, anon-rss:178936kB, file-rss:5908kB

这很可能是您的问题。运行 make -j 8 运行大量使用更多内存的进程。当您的系统内存不足时,就会出现上述问题。在这种情况下,操作系统不会运行一个进程来对系统上的每个进程进行评分,而不是整个系统崩溃。得分最高的会被操作系统杀死以释放内存。如果被杀死的进程是 cc1plus,gcc(可能是错误的)将其解释为进程崩溃,因此假定它一定是编译器错误。但这不是真的,问题是操作系统杀死了 cc1plus,而不是它崩溃了。

如果是这种情况,说明您的内存不足。因此,也许可以运行 make -j 4 。这将意味着更少的并行作业,意味着编译将花费更长的时间,但希望不会耗尽您的系统内存。

关于linux - 制作-j 8 g++ : internal compiler error: Killed (program cc1plus),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30887143/

相关文章:

gcc - 带有 gcc 的 STM32F4 上的 FreeRTOS 堆栈损坏

linux - .deb 安装程序 (linux) 依赖项。如果它不在存储库中怎么办?

linux - 终端中的交互式绘图 Python 5.0.0

linux - rsync 只同步最后一个子目录中的 n 个文件

c - gdb错误: not in executable format: file not recognized

php - 在 Ubuntu 中使用 nginx 和 php7.0-fpm 的 Laravel 5.4 的 502 Bad Gateway

使用 gcc 时 CLion 调试器不工作

ubuntu - 从 Ubuntu 卸载应用程序时如何修复错误 "incorrect permissions on/usr/lib/policykit-1"?

ubuntu - 没有提示的 RVM 安装

linux - 在 Ubuntu 9.04 上为 SimpleScalar 安装 gcc