Bug 1747482 - [cgroup_v2] Crash happens when set cpu related cgroup values by “schedinfo”
Summary: [cgroup_v2] Crash happens when set cpu related cgroup values by “schedinfo”
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.1
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: 8.0
Assignee: Pavel Hrdina
QA Contact: yisun
URL:
Whiteboard:
Depends On: 1747440
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-30 14:28 UTC by Pavel Hrdina
Modified: 2020-11-06 04:02 UTC (History)
8 users (show)

Fixed In Version: libvirt-5.6.0-4.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1747440
Environment:
Last Closed: 2019-11-06 07:19:01 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:3723 0 None None None 2019-11-06 07:19:24 UTC

Description Pavel Hrdina 2019-08-30 14:28:41 UTC
+++ This bug was initially created as a clone of Bug #1747440 +++

Description:
[cgroup_v2] Crash happens when set cpu related cgroup values by “schedinfo”

Versions:
kernel-4.18.0-135.el8.x86_64
libvirt-4.5.0-33.module+el8.1.0+4066+0f1aadab.x86_64

How reproducible:
100%

Steps:
1. Having a running vm
# virsh list
 Id    Name                           State
----------------------------------------------------
 1     avocado-vt-vm1                 running

2. Set cpu related cgroup params by schedinfo, crash happened
# virsh schedinfo avocado-vt-vm1 --set vcpu_period=9999 --set vcpu_quota=8888
Scheduler      : posix
error: Disconnected from qemu:///system due to end of file
error: End of file while reading data: Input/output error

3 backtrace info as follow:
#gdb -p `pidof libvirtd`
…
(gdb) c
Continuing.

Thread 6 "libvirtd" received signal SIGABRT, Aborted.
[Switching to Thread 0x7f33eaf71700 (LWP 26133)]
0x00007f33f2bf08df in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x00007f33f2bf08df in raise () from /lib64/libc.so.6
#1  0x00007f33f2bdacf5 in abort () from /lib64/libc.so.6
#2  0x00007f33f2c33c17 in __libc_message () from /lib64/libc.so.6
#3  0x00007f33f2c3a53c in malloc_printerr () from /lib64/libc.so.6
#4  0x00007f33f2c3bc64 in _int_free () from /lib64/libc.so.6
#5  0x00007f33f60a514f in virFree () from /lib64/libvirt.so.0
#6  0x00007f33f60b6143 in virCgroupV2GetCpuCfsQuota () from /lib64/libvirt.so.0
#7  0x00007f33ad84cd40 in qemuGetVcpuBWLive () from /usr/lib64/libvirt/connection-driver/libvirt_driver_qemu.so
#8  0x00007f33ad85b4f4 in qemuDomainGetSchedulerParametersFlags () from /usr/lib64/libvirt/connection-driver/libvirt_driver_qemu.so
#9  0x00007f33f62bd111 in virDomainGetSchedulerParameters () from /lib64/libvirt.so.0
#10 0x000055c934e9ef7c in remoteDispatchDomainGetSchedulerParametersHelper ()
#11 0x00007f33f61f88b4 in virNetServerProgramDispatch () from /lib64/libvirt.so.0
#12 0x00007f33f61fed6c in virNetServerHandleJob () from /lib64/libvirt.so.0
#13 0x00007f33f612cba0 in virThreadPoolWorker () from /lib64/libvirt.so.0
#14 0x00007f33f612beac in virThreadHelper () from /lib64/libvirt.so.0
#15 0x00007f33f2f842de in start_thread () from /lib64/libpthread.so.0
#16 0x00007f33f2cb5133 in clone () from /lib64/libc.so.6


Expected result:
No crash

Additional info:
Setting other values have same crash and backtrace, record it here for future reference. 
 virsh schedinfo avocado-vt-vm1 --set vcpu_period=9999 --set vcpu_quota=8888
Scheduler : posix
error: Disconnected from qemu:///system due to end of file
error: End of file while reading data: Input/output error


# virsh schedinfo avocado-vt-vm1 --set emulator_period=-1 --set emulator_quota=8888
Scheduler : posix
error: Disconnected from qemu:///system due to end of file
error: End of file while reading data: Input/output error


# virsh schedinfo avocado-vt-vm1 --set global_period=9999 --set global_quota=8888
Scheduler : posix
error: Disconnected from qemu:///system due to end of file
error: End of file while reading data: Input/output error


# virsh schedinfo avocado-vt-vm1 --set iothread_period=2000 --set iothread_quota=2000
Scheduler : posix
error: Disconnected from qemu:///system due to end of file
error: End of file while reading data: Input/output error

Comment 1 Pavel Hrdina 2019-08-30 14:33:36 UTC
Upstream commit:

commit 9a99b01f8d3b2be491f9f8412c6f894d30d7e2fe
Author: Pavel Hrdina <phrdina>
Date:   Fri Aug 30 16:15:15 2019 +0200

    vircgroupv2: fix abort in VIR_AUTOFREE

Comment 4 yisun 2019-09-05 11:30:21 UTC
no crash happened with libvirt-5.6.0-4.virtcov.el8.x86_64

Comment 6 errata-xmlrpc 2019-11-06 07:19:01 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.

https://access.redhat.com/errata/RHBA-2019:3723


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