RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1018725 - Add preventative fix for possible future crash in LXC startup
Summary: Add preventative fix for possible future crash in LXC startup
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Daniel Berrangé
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-14 09:55 UTC by Daniel Berrangé
Modified: 2014-06-18 00:57 UTC (History)
8 users (show)

Fixed In Version: libvirt-1.1.1-9.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 1014847
Environment:
Last Closed: 2014-06-13 11:15:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Daniel Berrangé 2013-10-14 09:55:54 UTC
+++ This bug was initially created as a clone of Bug #1014847 +++

Description of problem:
Trying to start up LXC containers with virt-install fail.

Version-Release number of selected component (if applicable):
virt-install-0.10.0-3.gita2e52067.fc20.noarch
libvirt-daemon-driver-lxc-1.1.3-1.fc20.x86_64
lxc-0.9.0-2.fc20.x86_64
lxc-libs-0.9.0-2.fc20.x86_64
libvirt-daemon-lxc-1.1.3-1.fc20.x86_64

How reproducible:
Every time.

Steps to Reproduce:
1.Set up a rootfs for the container with: yum -y --releasever=20 --nogpg --installroot=/var/lib/libvirt/filesystems/mycontainer `
          --disablerepo='*' --enablerepo=fedora install \
          systemd passwd yum fedora-release vim-minimal openssh-server procps-ng
2.Start the container with: virt-install --connect lxc:/// --name mycontainer --ram 800 --filesystem /var/lib/libvirt/filesystems/mycontainer,/
3. Fail

Actual results:
[root@f20 /]# virt-install --connect lxc:/// --name mycontainer --ram 800 --filesystem /var/lib/libvirt/filesystems/mycontainer,/

Starting install...
ERROR    internal error: Child process (PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin LIBVIRT_DEBUG=3 LIBVIRT_LOG_OUTPUTS=3:stderr /usr/libexec/libvirt_lxc --name mycontainer --console 24 --security=selinux --handshake 27 --background --veth veth1) unexpected fatal signal 11
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect lxc:/// start mycontainer
otherwise, please restart your installation.

Expected results:
My container to start up successfully.

Additional info:

--- Additional comment from Daniel Berrange on 2013-10-03 11:19:12 BST ---

Can you tell me if you had SELinux in  enforcing mode, and does putting it in permissive mode work ?

Also what version of 'selinux-policy' do you have, because there was a recent broken version that caused libvirt to crash.

--- Additional comment from Joel on 2013-10-03 18:33:23 BST ---

It is in permissive, and it does fire off some SElinux alerts:

[root@f20 ~]# getenforce 
Permissive
[root@f20 ~]# virt-install --connect lxc:/// --name mycontainer --ram 800 --filesystem /root/fedora-rootfs,/

Starting install...
ERROR    internal error: Child process (PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin LIBVIRT_DEBUG=3 LIBVIRT_LOG_OUTPUTS=3:stderr /usr/libexec/libvirt_lxc --name mycontainer --console 22 --security=selinux --handshake 25 --background --veth veth1) unexpected fatal signal 11
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect lxc:/// start mycontainer
otherwise, please restart your installation.

[root@f20 ~]# rpm -qa | grep selinux-policy
selinux-policy-3.12.1-84.fc20.noarch
selinux-policy-targeted-3.12.1-84.fc20.noarch

--- Additional comment from Daniel Berrange on 2013-10-08 11:56:29 BST ---

Ok, it isn't the bug I was thinking of wrt selinux policy at least.

Managed to reproduce it and capture a very unexpectedly wierd stack trace

#0  0x00007f0cddb653ec in free () from /lib64/libc.so.6
#1  0x00007f0ce0e16f4a in virFree (ptrptr=ptrptr@entry=0x7f0ce1830058) at util/viralloc.c:580
#2  0x00007f0ce0e2764b in virResetError (err=0x7f0ce1830030) at util/virerror.c:354
#3  0x00007f0ce0e27a5a in virResetLastError () at util/virerror.c:387
#4  0x00007f0ce0e28858 in virEventRegisterDefaultImpl () at util/virevent.c:233
#5  0x00007f0ce0db47c6 in main (argc=11, argv=0x7fff4596c328) at lxc/lxc_controller.c:2352

--- Additional comment from Daniel Berrange on 2013-10-08 14:53:40 BST ---

From the department of "How on earth did this ever avoiding crashing in previous Fedora"

https://www.redhat.com/archives/libvir-list/2013-October/msg00332.html

Comment 1 Daniel Berrangé 2013-10-14 09:59:36 UTC
NB, this problem does not currently occur in RHEL-7. We also have no idea what caused the problem to suddenly start happening in Fedora. That said, the libvirt LXC code is clearly broken as it is written now.  The concern is that whatever change triggered this in Fedora, may be backported to RHEL, and we'd never know until all LXC guests started failing in RHEL. So this very simple upstream patch should be applied to RHEL as a preventative measure.

Comment 4 Luwen Su 2013-10-21 07:27:57 UTC
Test:
libvirt-1.1.1-9.el7.x86_64
selinux-policy-3.12.1-92.el7.noarch
kernel-3.10.0-34.el7.x86_64

Steps:
1.Prepare a fedora 20 repo in /etc/yum.repo/

2.
#yum -y --releasever=20 --nogpg --installroot=/var/lib/libvirt/filesystems/test-fedora --disablerepo='*' --enablerepo=fedora install systemd passwd yum fedora-release vim-minimal openssh-server procps-ng

#virt-install --connect lxc:/// --name test-fedora  --ram 800 --filesystem /var/lib/libvirt/filesystems/test-fedora/,/


Fedora release 21 (Rawhide)
Kernel 3.10.0-34.el7.x86_64 on an x86_64 (console)

localhost login: 

3.
# getenforce
Enforcing

So set this VERIFIED

Comment 5 Ludek Smid 2014-06-13 11:15:41 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


Note You need to log in before you can comment on or make changes to this bug.