[libvirt-users] Definition /dev/shm prevent LXC container from start: "Failed to access '(null)': Bad address"

Hi all We use libvirt 1.2.x and 1.3.x with next filesystem definition in config: <filesystem type='ram' accessmode='passthrough'> <source usage='524288' units='KiB'/> <target dir='/dev/shm'/> </filesystem> But libvirt 2.1.0 with same config report error: Failed to access '(null)': Bad address Debug level 1 show: 2016-08-11 10:14:56.661+0000: 1: debug : lxcContainerMountAllFS:1618 : Mounting all non-root filesystems 2016-08-11 10:14:56.661+0000: 1: debug : lxcContainerMountAllFS:1625 : Mounting '(null)' -> '/dev/shm' 2016-08-11 10:14:56.661+0000: 1: error : lxcContainerResolveSymlinks:629 : Failed to access '(null)': Bad address 2016-08-11 10:14:56.661+0000: 1: debug : virFileClose:102 : Closed fd 15 2016-08-11 10:14:56.661+0000: 1: debug : virFileClose:102 : Closed fd 10 2016-08-11 10:14:56.661+0000: 1: debug : virFileClose:102 : Closed fd 12 2016-08-11 10:14:56.661+0000: 1: debug : lxcContainerChild:2271 : Tearing down container Failure in libvirt_lxc startup: Failed to access '(null)': Bad address Someone use libvirt 2.x with /dev/shm device ? Probably need change config and add some definitions to /dev/shm ? b.r. Maxim Kozin

On Thu, Aug 11, 2016 at 03:38:06PM +0300, mxs kolo wrote:
Hi all
We use libvirt 1.2.x and 1.3.x with next filesystem definition in config: <filesystem type='ram' accessmode='passthrough'> <source usage='524288' units='KiB'/> <target dir='/dev/shm'/> </filesystem>
But libvirt 2.1.0 with same config report error: Failed to access '(null)': Bad address
Debug level 1 show: 2016-08-11 10:14:56.661+0000: 1: debug : lxcContainerMountAllFS:1618 : Mounting all non-root filesystems 2016-08-11 10:14:56.661+0000: 1: debug : lxcContainerMountAllFS:1625 : Mounting '(null)' -> '/dev/shm' 2016-08-11 10:14:56.661+0000: 1: error : lxcContainerResolveSymlinks:629 : Failed to access '(null)': Bad address 2016-08-11 10:14:56.661+0000: 1: debug : virFileClose:102 : Closed fd 15 2016-08-11 10:14:56.661+0000: 1: debug : virFileClose:102 : Closed fd 10 2016-08-11 10:14:56.661+0000: 1: debug : virFileClose:102 : Closed fd 12 2016-08-11 10:14:56.661+0000: 1: debug : lxcContainerChild:2271 : Tearing down container Failure in libvirt_lxc startup: Failed to access '(null)': Bad address
Someone use libvirt 2.x with /dev/shm device ? Probably need change config and add some definitions to /dev/shm ?
it is a bug introduced in 2.1.0 - i've just copied you on a patch that should fix it. If possible, it'd be good if you can build with that patch and report whether it works for you Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

it is a bug introduced in 2.1.0 - i've just copied you on a patch that should fix it. If possible, it'd be good if you can build with that patch and report whether it works for you
After patch, container pass mount phase. But crash somewhere later: ---------------------------------------------------------------------------- 2016-08-11 14:54:03.728+0000: 1: debug : lxcContainerMountAllFS:1625 : Mounting '(null)' -> '/dev/shm' 2016-08-11 14:54:03.904+0000: 6713: debug : lxcContainerWaitForContinue:418 : Got continue on fd 11 0 2016-08-11 14:54:03.904+0000: 6713: error : virLXCControllerRun:2439 : error receiving signal from container: Input/output error 2016-08-11 14:54:03.904+0000: 6713: debug : virFileClose:102 : Closed fd 9 2016-08-11 14:54:03.904+0000: 6713: debug : virFileClose:102 : Closed fd 11 2016-08-11 14:54:03.904+0000: 6713: debug : virProcessAbort:167 : aborting child process 6714 2016-08-11 14:54:03.904+0000: 6713: debug : virProcessAbort:172 : process has ended: fatal signal 11 Failure in libvirt_lxc startup: error receiving signal from container: Input/output error ---------------------------------------------------------------------------- After remove from config section <filesystem type='ram', container started, but /dev/shm use all memory from hardware node: [root@tst2 ~]# df | grep shm tmpfs 32849396 0 32849396 0% /dev/shm I found another way to limit /dev/shm, inside container change /etc/fstab next way: -none /dev/shm tmpfs nosuid,nodev 0 0 +none /dev/shm tmpfs nosuid,nodev,size=512M 0 0 b.r. Maxim Kozin

On Thu, Aug 11, 2016 at 08:24:53PM +0300, mxs kolo wrote:
it is a bug introduced in 2.1.0 - i've just copied you on a patch that should fix it. If possible, it'd be good if you can build with that patch and report whether it works for you
After patch, container pass mount phase. But crash somewhere later: ---------------------------------------------------------------------------- 2016-08-11 14:54:03.728+0000: 1: debug : lxcContainerMountAllFS:1625 : Mounting '(null)' -> '/dev/shm' 2016-08-11 14:54:03.904+0000: 6713: debug : lxcContainerWaitForContinue:418 : Got continue on fd 11 0 2016-08-11 14:54:03.904+0000: 6713: error : virLXCControllerRun:2439 : error receiving signal from container: Input/output error 2016-08-11 14:54:03.904+0000: 6713: debug : virFileClose:102 : Closed fd 9 2016-08-11 14:54:03.904+0000: 6713: debug : virFileClose:102 : Closed fd 11 2016-08-11 14:54:03.904+0000: 6713: debug : virProcessAbort:167 : aborting child process 6714 2016-08-11 14:54:03.904+0000: 6713: debug : virProcessAbort:172 : process has ended: fatal signal 11 Failure in libvirt_lxc startup: error receiving signal from container: Input/output error ----------------------------------------------------------------------------
Ok, there was a second bug, which I've also sent a patch for now. I've tested it works now too. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (2)
-
Daniel P. Berrange
-
mxs kolo