Bug 1529053

Summary: Miss the handling of EINTR in the fcntl calls made by QEMU
Product: Red Hat Enterprise Linux 7 Reporter: Ping Li <pingl>
Component: qemu-kvm-rhevAssignee: Fam Zheng <famz>
Status: CLOSED ERRATA QA Contact: Ping Li <pingl>
Severity: medium Docs Contact:
Priority: high    
Version: 7.5CC: chayang, coli, famz, juzhang, lmiksik, michen, ngu, pingl, virt-maint
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.10.0-19.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-11 00:55:27 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:
Bug Depends On:    
Bug Blocks: 1525303    
Attachments:
Description Flags
backtrace none

Description Ping Li 2017-12-26 07:21:27 UTC
Created attachment 1372374 [details]
backtrace

Description of problem:
QEMU core dump when send the signal to show progress of converting the image from qcow2 to raw.

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.10.0-13.el7
kernel-3.10.0-823.el7.x86_64

How reproducible:
3/15

Steps to Reproduce:
1. Convert image from qcow2 to raw
for ((i=0; i<10; i++)); 
do     
    echo $i;
    nohup strace -f -e fcntl qemu-img convert -f qcow2 -O raw win2016.qcow2 win2016.raw;
    [ $? -eq 0 ] || break;
    mv nohup.out $i.out;
    rm -f win2016.raw;
done

2. Send the signal to show progress
while true; 
do     
    kill -SIGUSR1 `pidof qemu-img`;     
    sleep 20; 
done

Actual results:
qemu core dump

Expected results:
show progress without error

Additional info:
Strace log:
fcntl(3, F_GETFD)                       = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fcntl(4, F_GETFD)                       = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
fcntl(4, F_GETFL)                       = 0x2 (flags O_RDWR)
fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
fcntl(10, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=0, l_len=0, l_pid=0}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
fcntl(11, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1, l_pid=0}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=101, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=102, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=103, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=104, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=201, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=202, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=203, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=204, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=201, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=203, l_len=1}) = 0
fcntl(11, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1, l_pid=0}) = 0
fcntl(11, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=101, l_len=1, l_pid=0}) = 0
fcntl(11, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=103, l_len=1, l_pid=0}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=101, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=102, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=103, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=104, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=201, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=202, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=203, l_len=1}) = 0
fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=204, l_len=1}) = 0
strace: Process 5986 attached
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=201, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=203, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1, l_pid=0}) = 0
[pid  5984] fcntl(11, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=101, l_len=1, l_pid=0}) = 0
[pid  5984] fcntl(11, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=103, l_len=1, l_pid=0}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=101, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=102, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=103, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=104, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=201, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=202, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=203, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=204, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=201, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=203, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1, l_pid=0}) = 0
[pid  5984] fcntl(11, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=101, l_len=1, l_pid=0}) = 0
[pid  5984] fcntl(11, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=103, l_len=1, l_pid=0}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=101, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=102, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=103, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=104, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=201, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=202, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=203, l_len=1}) = 0
[pid  5984] fcntl(11, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=204, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1, l_pid=0}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=101, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=102, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=103, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=104, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=201, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=202, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=203, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=204, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1, l_pid=0}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=101, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=102, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=103, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=104, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=201, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=202, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=203, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=204, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=101, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=102, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=103, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=104, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=201, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=202, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=203, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=204, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=101, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1, l_pid=0}) = 0
[pid  5984] fcntl(13, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=201, l_len=1, l_pid=0}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=101, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=102, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=103, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=104, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=201, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=202, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=203, l_len=1}) = 0
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=204, l_len=1}) = 0
strace: Process 5987 attached
strace: Process 5988 attached
strace: Process 5989 attached
strace: Process 5990 attached
strace: Process 5991 attached
strace: Process 5992 attached
strace: Process 5993 attached
[pid  5984] --- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_USER, si_pid=32525, si_uid=0} ---
    (17.02/100%)
[pid  5984] --- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_USER, si_pid=32525, si_uid=0} ---
    (32.04/100%)
[pid  5984] --- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_USER, si_pid=32525, si_uid=0} ---
    (46.06/100%)
[pid  5984] --- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_USER, si_pid=32525, si_uid=0} ---
    (58.07/100%)
[pid  5984] --- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_USER, si_pid=32525, si_uid=0} ---
    (70.08/100%)
[pid  5984] --- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_USER, si_pid=32525, si_uid=0} ---
    (89.10/100%)
[pid  5984] fcntl(13, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1} <unfinished ...>
[pid  5992] +++ exited with 0 +++
[pid  5990] +++ exited with 0 +++
[pid  5987] +++ exited with 0 +++
[pid  5988] +++ exited with 0 +++
[pid  5991] +++ exited with 0 +++
[pid  5993] +++ exited with 0 +++
[pid  5986] +++ exited with 0 +++
[pid  5989] +++ exited with 0 +++
<... fcntl resumed> )                   = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_USER, si_pid=32525, si_uid=0} ---
Unexpected error in raw_apply_lock_bytes() at block/file-posix.c:642:
qemu-img: Failed to lock byte 100
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=5984, si_uid=0} ---
+++ killed by SIGABRT (core dumped) +++

Comment 3 Fam Zheng 2017-12-26 07:26:07 UTC
Upstream patch:

https://lists.gnu.org/archive/html/qemu-devel/2017-12/msg05093.html

Comment 8 Miroslav Rezanina 2018-02-02 12:40:25 UTC
Fix included in qemu-kvm-rhev-2.10.0-19.el7

Comment 12 errata-xmlrpc 2018-04-11 00:55:27 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/RHSA-2018:1104