Bug 1529053 - Miss the handling of EINTR in the fcntl calls made by QEMU
Summary: Miss the handling of EINTR in the fcntl calls made by QEMU
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.5
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: ---
Assignee: Fam Zheng
QA Contact: Ping Li
URL:
Whiteboard:
Depends On:
Blocks: 1525303
TreeView+ depends on / blocked
 
Reported: 2017-12-26 07:21 UTC by Ping Li
Modified: 2018-04-11 00:57 UTC (History)
9 users (show)

Fixed In Version: qemu-kvm-rhev-2.10.0-19.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-11 00:55:27 UTC


Attachments (Terms of Use)
backtrace (7.36 KB, text/plain)
2017-12-26 07:21 UTC, Ping Li
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:1104 None None None 2018-04-11 00:57:52 UTC

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


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