Bug 1478636

Summary: Deadlock in define/undefine nwfilter
Product: [Community] Virtualization Tools Reporter: Sergey <s.o.butakov>
Component: libvirtAssignee: Pavel Hrdina <phrdina>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: libvirt-maint, phrdina, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-3.7.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-14 06:39:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Log file nwfilter-define
none
Core-dump nwfilter-define
none
thread apply all bt
none
Log file nwfilter-undefine
none
Core-dump nwfilter-undefine
none
nwfilter-undefine: thread apply all bt none

Description Sergey 2017-08-05 11:25:53 UTC
Run the command "virsh nwfilter-define filter.xml" and the nwfilter module hangs. Successfully completes the command "virsh list", but when executing "virsh nwfilter-list" no any response and the operation hangs. After restarting libvirtd run the command "virsh nwfilter-undefine filter.xml" again, no any response, the command is not completed.

In attachment there are files with the log files containing actions start libvirtd and execute nwfilter-define and nwfilter-undefine. In the log file "nwfilter-define" action begins on the line "2017-08-05 09:48:58.023+0000". For a quick search of actions to a log file "nwfilter-undefine" you can use the word "vm191586". There are also core-dump files for the commands nwfilter-define and nwfilter-undefine and files with the results of the command "thread apply all bt".


Compiled against library: libvirt 2.0.0
Using library: libvirt 2.0.0
Using API: QEMU 2.0.0
Running hypervisor: QEMU 1.5.3

CentOS Linux release 7.3.1611 (Core)

Comment 1 Sergey 2017-08-05 11:27:58 UTC
Created attachment 1309363 [details]
Log file nwfilter-define

Comment 2 Sergey 2017-08-05 11:29:45 UTC
Created attachment 1309364 [details]
Core-dump nwfilter-define

Comment 3 Sergey 2017-08-05 11:31:55 UTC
Created attachment 1309367 [details]
thread apply all bt

Comment 4 Sergey 2017-08-05 11:35:19 UTC
Created attachment 1309378 [details]
Log file nwfilter-undefine

Comment 5 Sergey 2017-08-05 11:37:14 UTC
Created attachment 1309379 [details]
Core-dump nwfilter-undefine

Comment 6 Sergey 2017-08-05 11:39:23 UTC
Created attachment 1309380 [details]
nwfilter-undefine: thread apply all bt

Comment 7 Sergey 2017-08-05 11:47:50 UTC
*** Bug 1441687 has been marked as a duplicate of this bug. ***

Comment 8 Pavel Hrdina 2017-08-14 16:25:38 UTC
Hi, thanks for the report.  I've reviewed upstream code and posted a patches to upstream list [1] and they are already pushed into the upstream repository.  I'm not sure whether it actually fixes this issue, because I was not able to reproduce it.

Can you please provide exact steps how to reproduce this bug, possible for a clean install of the whole system?

If you are not able to provide simple steps to reproduce the issue, you can get a copy of upstream libvirt:

  "git clone git://libvirt.org/libvirt.git"

enter the libvirt directory and follow theste steps to create RPMs:

1. run autogen to generate required files:

  "./autogen.sh"

2. install all build dependencies for libvirt (you need to install yum-utils):

  "yum-builddeb ./libvirt.spec

3. make RPMs (you need to install rpm-build):

  "make rpm"

The RPM files will be located at "~/rpmbuild/RPMS/x86_64/" directory.

Pavel

[1] <https://www.redhat.com/archives/libvir-list/2017-August/msg00228.html>

Comment 9 Sergey 2017-09-14 04:16:13 UTC
Thanks! It works.

Comment 10 Pavel Hrdina 2017-09-14 06:39:18 UTC
Upstream commits:

commit 231c7104601e48cb37d4ec2f6ca6c9cc8ddd6503
Author: Pavel Hrdina <phrdina>
Date:   Mon Aug 7 14:41:43 2017 +0200

    qemu: fix nwfilter deadlock while reverting to snapshot

commit 40cc355c9223e17b54b66fdaedd93e9f6c669704
Author: Pavel Hrdina <phrdina>
Date:   Mon Aug 7 14:42:58 2017 +0200

    qemu: fix nwfilter deadlock in qemuProcessReconnect