On Sat, Oct 23, 2021 at 09:07:10PM +0200, Lucas Nussbaum wrote:
> Source: mtr
> Version: 0.94-2
> Severity: serious
> Justification: FTBFS
> Tags: bookworm sid ftbfs
That's an error in your compiler.
A printf-like function often has a string litteral specifying the
format
printf ("a = %d\n", a);
But it is still just a string. So when I want to print something
either in hex or in dec depending on a user-setting.
I could do something like:
printf ("a = ");
printf (theformat, a);
printf ("\n");
Now this has become three statements. To compact this a bit more, we
might do:
sprintf (format, "a = %s\n", theformat); // format is %d or %x or... set by
user
printf (format, a);
I think this is perfectly legal C code and your compiler doesn't like
it. It doesn't just warn, but gives an error.
Roger.
> Hi,
>
> During a rebuild of all packages in sid, your package failed to build
> on amd64.
>
>
> Relevant part (hopefully):
> > gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -pthread
> > -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include
> > -I/usr/include/pango-1.0 -I/usr/include/atk-1.0
> > -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16
> > -I/usr/include/x86_64-linux-gnu -I/usr/include/pango-1.0
> > -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/libmount
> > -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo
> > -I/usr/include/pixman-1 -I/usr/include/harfbuzz -I/usr/include/glib-2.0
> > -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/uuid
> > -I/usr/include/freetype2 -I/usr/include/libpng16 -g -O2
> > -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat
> > -Werror=format-security -Wall -Wno-pointer-sign -c -o ui/mtr-curses.o `test
> > -f 'ui/curses.c' || echo '../'`ui/curses.c
> > ../ui/curses.c: In function ‘mtr_curses_hosts’:
> > ../ui/curses.c:435:17: error: format not a string literal and no format
> > arguments [-Werror=format-security]
> > 435 | printw(fmt_ipinfo(ctl, addr));
> > | ^~~~~~
> > ../ui/curses.c:488:21: error: format not a string literal and no format
> > arguments [-Werror=format-security]
> > 488 | printw(fmt_ipinfo(ctl, addrs));
> > | ^~~~~~
> > ../ui/curses.c: In function ‘mtr_curses_graph’:
> > ../ui/curses.c:653:17: error: format not a string literal and no format
> > arguments [-Werror=format-security]
> > 653 | printw(fmt_ipinfo(ctl, addr));
> > | ^~~~~~
> > ../ui/curses.c: In function ‘mtr_curses_redraw’:
> > ../ui/curses.c:703:5: error: format not a string literal and no format
> > arguments [-Werror=format-security]
> > 703 | mvprintw(1, maxx - 25, iso_time(&t));
> > | ^~~~~~~~
> > ../ui/curses.c:763:42: error: format not a string literal and no format
> > arguments [-Werror=format-security]
> > 763 | mvprintw(rowstat - 1, startstat, msg);
> > | ^~~
> > gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -pthread
> > -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include
> > -I/usr/include/pango-1.0 -I/usr/include/atk-1.0
> > -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16
> > -I/usr/include/x86_64-linux-gnu -I/usr/include/pango-1.0
> > -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/libmount
> > -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo
> > -I/usr/include/pixman-1 -I/usr/include/harfbuzz -I/usr/include/glib-2.0
> > -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/uuid
> > -I/usr/include/freetype2 -I/usr/include/libpng16 -g -O2
> > -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat
> > -Werror=format-security -Wall -Wno-pointer-sign -c -o ui/mtr-gtk.o `test -f
> > 'ui/gtk.c' || echo '../'`ui/gtk.c
> > gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2
> > -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat
> > -Werror=format-security -Wall -Wno-pointer-sign -c -o packet/packet.o
> > ../packet/packet.c
> > gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2
> > -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat
> > -Werror=format-security -Wall -Wno-pointer-sign -c -o packet/cmdparse.o
> > ../packet/cmdparse.c
> > gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2
> > -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat
> > -Werror=format-security -Wall -Wno-pointer-sign -c -o packet/command.o
> > ../packet/command.c
> > gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2
> > -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat
> > -Werror=format-security -Wall -Wno-pointer-sign -c -o packet/probe.o
> > ../packet/probe.c
> > In file included from /usr/include/string.h:519,
> > from ../packet/probe.c:31:
> > In function ‘strncat’,
> > inlined from ‘respond_to_probe’ at ../packet/probe.c:296:9:
> > /usr/include/x86_64-linux-gnu/bits/string_fortified.h:122:10: warning:
> > ‘__builtin___strncat_chk’ output may be truncated copying between 0 and
> > 4095 bytes from a string of length 4095 [-Wstringop-truncation]
> > 122 | return __builtin___strncat_chk (__dest, __src, __len, __bos
> > (__dest));
> > |
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > In file included from /usr/include/gtk-2.0/gtk/gtkobject.h:37,
> > from /usr/include/gtk-2.0/gtk/gtkwidget.h:36,
> > from /usr/include/gtk-2.0/gtk/gtkcontainer.h:35,
> > from /usr/include/gtk-2.0/gtk/gtkbin.h:35,
> > from /usr/include/gtk-2.0/gtk/gtkwindow.h:36,
> > from /usr/include/gtk-2.0/gtk/gtkdialog.h:35,
> > from /usr/include/gtk-2.0/gtk/gtkaboutdialog.h:32,
> > from /usr/include/gtk-2.0/gtk/gtk.h:33,
> > from ../ui/gtk.c:31:
> > /usr/include/gtk-2.0/gtk/gtktypeutils.h:236:1: warning: ‘GTypeDebugFlags’
> > is deprecated [-Wdeprecated-declarations]
> > 236 | void gtk_type_init (GTypeDebugFlags debug_flags);
> > | ^~~~
> > In file included from /usr/include/glib-2.0/gobject/gobject.h:24,
> > from /usr/include/glib-2.0/gobject/gbinding.h:29,
> > from /usr/include/glib-2.0/glib-object.h:22,
> > from /usr/include/glib-2.0/gio/gioenums.h:28,
> > from /usr/include/glib-2.0/gio/giotypes.h:28,
> > from /usr/include/glib-2.0/gio/gio.h:26,
> > from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
> > from /usr/include/gtk-2.0/gdk/gdk.h:32,
> > from /usr/include/gtk-2.0/gtk/gtk.h:32,
> > from ../ui/gtk.c:31:
> > /usr/include/glib-2.0/gobject/gtype.h:698:1: note: declared here
> > 698 | {
> > | ^
> > gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2
> > -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat
> > -Werror=format-security -Wall -Wno-pointer-sign -c -o packet/timeval.o
> > ../packet/timeval.c
> > gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2
> > -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat
> > -Werror=format-security -Wall -Wno-pointer-sign -c -o packet/sockaddr.o
> > ../packet/sockaddr.c
> > gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2
> > -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat
> > -Werror=format-security -Wall -Wno-pointer-sign -c -o
> > packet/construct_unix.o ../packet/construct_unix.c
> > In file included from /usr/include/gtk-2.0/gtk/gtktoolitem.h:31,
> > from /usr/include/gtk-2.0/gtk/gtktoolbutton.h:30,
> > from /usr/include/gtk-2.0/gtk/gtkmenutoolbutton.h:30,
> > from /usr/include/gtk-2.0/gtk/gtk.h:126,
> > from ../ui/gtk.c:31:
> > /usr/include/gtk-2.0/gtk/gtktooltips.h:73:3: warning: ‘GTimeVal’ is
> > deprecated: Use 'GDateTime' instead [-Wdeprecated-declarations]
> > 73 | GTimeVal last_popdown;
> > | ^~~~~~~~
> > In file included from /usr/include/glib-2.0/glib/galloca.h:32,
> > from /usr/include/glib-2.0/glib.h:30,
> > from /usr/include/glib-2.0/gobject/gbinding.h:28,
> > from /usr/include/glib-2.0/glib-object.h:22,
> > from /usr/include/glib-2.0/gio/gioenums.h:28,
> > from /usr/include/glib-2.0/gio/giotypes.h:28,
> > from /usr/include/glib-2.0/gio/gio.h:26,
> > from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
> > from /usr/include/gtk-2.0/gdk/gdk.h:32,
> > from /usr/include/gtk-2.0/gtk/gtk.h:32,
> > from ../ui/gtk.c:31:
> > /usr/include/glib-2.0/glib/gtypes.h:547:8: note: declared here
> > 547 | struct _GTimeVal
> > | ^~~~~~~~~
> > cc1: some warnings being treated as errors
> > make[2]: *** [Makefile:1159: ui/mtr-curses.o] Error 1
>
>
> The full build log is available from:
> http://qa-logs.debian.net/2021/10/23/mtr_0.94-2_unstable.log
>
> A list of current common problems and possible solutions is available at
> http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!
>
> If you reassign this bug to another package, please marking it as
> 'affects'-ing
> this package. See https://www.debian.org/Bugs/server-control#affects
>
> If you fail to reproduce this, please provide a build log and diff it with
> mine
> so that we can identify if something relevant changed in the meantime.
>
--
** [email protected] ** https://www.BitWizard.nl/ ** +31-15-2049110 **
** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 **
f equals m times a. When your f is steady, and your m is going down
your a is going up. -- Chris Hadfield about flying up the space shuttle.