Received: from eggs.gnu.org ([2001:4830:134:3::10]:37345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bzn-0003sJ-Ag for qemu-devel@nongnu.org; Thu, 17 Dec 2015 12:05:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9bzj-0003iI-5B for qemu-devel@nongnu.org; Thu, 17 Dec 2015 12:05:39 -0500 Received: from indium.canonical.com ([91.189.90.7]:48282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bzi-0003hl-Oo for qemu-devel@nongnu.org; Thu, 17 Dec 2015 12:05:35 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1a9bzi-000752-7i for ; Thu, 17 Dec 2015 17:05:34 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 346FD2E8030 for ; Thu, 17 Dec 2015 17:05:34 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Thu, 17 Dec 2015 17:00:23 -0000 From: Octoploid <1527322@bugs.launchpad.net> Sender: bounces@canonical.com References: <20151217163255.25580.65309.malonedeb@soybean.canonical.com> Message-Id: <20151217170023.25665.3288.malone@gac.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1527322] Re: undefined behavior issues Reply-To: Bug 1527322 <1527322@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Program received signal SIGSEGV, Segmentation fault. thread_pool_submit_aio (pool=3D0x0, func=3D0x555555820bc0 , arg=3D0x5555579db430, cb=3D, opaque=3D) at /var/tmp/portage/app-emulation/qemu-2.5.0/work/qemu-2.5.0/thread-poo= l.c:246 246 QLIST_INSERT_HEAD(&pool->head, req, all); (gdb) bt #0 thread_pool_submit_aio (pool=3D0x0, func=3D0x555555820bc0 , arg=3D0x5555579db430, cb=3D, opaque=3D) at /var/tmp/portage/app-emulation/qemu-2.5.0/work/qemu-2.5.0/thread-poo= l.c:246 #1 0x00005555559451cd in aio_bh_call (bh=3D) at /var/tmp/po= rtage/app-emulation/qemu-2.5.0/work/qemu-2.5.0/async.c:64 #2 aio_bh_poll (ctx=3Dctx@entry=3D0x5555561c1da0) at /var/tmp/portage/app-= emulation/qemu-2.5.0/work/qemu-2.5.0/async.c:92 #3 0x00005555559524f0 in aio_dispatch (ctx=3D0x5555561c1da0) at /var/tmp/p= ortage/app-emulation/qemu-2.5.0/work/qemu-2.5.0/aio-posix.c:305 #4 0x0000555555944f4e in aio_ctx_dispatch (source=3D, callb= ack=3D, user_data=3D) at /var/tmp/portage/app-emulation/qemu-2.5.0/work/qemu-2.5.0/async.c:231 #5 0x00007ffff726ce2e in g_main_context_dispatch () from /usr/lib/libglib-= 2.0.so.0 #6 0x0000555555950baa in glib_pollfds_poll () at /var/tmp/portage/app-emul= ation/qemu-2.5.0/work/qemu-2.5.0/main-loop.c:211 #7 os_host_main_loop_wait (timeout=3D) at /var/tmp/portage/= app-emulation/qemu-2.5.0/work/qemu-2.5.0/main-loop.c:256 #8 main_loop_wait (nonblocking=3D) at /var/tmp/portage/app-= emulation/qemu-2.5.0/work/qemu-2.5.0/main-loop.c:504 #9 0x00005555556ddf46 in main_loop () at /var/tmp/portage/app-emulation/qe= mu-2.5.0/work/qemu-2.5.0/vl.c:1923 #10 main (argc=3D, argv=3D, envp=3D) at /var/tmp/portage/app-emulation/qemu-2.5.0/work/qemu-2.5.0/vl.c:46= 84 (gdb) p pool $1 =3D (ThreadPool *) 0x0 -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1527322 Title: undefined behavior issues Status in QEMU: New Bug description: Building qemu-2.5.0 with -fsanitize=3Dundefined shows, e.g.: markus@x4 linux % qemu-system-x86_64 -s -enable-kvm -net nic,vlan=3D0,mod= el=3Dvirtio -net user -fsdev local,security_model=3Dnone,id=3Droot,path=3D/= -device virtio-9p-pci,id=3Droot,fsdev =3Droot,mount_tag=3D/dev/root -m 512 -smp 2 -kernel /usr/src/linux/arch/x= 86/boot/bzImage -nographic -append "init=3D/bin/zsh root=3D/dev/root consol= e=3DttyS0 kgdboc=3DttyS0 rootflags=3Drw, trans=3Dvirtio rootfstype=3D9p ip=3Ddhcp earlyprintk=3DttyS0" /var/tmp/portage/app-emulation/qemu-2.5.0/work/qemu-2.5.0/exec.c:307:5: r= untime error: variable length array bound evaluates to non-positive value 0 /var/tmp/portage/app-emulation/qemu-2.5.0/work/qemu-2.5.0/hw/i386/kvm/api= c.c:37:47: runtime error: left shift of 15 by 28 places cannot be represent= ed in type 'int' /var/tmp/portage/app-emulation/qemu-2.5.0/work/qemu-2.5.0/include/qemu/rc= u.h:85:21: runtime error: member access within null pointer of type 'struct= rcu_reader_data' /var/tmp/portage/app-emulation/qemu-2.5.0/work/qemu-2.5.0/include/qemu/rc= u.h:101:5: runtime error: member access within null pointer of type 'struct= rcu_reader_data' /var/tmp/portage/app-emulation/qemu-2.5.0/work/qemu-2.5.0/include/qemu/rc= u.h:102:8: runtime error: member access within null pointer of type 'struct= rcu_reader_data' ... ALSA device list: No soundcards found. /var/tmp/portage/app-emulation/qemu-2.5.0/work/qemu-2.5.0/thread-pool.c:2= 46:5: runtime error: member access within null pointer of type 'struct Thre= adPool' [1] 9295 segmentation fault qemu-system-x86_64 -s -enable-kvm -net ni= c,vlan=3D0,model=3Dvirtio -net user = As you can see it segfaults when build with upcoming gcc-6, that is more = aggressive when it comes to undefined behavior. The compiler just assumes that "this" can never be NULL and optimizes acc= ordingly. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1527322/+subscriptions