Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VM] Override address size limit to unlimited #827

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build-vm-docker
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ vm_startup_docker() {
docker rm "$name" >/dev/null 2>&1 || true
local docker_opts=
test -n "$VM_TYPE_PRIVILEGED" && docker_opts="--privileged --cap-add=SYS_ADMIN --cap-add=MKNOD"
# Override memory restriction set by stage1. Docker does not support
# --ulimit as=... for some reason.
ulimit -v 'unlimited'
docker run \
--rm --name "$name" --net=none $docker_opts \
--mount "type=bind,source=$BUILD_ROOT,destination=/mnt" \
Expand Down
2 changes: 2 additions & 0 deletions build-vm-kvm
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ vm_startup_kvm() {
set -- linux64 "$@"
fi
export QEMU_AUDIO_DRV=none # we do not want to have sound inside the VMs
# Allow overcommit, the total memory will already be constrained by qemu.
ulimit -v 'unlimited'
echo "$@"
"$@"
qemu_ret=$?
Expand Down
2 changes: 1 addition & 1 deletion build-vm-nspawn
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ vm_startup_nspawn() {
if test -n "$VM_TYPE_PRIVILEGED"; then
privileged_opt=--privileged
fi
systemd-nspawn -D "$BUILD_ROOT" -M "$name" --private-network $pipe_opt $privileged_opt "$vm_init_script"
systemd-nspawn -D "$BUILD_ROOT" -M "$name" --private-network $pipe_opt $privileged_opt "$vm_init_script" --rlimit=RLIMIT_AS=infinity
BUILDSTATUS="$?"
cleanup_and_exit "$BUILDSTATUS"
}
Expand Down
2 changes: 2 additions & 0 deletions build-vm-qemu
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ vm_startup_qemu() {
set -- linux64 "$@"
fi
export QEMU_AUDIO_DRV=none # we do not want to have sound inside the VMs
# Allow overcommit, the total memory will already be constrained by qemu.
ulimit -v 'unlimited'
echo "$@"
"$@"
qemu_ret=$?
Expand Down
3 changes: 3 additions & 0 deletions build-vm-uml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ vm_verify_options_uml() {

vm_startup_uml() {
set -- $uml_kernel initrd=$uml_initrd root=ubda init="$vm_init_script" $vm_linux_always_append elevator=noop ubda=$VM_ROOT ubdb=$VM_SWAP ${VM_MEMSIZE:+mem=$VM_MEMSIZE}
# Allow overcommit, the total memory will (most of the time?) already be
# constrained by UML.
ulimit -v 'unlimited'
echo "$@"
"$@"
}
Expand Down
2 changes: 2 additions & 0 deletions build-vm-xen
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ vm_startup_xen() {
# have to switch back to PER_LINUX to make xm work
set -- linux64 "$@"
fi
# Allow overcommit, the total memory will already be constrained by Xen.
ulimit -v 'unlimited'
echo "$@"
"$@" || cleanup_and_exit 3
rm -f "$XEN_CONF_FILE"
Expand Down
5 changes: 5 additions & 0 deletions lxc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ lxc.cgroup.devices.allow = c 5:2 rw
# console
lxc.console = none
lxc.console.logfile = /dev/stdout

# Override build script limit (which is only supposed to trigger for non-VM
# builds, but is actually also applied on package building initialization
# time) and breaks address sanitizers.
lxc.prlimit.as = unlimited