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 1091206 - libvirtd crashed after hot-unplug the vcpus which is pinned to host cpus
Summary: libvirtd crashed after hot-unplug the vcpus which is pinned to host cpus
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: 1088165
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-25 08:18 UTC by Jan Kurik
Modified: 2014-05-27 16:27 UTC (History)
13 users (show)

Fixed In Version: libvirt-0.10.2-29.el6_5.8
Doc Type: Bug Fix
Doc Text:
Cause: When unplugging a virtual CPU, libvirt kept a pointer to freed memory if the CPU was pinned. Consequence: The daemon crashed when it tried to access this memory. Fix: Remove the pointer after the memory is freed. Result: Reading pinning information after unplugging a CPU does not lead to a crash anymore.
Clone Of:
Environment:
Last Closed: 2014-05-27 16:27:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2014:0560 0 normal SHIPPED_LIVE Moderate: libvirt security and bug fix update 2014-05-27 20:25:33 UTC

Description Jan Kurik 2014-04-25 08:18:19 UTC
This bug has been copied from bug #1088165 and has been proposed
to be backported to 6.5 z-stream (EUS).

Comment 8 Xuesong Zhang 2014-05-20 06:04:03 UTC
Verify this bug with the following package version, it is fixed.

Packages version:
libvirt-0.10.2-29.el6_5.8.x86_64
qemu-kvm-0.12.1.2-2.415.el6_5.9.x86_64
kernel-2.6.32-431.20.2.el6.x86_64


Steps:
1. start one, guest, which contains 2 vcpus.
# virsh start rhel6.5
Domain rhel6.5 started

# virsh dumpxml rhel6.5|grep cpu
  <vcpu placement='static' current='2'>4</vcpu>

2. pin the 2nd vcpu to host cpus
# virsh vcpupin rhel6.5 1 0,3

# virsh dumpxml rhel6.5|grep cpu
  <vcpu placement='static' current='2'>4</vcpu>
  <cputune>
    <vcpupin vcpu='1' cpuset='0,3'/>
  </cputune>

3. hot-unplug the last vcpu from guest
# virsh setvcpus rhel6.5 1

# virsh dumpxml rhel6.5|grep cpu
  <vcpu placement='static' current='1'>4</vcpu>

4. check the libvirtd service status, it is working well. No dead.
# service libvirtd status
libvirtd (pid  2272) is running...

Comment 9 Xuesong Zhang 2014-05-21 06:28:17 UTC
(In reply to Zhang Xuesong from comment #8)
> Verify this bug with the following package version, it is fixed.
> 
> Packages version:
> libvirt-0.10.2-29.el6_5.8.x86_64
> qemu-kvm-0.12.1.2-2.415.el6_5.9.x86_64
> kernel-2.6.32-431.20.2.el6.x86_64
> 
> 
> Steps:
> 1. start one, guest, which contains 2 vcpus.
> # virsh start rhel6.5
> Domain rhel6.5 started
> 
> # virsh dumpxml rhel6.5|grep cpu
>   <vcpu placement='static' current='2'>4</vcpu>
> 
> 2. pin the 2nd vcpu to host cpus
> # virsh vcpupin rhel6.5 1 0,3
> 
> # virsh dumpxml rhel6.5|grep cpu
>   <vcpu placement='static' current='2'>4</vcpu>
>   <cputune>
>     <vcpupin vcpu='1' cpuset='0,3'/>
>   </cputune>
> 

Checking in the guest, and make sure the vcpu number in guest is right.
Login the guest, and check the vcpuinfo, 
# cat /proc/cpuinfo |grep processor |wc -l
2

> 3. hot-unplug the last vcpu from guest
> # virsh setvcpus rhel6.5 1
> 
> # virsh dumpxml rhel6.5|grep cpu
>   <vcpu placement='static' current='1'>4</vcpu>

After hot-unplug. login the guest, and check the vcpuinfo, 
# cat /proc/cpuinfo |grep processor |wc -l
1


> 
> 4. check the libvirtd service status, it is working well. No dead.
> # service libvirtd status
> libvirtd (pid  2272) is running...


Ad-hoc testing some other related testing, all of them are working well:
1. check the cpu-stats, vcpuinfo, vcpupin, vcpucount, all of them are working well. 
# virsh cpu-stats rhel6.5
CPU0:
	cpu_time            17.710181082 seconds
	vcpu_time           12.951564011 seconds
CPU1:
	cpu_time             8.207106669 seconds
	vcpu_time            2.712824892 seconds
CPU2:
	cpu_time            16.484833647 seconds
	vcpu_time            8.101443002 seconds
CPU3:
	cpu_time            10.336857805 seconds
	vcpu_time            5.647272634 seconds
Total:
	cpu_time            52.738979203 seconds
	user_time            3.550000000 seconds
	system_time         17.980000000 seconds

# virsh vcpuinfo rhel6.5
VCPU:           0
CPU:            2
State:          running
CPU time:       29.4s
CPU Affinity:   yyyy

# virsh vcpupin rhel6.5
VCPU: CPU Affinity
----------------------------------
   0: 0-3

# virsh vcpucount rhel6.5
maximum      config         4
maximum      live           4
current      config         2
current      live           1


2. Hot-plug vcpus, the vcpu number in vcpucount is working well.
# virsh setvcpus rhel6.5 2

# virsh vcpucount rhel6.5
maximum      config         4
maximum      live           4
current      config         2
current      live           2

3. check in the guest, the vcpu number is increased as expected.
# cat /proc/cpuinfo |grep processor |wc -l
2


4. hot-unplug vcpus, the vcpu number in vcpucount is working well.
# virsh setvcpus rhel6.5 1

# virsh vcpucount rhel6.5
maximum      config         4
maximum      live           4
current      config         2
current      live           1

5. check in the guest, the vcpu number is decreased as expected.
# cat /proc/cpuinfo |grep processor |wc -l
1

Comment 11 errata-xmlrpc 2014-05-27 16:27:07 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/RHSA-2014-0560.html


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