Hello @all,

currently, I'm testing lxc 4.0.5 with multiple Linux distro's,
and on some of them lxc-create(1) segfaulted.

When I run lxc-create(1) in GDB, I get:

Program received signal SIGSEGV, Segmentation fault.
x0i0007ffff7b6be79 in do_lxcapi_create (c=c@entry=0x6980b0, 
t=t@entry=0x7fffffffe874 "vserver", bdevtype=bdevtype@entry=0x0, 
specs=specs@entry=0x7fffffffe4b0, flags=flags@entry=0, 
argv=argv@entry=0x7fffffffe640) at lxccontainer.c:1923
1923                    bool reset_managed = c->lxc_conf->rootfs.managed;

This is near the end of do_lxcapi_create().  A few lines before,
the config is reset:

        /* Reload config to get the rootfs. */
        lxc_conf_free(c->lxc_conf);
        c->lxc_conf = NULL;

The segfault happens when recreating the configuration fails afterwards,
e. g. when prepend_lxc_header() returns failure.

The reason for prepend_lxc_header() failing was a missing call to
        OpenSSL_add_all_digests();
just before
        md = EVP_get_digestbyname("sha1");
in src/lxc/utils.c; openssl versions older than 1.1.0 need this.

My question now is: What's the correct fix for the segfault?
container_destroy() needs a valid configation in c->lxc_conf.
Maybe we have to preserve the old c->lxc_conf until the new 
configuration was created?

Best regards,

Robert

_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to