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 1109120 - [LXC] Segmentation fault occurs when start lxc guest
Summary: [LXC] Segmentation fault occurs when start lxc guest
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-13 09:41 UTC by hongming
Modified: 2014-10-14 04:22 UTC (History)
8 users (show)

Fixed In Version: libvirt-0.10.2-39.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-14 04:22:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1014847 0 unspecified CLOSED F20 - virt-install of a linux container fails with "unexpected fatal signal 11" 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2014:1374 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2014-10-14 08:11:54 UTC

Internal Links: 1014847

Description hongming 2014-06-13 09:41:38 UTC
Description of problem:
Segmentation fault occurs when start lxc guest 

Version-Release number of selected component (if applicable):
kernel-2.6.32-478.el6.x86_64
libvirt-0.10.2-37.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
[root@ibm-x3850x5-09 ~]# virsh -c lxc:/// list --all
 Id    Name                           State
----------------------------------------------------
 -     toy                            shut off
 -     vm1                            shut off

[root@ibm-x3850x5-09 ~]# virsh -c lxc:/// dumpxml vm1
<domain type='lxc'>
  <name>vm1</name>
  <uuid>1e7216e9-f7c7-395f-d2fc-21c0d75817a2</uuid>
  <memory unit='KiB'>500000</memory>
  <currentMemory unit='KiB'>500000</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64'>exe</type>
    <init>/bin/sh</init>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/libvirt_lxc</emulator>
    <interface type='network'>
      <mac address='52:54:00:f2:2c:ac'/>
      <source network='default'/>
      <target dev='veth0'/>
    </interface>
    <console type='pty'>
      <target type='lxc' port='0'/>
    </console>
  </devices>
  <seclabel type='none'/>
</domain>

[root@ibm-x3850x5-09 ~]# virsh -c lxc:/// start vm1
error: Failed to start domain vm1
error: internal error Child process (PATH=/sbin:/usr/sbin:/bin:/usr/bin LIBVIRT_DEBUG=1 LIBVIRT_LOG_OUTPUTS=1:stderr /usr/libexec/libvirt_lxc --name vm1 --console 23 --security=none --handshake 26 --background --veth veth1) unexpected fatal signal 11



[root@ibm-x3850x5-09 ~]# gdb /usr/libexec/libvirt_lxc
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-74.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/libexec/libvirt_lxc...Reading symbols from /usr/lib/debug/usr/libexec/libvirt_lxc.debug...done.
done.
(gdb) run --name vm1 --console 23 --security=none --handshake 26 --background --veth veth1
Starting program: /usr/libexec/libvirt_lxc --name vm1 --console 23 --security=none --handshake 26 --background --veth veth1
[Thread debugging using libthread_db enabled]
Detaching after fork from child process 6666.

Program received signal SIGSEGV, Segmentation fault.
__libc_free (mem=0x21) at malloc.c:3714
3714	  if (chunk_is_mmapped(p))                       /* release mmapped memory. */
Missing separate debuginfos, use: debuginfo-install avahi-libs-0.6.25-12.el6.x86_64
(gdb) 


Actual results:
Segmentation fault occurs when start lxc guest 

Expected results:
it works fine

Additional info:

Comment 1 hongming 2014-06-13 09:45:34 UTC
It is also reproduced in libvirt-0.10.2-38.el6.x86_64.

Comment 3 Peter Krempa 2014-06-13 11:28:56 UTC
Please attach the full backtrace of the crashed process.

Comment 4 hongming 2014-06-16 05:49:57 UTC
[root@ibm-x3850x5-09 ~]# gdb /usr/libexec/libvirt_lxc
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-74.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/libexec/libvirt_lxc...Reading symbols from /usr/lib/debug/usr/libexec/libvirt_lxc.debug...done.
done.
(gdb) run --name vm1 --console 23 --security=none --handshake 26 --background --veth veth1
Starting program: /usr/libexec/libvirt_lxc --name vm1 --console 23 --security=none --handshake 26 --background --veth veth1
[Thread debugging using libthread_db enabled]
Detaching after fork from child process 17168.

Program received signal SIGSEGV, Segmentation fault.
__libc_free (mem=0x21) at malloc.c:3714
3714	  if (chunk_is_mmapped(p))                       /* release mmapped memory. */
Missing separate debuginfos, use: debuginfo-install avahi-libs-0.6.25-12.el6.x86_64
(gdb) thread apply all bt

Thread 1 (Thread 0x7ffff7fe2840 (LWP 17163)):
#0  __libc_free (mem=0x21) at malloc.c:3714
#1  0x00000000004693d9 in virFree (ptrptr=0x8cf038) at util/memory.c:419
#2  0x000000000047f24b in virResetError (err=0x8cf010) at util/virterror.c:324
#3  0x0000000000465d22 in virEventRegisterDefaultImpl () at util/event.c:206
#4  0x0000000000410b45 in main (argc=11, argv=0x7fffffffe4e8) at lxc/lxc_controller.c:1575
(gdb)

Comment 5 Ján Tomko 2014-06-16 11:23:00 UTC
Fixed upstream by:
commit 97973ebb7a64a3be6710ddd38d124307991ad7cb
Author:     Daniel P. Berrange <berrange>
AuthorDate: 2013-10-08 14:35:01 +0100
Commit:     Daniel P. Berrange <berrange>
CommitDate: 2013-10-14 12:16:23 +0100

    Initialize threading & error layer in LXC controller
    
    In Fedora 20, libvirt_lxc crashes immediately at startup with a
    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
    
    Normally virInitialize calls virErrorInitialize and
    virThreadInitialize, but we don't link to libvirt.so
    in libvirt_lxc, and nor did we ever call the error
    or thread initializers.
    
    I have absolutely no idea how this has ever worked, let alone
    what caused it to stop working in Fedora 20.
    
    In addition not all code paths from virLogSetFromEnv will
    ensure virLogInitialize is called correctly, which is another
    possible crash scenario.
    
    Signed-off-by: Daniel P. Berrange <berrange>

git describe: v1.1.3-110-g97973eb contains: v1.1.4-rc1~123

Comment 9 Luwen Su 2014-06-25 02:15:03 UTC
Verified with
libvirt-0.10.2-39.el6.x86_64
kernel-2.6.32-486.el6.x86_64

Steps:
1.Same xml in comment0
#virsh -c lxc:/// define container.xml
#virsh -c lxc:/// start vm1
#virsh -c lxc:/// list
 Id    Name                           State
----------------------------------------------------
 7884  vm1                            running


Not crash.

Comment 11 errata-xmlrpc 2014-10-14 04:22:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1374.html


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