apollo icon indicating copy to clipboard operation
apollo copied to clipboard

Error happened while running 'bash apollo.sh build'

Open AoZhang opened this issue 9 years ago • 8 comments

after setting docker env use the following commands

bash docker/scripts/install_docker.sh
# logout and login to make sure to run docker command without sudo
docker ps  # to verify docker works without sudo
bash docker/scripts/dev_start.sh
bash docker/scripts/dev_into.sh

I try to build apollo:

bash apollo.sh build

and got the following errors:

WARNING: Running Bazel server needs to be killed, because the startup options are different.
INFO: Found 189 targets...
ERROR: /apollo/modules/common/adapters/BUILD:16:1: C++ compilation of rule '//modules/common/adapters:adapter_manager' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g '-std=c++0x' '-DUSE_ESD_CAN=false' -MD -MF ... (remaining 96 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 4.
gcc: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
INFO: Elapsed time: 1290.986s, Critical Path: 123.06s
============================
[ERROR] Build failed!
[INFO] Took 4081 seconds
============================

AoZhang avatar Jul 13 '17 06:07 AoZhang

When I try to build apollo: bash apollo.sh build. I encountered the same question, looking forward to a solution.

Iris1120 avatar Jul 13 '17 09:07 Iris1120

Potentially same as #75. Please check if your machine has enough memory. We recommend at least 2G+ to build successfully.

siyangy avatar Jul 13 '17 18:07 siyangy

Is the build on linux? Using the newest code, a warning should be printed out if the total memory is less than 2G. So this might be a different issue.

lianglia-apollo avatar Jul 13 '17 21:07 lianglia-apollo

A quick check on whether it's caused by OOM is to use dmesg command.

siyangy avatar Jul 13 '17 21:07 siyangy

You must run the build after run "bash docker/scripts/dev_into.sh", then it will enter into the docker env.

yipinp avatar Jul 14 '17 09:07 yipinp

I got the warning which the building need at least 2G memory, but I omit it. I build the newest code using linux, but I have only 1G memory.

AoZhang avatar Jul 17 '17 02:07 AoZhang

Please try to bump up your memory in order to build successfully.

siyangy avatar Jul 17 '17 02:07 siyangy

I try dmesg and get some hint

[335290.862987] Out of memory: Kill process 25350 (cc1plus) score 309 or sacrifice child
[335290.863035] Killed process 25350 (cc1plus) total-vm:357508kB, anon-rss:312728kB, file-rss:0kB

It seems like OOM.

AoZhang avatar Jul 17 '17 02:07 AoZhang