Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 852592 - libvirtd will be crashed when run vcpupin more than once
libvirtd will be crashed when run vcpupin more than once
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.4
Unspecified Unspecified
urgent Severity urgent
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-28 22:53 EDT by hongming
Modified: 2013-02-21 02:22 EST (History)
6 users (show)

See Also:
Fixed In Version: libvirt-0.10.1-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 02:22:27 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
libvirt debug log (4.13 MB, text/plain)
2012-08-28 22:54 EDT, hongming
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0276 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2013-02-20 16:18:26 EST

  None (edit)
Description hongming 2012-08-28 22:53:41 EDT
Description of problem:
When pin vcpu using vcpupin command more than once . the libvirtd will be crashed. 

Version-Release number of selected component (if applicable):
libvirt-0.10.0-0rc1.el6.x86_64
qemu-kvm-0.12.1.2-2.295.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.# virsh start rhel6.2
Domain rhel6.2 started


2.# virsh dumpxml rhel6.2 
......
  <vcpu placement='static'>5</vcpu>
......

3.# virsh nodeinfo
CPU model:           x86_64
CPU(s):              4
CPU frequency:       1600 MHz
CPU socket(s):       1
Core(s) per socket:  4
Thread(s) per core:  1
NUMA cell(s):        1
Memory size:         7946252 KiB
 

4. Run the vcpupin command more than once.
# virsh vcpupin rhel6.2 0 1-2

# virsh vcpupin rhel6.2 1 1-2

# virsh vcpupin rhel6.2 2 3

# virsh vcpupin rhel6.2 3 3
error: End of file while reading data: Input/output error
error: Failed to reconnect to the hypervisor

  
Actual results:
libvirtd is crashed

Expected results:
libvirtd works fine

Additional info:
Comment 1 hongming 2012-08-28 22:54:53 EDT
Created attachment 607726 [details]
libvirt debug log
Comment 3 Peter Krempa 2012-08-30 09:52:22 EDT
Patches sent upstream:
http://www.redhat.com/archives/libvir-list/2012-August/msg01912.html
Comment 4 Peter Krempa 2012-08-30 11:08:07 EDT
Fixed upstream with:

commit 077e7bf51f17c20bcf49aac1dff79247e13d5d6d
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Thu Aug 30 15:38:37 2012 +0200

    vcpupin: Fix returning of arrays from virDomainVcpuPinAdd
    
    virDomainVcpuPinAdd does a realloc on vcpupin_list if the new vcpu pin
    definition doesn't fit into the array. The list is an array of pointers
    but the function definition didn't support returning the changed pointer
    to the caller if it was realloced. This caused segfaults if realloc
    would change the base pointer.

In my scenario, the fourth CPU that was pinned (fourth as in fourth virsh command, you may plug them in any order) caused a reallocation that invalidated the pointer. Up to 3 cpus it worked.

Moving to POST.
Comment 6 yanbing du 2012-09-03 03:11:36 EDT
Verify with libvirt-0.10.1-1.el6.x86_64.
Following the bug reproduce steps, do several times vcpupin, and libvirtd still running.
Comment 7 errata-xmlrpc 2013-02-21 02:22:27 EST
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/RHSA-2013-0276.html

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