Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1481701

Summary: qemu-kvm crash - possible cause - Assertion `!(s->lsr & 0x40)' failed.
Product: Red Hat Enterprise Linux 7 Reporter: Robin Cernin <rcernin>
Component: qemu-kvm-rhevAssignee: John Ferlan <jferlan>
Status: CLOSED CURRENTRELEASE QA Contact: Qianqian Zhu <qizhu>
Severity: medium Docs Contact:
Priority: high    
Version: 7.3CC: adevolder, agurenko, chayang, chhudson, coli, cww, gr, hhuang, jbiao, jferlan, juzhang, knoel, mircea.vutcovici, mkalinin, mtessun, mzheng, nitebans, pbonzini, qizhu, qzhang, rcernin, takirby, virt-maint, xfu, yafu
Target Milestone: rcKeywords: TestOnly, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1640593 (view as bug list) Environment:
Last Closed: 2020-04-09 12:05:28 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: 1477664, 1640593    

Description Robin Cernin 2017-08-15 13:43:35 UTC
Description of problem:

Instance is powered off as qemu-kvm crashed, in qemu logs it has previously displayed the serial_xmit: Assertion failed.

char device redirected to /dev/pts/5 (label charserial1)
warning: host doesn't support requested feature: CPUID.01H:EDX.ds [bit 21]
warning: host doesn't support requested feature: CPUID.01H:EDX.acpi [bit 22]
warning: host doesn't support requested feature: CPUID.01H:EDX.ht [bit 28]
warning: host doesn't support requested feature: CPUID.01H:EDX.tm [bit 29]
warning: host doesn't support requested feature: CPUID.01H:EDX.pbe [bit 31]
warning: host doesn't support requested feature: CPUID.01H:ECX.dtes64 [bit 2]
warning: host doesn't support requested feature: CPUID.01H:ECX.monitor [bit 3]
warning: host doesn't support requested feature: CPUID.01H:ECX.ds_cpl [bit 4]
warning: host doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]
warning: host doesn't support requested feature: CPUID.01H:ECX.smx [bit 6]
warning: host doesn't support requested feature: CPUID.01H:ECX.est [bit 7]
warning: host doesn't support requested feature: CPUID.01H:ECX.tm2 [bit 8]
warning: host doesn't support requested feature: CPUID.01H:ECX.xtpr [bit 14]
warning: host doesn't support requested feature: CPUID.01H:ECX.pdcm [bit 15]
warning: host doesn't support requested feature: CPUID.01H:ECX.dca [bit 18]
warning: host doesn't support requested feature: CPUID.01H:ECX.osxsave [bit 27]
qemu-kvm: hw/char/serial.c:232: serial_xmit: Assertion `!(s->lsr & 0x40)' failed.
2017-07-30 20:45:51.628+0000: shutting down


Version-Release number of selected component (if applicable):

ipxe-roms-qemu-20160127-5.git6366fa7a.el7.noarch            Tue Nov 29 02:23:11 2016
libvirt-daemon-driver-qemu-2.0.0-10.el7_3.9.x86_64          Wed Jul 19 20:44:33 2017
qemu-img-rhev-2.6.0-28.el7_3.9.x86_64                       Wed Jul 19 20:44:32 2017
qemu-kvm-common-rhev-2.6.0-28.el7_3.9.x86_64                Wed Jul 19 20:44:18 2017
qemu-kvm-rhev-2.6.0-28.el7_3.9.x86_64                       Wed Jul 19 20:44:33 2017

How reproducible:

Not reproducible, appears occasionally.

Steps to Reproduce:
1.
2.
3.

Actual results:

The instance crashed, no core dump created.

Expected results:


Additional info:

Comment 4 juzhang 2017-08-16 01:53:00 UTC
> 
> ipxe-roms-qemu-20160127-5.git6366fa7a.el7.noarch            Tue Nov 29
> 02:23:11 2016
> libvirt-daemon-driver-qemu-2.0.0-10.el7_3.9.x86_64          Wed Jul 19
> 20:44:33 2017
> qemu-img-rhev-2.6.0-28.el7_3.9.x86_64                       Wed Jul 19
> 20:44:32 2017
> qemu-kvm-common-rhev-2.6.0-28.el7_3.9.x86_64                Wed Jul 19
> 20:44:18 2017
> qemu-kvm-rhev-2.6.0-28.el7_3.9.x86_64                       Wed Jul 19
Update the component to qemu-kvm-rhev according to above log.

Comment 11 Qianqian Zhu 2018-05-11 01:44:27 UTC
Hi Pankaj,

QE have never hit this issue before with our test cases, and I can't figure out the reproduce steps from comment 0 and comment 9, which do not clearly show the scenario before the crash. This is no even qemu command line or virsh xml provided. It is really hard for QE to reproduce it. 

The only valuable information I can see is the assertion:
qemu-kvm: hw/char/serial.c:232: serial_xmit: Assertion `!(s->lsr & 0x40)' failed.

Is that possible by reviewing the code of hw/char/serial.c to find out the possible path to trigger the issue?

Thanks,
Qianqian

Comment 12 Qianqian Zhu 2018-05-11 03:01:38 UTC
Hi Gyanendra Kumar,

Would you help provide the qemu commmand line or virsh xml of the guest, and any application running or stress load on guest? And are there any other actions like reboot, snapshot or migration?

Thanks,
Qianqian

Comment 13 Qianqian Zhu 2018-05-11 03:28:01 UTC
(In reply to Qianqian Zhu from comment #12)
> Hi Gyanendra Kumar,
> 
> Would you help provide the qemu commmand line or virsh xml of the guest, and
> any application running or stress load on guest? And are there any other
> actions like reboot, snapshot or migration?
> 
> Thanks,
> Qianqian

Sorry, I just found the qemu command line and some guest actions in the sosreport. I will try to reproduce it. Thanks.

Comment 15 Qianqian Zhu 2018-06-05 07:02:36 UTC
QE can not reproduce it so far, by trying below scenarios:

1. On rhel7.3 host, boot up 5 rhel7.3 guests at the same time. 2 guests running on remote rbd storage, and 3 guests running on local image.
2. Keep them running for 20 days, continuously loading each guest with netperf and fio.
3. Guest's configuration for char device:
    <serial type='file'>
      <source path='/var/lib/libvirt/95aa309e-d4f9-4967-b5cb-d5d67aa6335d/console.log'/>
      <target port='1'/>
      <alias name='serial0'/>
    </serial>
    <serial type='pty'>
      <source path='/dev/pts/5'/>
      <target port='2'/>
      <alias name='serial1'/>
    </serial>
    <console type='file'>
      <source path='/var/lib/libvirt/95aa309e-d4f9-4967-b5cb-d5d67aa6335d/console.log'/>
      <target type='serial' port='1'/>
      <alias name='serial0'/>
    </console>

qemu command line:
/usr/libexec/qemu-kvm \
-name guest=instance-00000191,debug-threads=on \
-S \
-object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-1-instance-00000191/master-key.aes \
-machine pc-i440fx-rhel7.4.0,accel=kvm,usb=off,dump-guest-core=off \
-cpu SandyBridge,vme=on,ss=on,pcid=on,hypervisor=on,arat=on,tsc_adjust=on,pdpe1gb=on,xsave=off,avx=off \
-m 8192 -realtime mlock=off \
-smp 8,sockets=8,cores=1,threads=1 \
-uuid 95aa309e-d4f9-4967-b5cb-d5d67aa6335d \
-smbios type=1,manufacturer=Red Hat,product=OpenStack Nova,version=13.1.1-7.el7ost,serial=6d20bf45-0918-413b-b4bf-dcc702889837,uuid=95aa309e-d4f9-4967-b5cb-d5d67aa6335d,family=Virtual Machine \
-no-user-config \
-nodefaults \
-chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-1-instance-00000191/monitor.sock,server,nowait \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=utc,driftfix=slew \
-global kvm-pit.lost_tick_policy=delay \
-no-hpet \
-no-shutdown \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
-object secret,id=virtio-disk0-secret0,data=VwmHY95rvwrjGG/R/NeLGD+SMxn2TA23xNy8cGFFVyo=,keyid=masterKey0,iv=6CNUM2pL3uqMD0kKUNEGuQ==,format=base64 \
-drive file=rbd:libvirt-pool/vol2:id=libvirt:auth_supported=cephx\;none:mon_host=x.x.x.x,file.password-secret=virtio-disk0-secret0,format=raw,if=none,id=drive-virtio-disk0,cache=writeback,discard=unmap -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
-object secret,id=virtio-disk1-secret0,data=1Q/qBPk1f4hf59M1ZmIKgfpcLBNBV2lM9HbYMlMGcks=,keyid=masterKey0,iv=0nmgrk9+Y2J0NDrpp1oGyA==,format=base64 \
-drive file=rbd:libvirt-pool/vol1:id=libvirt:auth_supported=cephx\;none:mon_host=x.x.x.x,file.password-secret=virtio-disk1-secret0,format=raw,if=none,id=drive-virtio-disk1,cache=writeback \
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1 -netdev tap,fd=25,id=hostnet0,vhost=on,vhostfd=27 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=fa:16:3e:2c:3f:66,bus=pci.0,addr=0x3 -netdev tap,fd=28,id=hostnet1,vhost=on,vhostfd=29 \
-device virtio-net-pci,netdev=hostnet1,id=net1,mac=fa:16:3e:e0:c3:c2,bus=pci.0,addr=0x4 \
-add-fd set=4,fd=31 \
-chardev file,id=charserial0,path=/dev/fdset/4,append=on \
-device isa-serial,chardev=charserial0,id=serial0 \
-chardev pty,id=charserial1 \
-device isa-serial,chardev=charserial1,id=serial1 \
-device usb-tablet,id=input0,bus=usb.0,port=1 \
-vnc 0.0.0.0:0 \
-k en-us \
-device cirrus-vga,id=video0,bus=pci.0,addr=0x2 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 \
-msg timestamp=on

Comment 21 pagupta 2018-09-05 11:46:36 UTC
Hi,

Below recent commits in >= qemu-kvm-rhev-2.12.0-8.el7 releases. Both these commits fix potential issues with UART serial code emulation. As we don't have
exact reproduction steps from any of the attached cases and we need help from Customer/GSS to confirm if above mentioned qemu-kvm-rhev solves the problem?

1] d357e5f3a56416c6f5a7a9308b8c30f825d89cfa
2] a7a6995e2a24e9e4c89084acf3241e5640f30f3e

More Details:
----------------
Code inspection tells both commit 1] & commit 2] fixes a condition when retry logic does not execute in case of data transmit failure or connection hungup.

- If 's->lsr & UART_LSR_THRE' is set for either FIFO mode(no data to transmit)     
  or regular byte transfer mode.

- If data transfer(qemu_chr_fe_write) fails due to some reason. It does not  
  execute retry logic.   

- This results to exit main 'while loop' as UART_LSR_THRE is set.
  "(while (!(s->lsr &  UART_LSR_THRE));)" 

- This sets Line state register as transmitter empty.
      s->lsr |= UART_LSR_TEMT;

- If any of callback is still active, there is possibility of asserting on                    "assert(!(s->lsr & UART_LSR_TEMT));"

Based on above justification (only by code inspection), I feel we can ask Customer to test qemu-kvm-rhev-2.12 and based on results can back-port these commits in older versions if required.

Also, it would be good if we get some steps to reproduce issue locally to confirm the analysis. 

Thanks,
Pankaj

Comment 32 Qianqian Zhu 2018-09-26 10:11:16 UTC
Moving to verified per above comments.

Comment 35 Nitesh 2018-10-08 16:33:28 UTC
Hi Redhat Team,

We are in a process of upgrading the RHEL 7.3 to 7.5. But we see that 'qemu-kvm-rhev-2.12.0-8.el7' is not available in the 7.5 release but a lower version. What may be the solution to have the fix for this in RHEL 7.5.
Thanks
Nitesh

Comment 37 Martin Tessun 2018-10-18 09:26:53 UTC
Hi Nitesh,

(In reply to Nitesh from comment #35)
> Hi Redhat Team,
> 
> We are in a process of upgrading the RHEL 7.3 to 7.5. But we see that
> 'qemu-kvm-rhev-2.12.0-8.el7' is not available in the 7.5 release but a lower
> version. What may be the solution to have the fix for this in RHEL 7.5.
> Thanks
> Nitesh

We will be working on a backport to RHEL 7.5.z as well for this one. Once the clone is made, you can follow the progress in the cloned BZ for RHEL 7.5.z

Comment 45 Nitesh 2019-04-09 20:33:21 UTC
Hi,

I can see the clone , but there is no progress on the clone.

Thanks
Nitesh