Hello Christian,

Attached you can find a xenial SRU patch based on commit

Here is the guest definition used on my testing

Without the patch, the error is reproduced.

root@buneary:/home/ubuntu# virsh start reproducer2
error: Failed to start domain reproducer2
error: internal error: process exited while connecting to monitor: mlockall: 
Cannot allocate memory
2017-08-11T03:59:54.936275Z qemu-system-x86_64: locking memory failed

With the patch the guest is initialized correctly.

root@buneary:/var/lib/uvtool/libvirt/images# virsh start reproducer2
Domain reproducer2 started

I ran the following systemtap probe (probe
kernel.function("sys_setrlimit") { printf("locked: %d -> %s\n", pid(),
sprintf("%s, %s", _rlimit_resource_str($resource),
_struct_rlimit_u($rlim))) } )

And the output shows that the RLIMIT_MEMLOCK process limit is set to

root@buneary:/home/ubuntu# stap -g qemu_probe.stap -kv  -g 
Pass 1: parsed user script and 465 library scripts using 
112796virt/48440res/6664shr/42136data kb, in 130usr/40sys/164real ms.
Pass 2: analyzed script: 1 probe, 5 functions, 100 embeds, 0 globals using 
164772virt/101848res/7988shr/94112data kb, in 660usr/120sys/776real ms.
Pass 3: translated to C into "/tmp/stapVXuoMi/stap_30601_src.c" using 
164772virt/102040res/8180shr/94112data kb, in 10usr/0sys/5real ms.
Pass 4: compiled C into "stap_30601.ko" in 2160usr/540sys/3231real ms.
Pass 5: starting run.
locked: 31028 -> RLIMIT_MEMLOCK, [9007199254740991,9007199254740991]

** Changed in: libvirt (Ubuntu Artful)
       Status: Confirmed => Fix Released

** Changed in: libvirt (Ubuntu Artful)
       Status: Fix Released => Fix Committed

** Patch added: "fix-1708305-xenial.debdiff"

You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

  Realtime feature mlockall: Cannot allocate memory

To manage notifications about this bug go to:

ubuntu-bugs mailing list

Reply via email to