[Debian-ha-maintainers] Bug#853652: Bug#853652: sbd: ftbfs with GCC-7

Valentin Vidic Valentin.Vidic at CARNet.hr
Sat Jun 24 11:53:24 UTC 2017


On Tue, Jan 31, 2017 at 09:35:47AM +0000, Matthias Klose wrote:
> gcc -DHAVE_CONFIG_H -I. -I..  -I/usr/include/pacemaker -I/usr/include/heartbeat -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wdate-time -D_FORTIFY_SOURCE=2 -Werror -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pacemaker -I/usr/include/libxml2  -D_GNU_SOURCE -DCHECK_AIS -DSBINDIR=\"/usr/sbin\" -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -I/usr/include/x86_64-linux-gnu/pacemaker -c -o sbd-inquisitor.o sbd-inquisitor.c
> sbd-inquisitor.c: In function 'inquisitor_child':
> sbd-inquisitor.c:330:30: error: '%*lu' directive output may be truncated writing between 10 and 20 bytes into a region of size 12 [-Werror=format-truncation=]
>   snprintf(buf, sizeof(buf), "%*lu\n", LOCKSTRLEN-1, mypid);
>                               ^~~~
> sbd-inquisitor.c:330:29: note: using the range [0, 18446744073709551615] for directive argument
>   snprintf(buf, sizeof(buf), "%*lu\n", LOCKSTRLEN-1, mypid);
>                              ^~~~~~~~
> In file included from /usr/include/stdio.h:938:0,
>                  from /usr/include/pacemaker/crm/services.h:33,
>                  from /usr/include/pacemaker/crm/lrmd.h:26,
>                  from /usr/include/pacemaker/crm/common/util.h:33,
>                  from sbd-inquisitor.c:19:
> /usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: format output between 12 and 22 bytes into a destination of size 12
>    return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
>           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>         __bos (__s), __fmt, __va_arg_pack ());
>         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hi Matthias,

Could not reproduce this error in sbd-inquisitor.c, can you please check?

$ gcc-7 -DHAVE_CONFIG_H -I. -I..  -I/usr/include/pacemaker -I/usr/include/heartbeat -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wdate-time -D_FORTIFY_SOURCE=2 -Werror -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pacemaker -I/usr/include/libxml2  -D_GNU_SOURCE -DCHECK_AIS -DSBINDIR=\"/usr/sbin\" -g -O2  -fstack-protector-strong -Wformat -Werror=format-security -I/usr/include/x86_64-linux-gnu/pacemaker -c -o sbd-inquisitor.o sbd-inquisitor.c; echo $?
0

$ gcc-7 -v
Using built-in specs.
COLLECT_GCC=gcc-7
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 7.1.0-7' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.1.0 (Debian 7.1.0-7) 

-- 
Valentin



More information about the Debian-ha-maintainers mailing list