lxc / python3-lxc

Python 3.x binding for liblxc
https://linuxcontainers.org/lxc
GNU Lesser General Public License v2.1
57 stars 38 forks source link

Segmentation fault from container creation call within a nested container #20

Open pevogam opened 4 years ago

pevogam commented 4 years ago

Hi,

Running this minimal script

import lxc
c = lxc.Container("taskc")
if not c.defined:
    # Create the container rootfs
    if not c.create("download", lxc.LXC_CREATE_QUIET, {"dist": "fedora",
                                                       "release": "32",
                                                       "arch": "i386"}):
        print("Could not create container")

within a container with nesting.conf enabled results in Segmentation fault (core dumped) with LXC version 3.2.1. Restricting the possible sources shows that the create call is the reason for the segmentation fault.

Has anyone else experienced this?

pevogam commented 4 years ago

I am not sure if this is even possible despite the lines

# Template script checksum (SHA-1): a4e52f9f5b11c05d7c29b3fcb4644995b68f219e
# For additional config options, please look at lxc.container.conf(5)
# Uncomment the following line to support nesting containers:
lxc.include = /usr/share/lxc/config/nesting.conf

so perhaps it is not supported. In any case, it would be probably be good if the exit is more graceful than segfaulting.