<div dir="ltr"><div>I find the issue cannot reproduced when `make clean` before build the source.</div><div>It is not proper to build with an unclean source dir, right?<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 15, 2019 at 3:55 AM Cole Robinson <<a href="mailto:crobinso@redhat.com" target="_blank">crobinso@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 10/12/19 11:07 AM, Han Han wrote:<br>
> <br>
> <br>
> On Sat, Oct 12, 2019 at 1:05 AM Cole Robinson <<a href="mailto:crobinso@redhat.com" target="_blank">crobinso@redhat.com</a><br>
> <mailto:<a href="mailto:crobinso@redhat.com" target="_blank">crobinso@redhat.com</a>>> wrote:<br>
> <br>
>     On 10/10/19 11:25 PM, Han Han wrote:<br>
>     > Hi Cole,<br>
>     > I merged crobinso/qcow2-data_file branch to 37b565c00. Reserved new<br>
>     > capabilities introduced by these to branches to resolve conflicts.<br>
>     > Then build and test as following:<br>
>     > # ./autogen.sh&& ./configure --without-libssh<br>
>     > --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu<br>
>     > --program-prefix= --disable-dependency-tracking --prefix=/usr<br>
>     > --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin<br>
>     > --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include<br>
>     > --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var<br>
>     > --sharedstatedir=/var/lib --mandir=/usr/share/man<br>
>     > --infodir=/usr/share/info --with-qemu --without-openvz --without-lxc<br>
>     > --without-vbox --without-libxl --with-sasl --with-polkit<br>
>     --with-libvirtd<br>
>     > --without-phyp --with-esx --without-hyperv --without-vmware<br>
>     > --without-xenapi --without-vz --without-bhyve --with-interface<br>
>     > --with-network --with-storage-fs --with-storage-lvm<br>
>     --with-storage-iscsi<br>
>     > --with-storage-iscsi-direct --with-storage-scsi --with-storage-disk<br>
>     > --with-storage-mpath --with-storage-rbd --without-storage-sheepdog<br>
>     > --with-storage-gluster --without-storage-zfs<br>
>     --without-storage-vstorage<br>
>     > --with-numactl --with-numad --with-capng --without-fuse --with-netcf<br>
>     > --with-selinux --with-selinux-mount=/sys/fs/selinux<br>
>     --without-apparmor<br>
>     > --without-hal --with-udev --with-yajl --with-sanlock --with-libpcap<br>
>     > --with-macvtap --with-audit --with-dtrace --with-driver-modules<br>
>     > --with-firewalld --with-firewalld-zone --without-wireshark-dissector<br>
>     > --without-pm-utils --with-nss-plugin '--with-packager=Unknown,<br>
>     > 2019-08-19-12:13:01, <a href="http://lab.rhel8.me" rel="noreferrer" target="_blank">lab.rhel8.me</a> <<a href="http://lab.rhel8.me" rel="noreferrer" target="_blank">http://lab.rhel8.me</a>><br>
>     <<a href="http://lab.rhel8.me" rel="noreferrer" target="_blank">http://lab.rhel8.me</a>>'<br>
>     > --with-packager-version=1.el8 --with-qemu-user=qemu<br>
>     > --with-qemu-group=qemu --with-tls-priority=@LIBVIRT,SYSTEM<br>
>     > --enable-werror --enable-expensive-tests --with-init-script=systemd<br>
>     > --without-login-shell && make<br>
>     ><br>
>     > Start libvirtd and virtlogd<br>
>     > # LD_PRELOAD="$(find src -name '*.so.*'|tr '\n' ' ')"<br>
>     src/.libs/libvirtd<br>
>     > # LD_PRELOAD="$(find src -name '*.so.*'|tr '\n' ' ')" ./src/virtlogd<br>
>     ><br>
>     > Then try to list all domains:<br>
>     > # virsh list --all<br>
>     ><br>
>     > Libvirtd exits with segment fault:<br>
>     > [1]    30104 segmentation fault (core dumped)  LD_PRELOAD="$(find src<br>
>     > -name '*.so.*'|tr '\n' ' ')" src/.libs/libvirtd<br>
>     ><br>
>     > Version:<br>
>     > qemu-4.1<br>
>     ><br>
>     > Backtrace:<br>
>     > (gdb) bt<br>
>     > #0  0x00007fbe57a0d1b9 in virDomainVirtioSerialAddrSetAddControllers<br>
>     > (def=<optimized out>, def=<optimized out>, addrs=<optimized out>) at<br>
>     > conf/domain_addr.c:1656<br>
>     > #1  virDomainVirtioSerialAddrSetCreateFromDomain<br>
>     > (def=def@entry=0x7fbde81cc3f0) at conf/domain_addr.c:1753<br>
>     > #2  0x00007fbe0179897e in qemuDomainAssignVirtioSerialAddresses<br>
>     > (def=0x7fbde81cc3f0) at qemu/qemu_domain_address.c:3174<br>
>     > #3  qemuDomainAssignAddresses (def=0x7fbde81cc3f0,<br>
>     > qemuCaps=0x7fbde81d2210, driver=0x7fbde8126850, obj=0x0,<br>
>     > newDomain=<optimized out>) at qemu/qemu_domain_address.c:3174<br>
>     > #4  0x00007fbe57a39e0d in virDomainDefPostParse<br>
>     > (def=def@entry=0x7fbde81cc3f0, caps=caps@entry=0x7fbde8154d20,<br>
>     > parseFlags=parseFlags@entry=4610, xmlopt=xmlopt@entry=0x7fbde83ce070,<br>
>     >      parseOpaque=parseOpaque@entry=0x0) at conf/domain_conf.c:5858<br>
>     > #5  0x00007fbe57a525c5 in virDomainDefParseNode (xml=<optimized out>,<br>
>     > root=0x7fbde83c5ff0, caps=0x7fbde8154d20, xmlopt=0x7fbde83ce070,<br>
>     > parseOpaque=0x0, flags=4610) at conf/domain_conf.c:21677<br>
>     > #6  0x00007fbe57a526c8 in virDomainDefParse (xmlStr=xmlStr@entry=0x0,<br>
>     > filename=<optimized out>, caps=caps@entry=0x7fbde8154d20,<br>
>     > xmlopt=xmlopt@entry=0x7fbde83ce070, parseOpaque=parseOpaque@entry=0x0,<br>
>     >      flags=flags@entry=4610) at conf/domain_conf.c:21628<br>
>     > #7  0x00007fbe57a528f6 in virDomainDefParseFile (filename=<optimized<br>
>     > out>, caps=caps@entry=0x7fbde8154d20,<br>
>     > xmlopt=xmlopt@entry=0x7fbde83ce070,<br>
>     parseOpaque=parseOpaque@entry=0x0,<br>
>     > flags=flags@entry=4610)<br>
>     >      at conf/domain_conf.c:21653<br>
>     > #8  0x00007fbe57a5e16a in virDomainObjListLoadConfig (opaque=0x0,<br>
>     > notify=0x0, name=0x7fbde81d7ff3 "pc", autostartDir=0x7fbde8124070<br>
>     > "/etc/libvirt/qemu/autostart", configDir=0x7fbde8124050<br>
>     > "/etc/libvirt/qemu",<br>
>     >      xmlopt=0x7fbde83ce070, caps=0x7fbde8154d20,<br>
>     doms=0x7fbde8126940) at<br>
>     > conf/virdomainobjlist.c:503<br>
>     > #9  virDomainObjListLoadAllConfigs (doms=0x7fbde8126940,<br>
>     > configDir=0x7fbde8124050 "/etc/libvirt/qemu",<br>
>     > autostartDir=0x7fbde8124070 "/etc/libvirt/qemu/autostart",<br>
>     > liveStatus=liveStatus@entry=false,<br>
>     >      caps=0x7fbde8154d20, xmlopt=0x7fbde83ce070, notify=0x0,<br>
>     opaque=0x0)<br>
>     > at conf/virdomainobjlist.c:625<br>
>     > #10 0x00007fbe017f57e2 in qemuStateInitialize (privileged=true,<br>
>     > callback=<optimized out>, opaque=<optimized out>) at<br>
>     > qemu/qemu_driver.c:1007<br>
>     > #11 0x00007fbe57b8033d in virStateInitialize (privileged=true,<br>
>     > mandatory=mandatory@entry=false,<br>
>     callback=callback@entry=0x55dfb702ecc0<br>
>     > <daemonInhibitCallback>, opaque=opaque@entry=0x55dfb8869d60)<br>
>     >      at libvirt.c:666<br>
>     > #12 0x000055dfb702ed1d in daemonRunStateInit<br>
>     (opaque=0x55dfb8869d60) at<br>
>     > remote/remote_daemon.c:846<br>
>     > #13 0x00007fbe579f4be2 in virThreadHelper (data=<optimized out>) at<br>
>     > util/virthread.c:196<br>
>     > #14 0x00007fbe55a322de in start_thread (arg=<optimized out>) at<br>
>     > pthread_create.c:486<br>
>     > #15 0x00007fbe55763133 in clone () at<br>
>     > ../sysdeps/unix/sysv/linux/x86_64/clone.S:95<br>
>     ><br>
>     > Could you please check this issue?<br>
>     > The full threads backtrace is in attachment<br>
>     ><br>
> <br>
> Hello, the git bisect shows that is the first bad commit:<br>
> 192229f3a76ccc1b98a2c9e24f1feb0465b87a0b is the first bad commit<br>
> commit 192229f3a76ccc1b98a2c9e24f1feb0465b87a0b<br>
> Author: Cole Robinson <<a href="mailto:crobinso@redhat.com" target="_blank">crobinso@redhat.com</a> <mailto:<a href="mailto:crobinso@redhat.com" target="_blank">crobinso@redhat.com</a>>><br>
> Date:   Fri Oct 4 19:57:55 2019 -0400<br>
> <br>
>     storagefile: Push extension_end calc to qcow2GetBackingStoreFormat<br>
> <br>
>     This is a step towards making this qcow2GetBackingStoreFormat into<br>
>     a generic qcow2 extensions parser<br>
> <br>
>     Signed-off-by: Cole Robinson <<a href="mailto:crobinso@redhat.com" target="_blank">crobinso@redhat.com</a><br>
> <mailto:<a href="mailto:crobinso@redhat.com" target="_blank">crobinso@redhat.com</a>>><br>
> <br>
> <br>
> Steps:<br>
> 1. Merge crobinso/qcow2-data_file branch to 37b565c00.<br>
> 2. Copy .gdbinit to libvirt source dir. Change the arguments values of <br>
> check-segv.sh<br>
> 3. Set v5.8.0 as the start of bisect. Then start bisect.<br>
> # git bisect start HEAD v5.8.0<br>
> # git bisect run /tmp/check-segv.sh<br>
> <br>
<br>
I'm still quite confused. Maybe something I'm missing in one of these<br>
commits is causing memory corruption that is manifesting elsewhere?<br>
<br>
Can you provide full LIBVIRT_DEBUG=1 output when starting libvirtd? You<br>
can use git master now because the patches have been pushed. I suggest<br>
hosting the output somewhere rather than attaching it here, because it<br>
will probably be large<br>
<br>
Also, if you can pinpoint what VM XML that is being parsed when this<br>
crashes, and post that too, it might help.<br>
<br>
Thanks,<br>
Cole<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Best regards,</div><div dir="ltr">-----------------------------------<br></div><div dir="ltr">Han Han<br>Quality Engineer<br>Redhat.<br><br>Email: <a href="mailto:hhan@redhat.com" target="_blank">hhan@redhat.com</a><br>Phone: +861065339333<br></div></div></div></div></div></div></div>