Skip to contentSkip to conversation

stable-4.4: xen/tools/blktap2/drivers/block-qcow.c build errors

BUG Leonardo Taccari 3 participants 4 messages Jun 30, 2014 – Jul 2, 2014

lore
Share & tools
lore
#0 lore raw

Hello to the entire Xen community,
trying to build Xen ARM on Debian GNU/Linux armhf testing gives the following errors (doing a "./configure && make dist-tools"):

[...]
gcc -O1 -fno-omit-frame-pointer -marm -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -
Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -D__XEN_TOOLS_
_ -MMD -MF .block-qcow.o.d -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fno-opti mize-sibling-calls -Werror -g -Wno-unused -fno-strict-aliasing -I../include -I../drivers -I/root/xen /tools/blktap2/drivers/../../../tools/libxc -I/root/xen/tools/blktap2/drivers/../../../tools/include -D_GNU_SOURCE -DUSE_NFS_LOCKS -c -o block-qcow.o block-qcow.c
block-qcow.c: In function 'get_cluster_offset':
block-qcow.c:431:3: error: 'tmp_ptr' may be used uninitialized in this function [-Werror=maybe-uninit ialized]
memcpy(tmp_ptr, l1_ptr, 4096);
^
block-qcow.c:606:7: error: 'tmp_ptr2' may be used uninitialized in this function [-Werror=maybe-unini tialized]

   if (write(s->fd, tmp_ptr2, 4096) != 4096) {
       ^

cc1: all warnings being treated as errors /root/xen/tools/blktap2/drivers/../../../tools/Rules.mk:89: recipe for target 'block-qcow.o' failed make[5]: *** [block-qcow.o] Error 1
make[5]: Leaving directory '/root/xen/tools/blktap2/drivers' /root/xen/tools/blktap2/../../tools/Rules.mk:105: recipe for target 'subdir-install-drivers' failed make[4]: *** [subdir-install-drivers] Error 2
make[4]: Leaving directory '/root/xen/tools/blktap2' /root/xen/tools/blktap2/../../tools/Rules.mk:100: recipe for target 'subdirs-install' failed make[3]: *** [subdirs-install] Error 2
make[3]: Leaving directory '/root/xen/tools/blktap2' /root/xen/tools/../tools/Rules.mk:105: recipe for target 'subdir-install-blktap2' failed make[2]: *** [subdir-install-blktap2] Error 2
make[2]: Leaving directory '/root/xen/tools'
/root/xen/tools/../tools/Rules.mk:100: recipe for target 'subdirs-install' failed make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory '/root/xen/tools'
Makefile:96: recipe for target 'install-tools' failed
make: *** [install-tools] Error 2
[...]

Unfortunately I'm not an expert C programmer but after reading posix_memalign(3) it seems that the compiler warning is right. Removing -Werror on the affected file fix this issue but it's just a workaround.

For more information about the compiler:

$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 4.9.0-7' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/ja
 va-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.0 (Debian 4.9.0-7) 

If you need more information about my environment don't hesitate to contact me!
I've succesfully built the stable-4.4 branch about one month ago and succesfully run it on a cubieboard2.

Thanks for your consideration,
Ciao,
L.

#1 lore raw
Quoted 14 lines · Leonardo Taccari

Hello to the entire Xen community,
trying to build Xen ARM on Debian GNU/Linux armhf testing gives the following errors (doing a "./configure && make dist-tools"):

[...]
gcc -O1 -fno-omit-frame-pointer -marm -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -
Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -D__XEN_TOOLS_
_ -MMD -MF .block-qcow.o.d -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fno-opti mize-sibling-calls -Werror -g -Wno-unused -fno-strict-aliasing -I../include -I../drivers -I/root/xen /tools/blktap2/drivers/../../../tools/libxc -I/root/xen/tools/blktap2/drivers/../../../tools/include -D_GNU_SOURCE -DUSE_NFS_LOCKS -c -o block-qcow.o block-qcow.c
block-qcow.c: In function 'get_cluster_offset':
block-qcow.c:431:3: error: 'tmp_ptr' may be used uninitialized in this function [-Werror=maybe-uninit ialized]

Quoted 6 lines
   memcpy(tmp_ptr, l1_ptr, 4096);
   ^
block-qcow.c:606:7: error: 'tmp_ptr2' may be used uninitialized in this function [-Werror=maybe-unini
tialized]
   if (write(s->fd, tmp_ptr2, 4096) != 4096) {
       ^

Thanks for the report.

This was fixed in master with
commit 345e44a85d71a1a910385f33c7f1ba3683026d18

Author: Dario Faggioli <[email protected]>
Date:   Fri Jun 20 16:09:00 2014 +0200

blktap2: Fix two 'maybe uninitialized' variables

I think this should already be on Ian's list for eventual backport to 4.4, but I've copied him to make sure.

Ian.

#2 lore raw

Ian Campbell writes ("Re: [Xen-devel] [BUG] stable-4.4: xen/tools/blktap2/drivers/block-qcow.c build errors"):

Quoted 9 lines

This was fixed in master with
commit 345e44a85d71a1a910385f33c7f1ba3683026d18

Author: Dario Faggioli <[email protected]>
Date:   Fri Jun 20 16:09:00 2014 +0200

blktap2: Fix two 'maybe uninitialized' variables

I think this should already be on Ian's list for eventual backport to 4.4, but I've copied him to make sure.

It is indeed.

Thanks,
Ian.

#3 lore raw

Hello,

Quoted 6 lines · Ian Jackson

Ian Campbell writes ("Re: [Xen-devel] [BUG] stable-4.4: xen/tools/blktap2/drivers/block-qcow.c build errors"):

Quoted 5 lines

This was fixed in master with
commit 345e44a85d71a1a910385f33c7f1ba3683026d18

Author: Dario Faggioli <[email protected]>
Date:   Fri Jun 20 16:09:00 2014 +0200
Quoted 6 lines
Quoted 4 lines

blktap2: Fix two 'maybe uninitialized' variables

I think this should already be on Ian's list for eventual backport to 4.4, but I've copied him to make sure.

It is indeed.

I've compiled-tested it (manually applied the patch in 4.4) and I can confirm that now the errors are gone away.

Thank you and keep up the good work!
L.