Running bazel build on a fat java/scala project (several thousands of targets) fails when working on linux debian with user namespace enabled.
Issue
Trying to run bazel build with user namespace enabled:
$ sysctl kernel.unprivileged_userns_clone=1
The build runs alright but at some point it crashes with weird memory issue:
ERROR: <target-path>/BUILD:35:1: error executing shell command: '
rm -rf bazel-out/local-fastbuild/bin/<package>/<target>.jar_temp_resources_dir
set -e
mkdir -p bazel-out/local-fastbuild/bin/<target>' failed: Process terminated by signal 6 [sandboxed].
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGBUS (0x7) at pc=0x00007f094606874b, pid=5, tid=0x00007f09472e0700
#
# JRE version: (8.0_131-b11) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x96874b] PerfMemory::alloc(unsigned long)+0x7b
#
# Core dump written. Default location: /home/builduser/.cache/bazel/_bazel_builduser/bc0e462ab01ac9379d22ad058ca1cb1f/bazel-sandbox/4864102460254154064/execroot/__main__/core or core.5
#
# An error report file with more information is saved as:
# /home/builduser/.cache/bazel/_bazel_builduser/bc0e462ab01ac9379d22ad058ca1cb1f/bazel-sandbox/4864102460254154064/execroot/__main__/hs_err_pid5.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
Environment info
The machine is docker container based on debian image
$ uname -a
Linux 167-docker99 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2 (2017-04-30) x86_64 GNU/Linux
builduser@167-docker99:~/ws/bazel-port-isolation$ cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"Bazel version
additional information
Running
bazel buildon a fat java/scala project (several thousands of targets) fails when working on linux debian with user namespace enabled.Issue
Trying to run
bazel buildwith user namespace enabled:The build runs alright but at some point it crashes with weird memory issue:
Environment info
The machine is docker container based on debian image
specs2versions and test runner env preparation)additional information
unprivileged_userns_clone=0(but clearly - that's not a solution)