Hi, On Sat, Oct 23, 2021 at 09:07:29PM +0200, Lucas Nussbaum wrote: > Source: nmon > Version: 16m+debian-1 > Severity: serious > Justification: FTBFS > Tags: bookworm sid ftbfs > > Hi, > > During a rebuild of all packages in sid, your package failed to build > on amd64. > > > Relevant part (hopefully): > > x86_64-linux-gnu-gcc -o nmon lmon16m.c -Wdate-time -D_FORTIFY_SOURCE=2 -g > > -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat > > -Werror=format-security -Wall -D DEBIAN -Wl,-z,relro -Wl,-z,now -lncurses > > -lm > > lmon16m.c: In function ‘main’: > > lmon16m.c:5478:45: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5478 | mvwprintw(padsmp, 1, 0, cpu_line); > > | ^~~~~~~~ > > lmon16m.c:5600:51: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5600 | CURSE mvwprintw(padsmp, i + 3, 0, cpu_line); > > | ^~~~~~~~ > > lmon16m.c:5676:55: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5676 | CURSE mvwprintw(padsmp, i + 5, 0, cpu_line); > > | ^~~~~~~~ > > lmon16m.c:5707:21: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5707 | mvwprintw(padwide, 1, 0, wide1); > > | ^~~~~~~~~ > > lmon16m.c:5708:21: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5708 | mvwprintw(padwide, 2, 0, wide2); > > | ^~~~~~~~~ > > lmon16m.c:5709:21: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5709 | mvwprintw(padwide, 3, 0, wide3); > > | ^~~~~~~~~ > > lmon16m.c:5710:21: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5710 | mvwprintw(padwide, 4, 0, wide4); > > | ^~~~~~~~~ > > lmon16m.c:5711:21: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5711 | mvwprintw(padwide, 5, 0, wide5); > > | ^~~~~~~~~ > > lmon16m.c:5712:21: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5712 | mvwprintw(padwide, 6, 0, wide6); > > | ^~~~~~~~~ > > lmon16m.c:5713:21: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5713 | mvwprintw(padwide, 7, 0, wide7); > > | ^~~~~~~~~ > > lmon16m.c:5714:21: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5714 | mvwprintw(padwide, 8, 0, wide8); > > | ^~~~~~~~~ > > lmon16m.c:5715:21: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5715 | mvwprintw(padwide, 9, 0, wide9); > > | ^~~~~~~~~ > > lmon16m.c:5716:21: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5716 | mvwprintw(padwide, 10, 0, wide10); > > | ^~~~~~~~~ > > lmon16m.c:5758:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5758 | mvwprintw(padwide, rows + 0, 0, wide1); > > | ^~~~~~~~~ > > lmon16m.c:5759:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5759 | mvwprintw(padwide, rows + 1, 0, wide2); > > | ^~~~~~~~~ > > lmon16m.c:5760:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5760 | mvwprintw(padwide, rows + 2, 0, wide3); > > | ^~~~~~~~~ > > lmon16m.c:5761:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5761 | mvwprintw(padwide, rows + 3, 0, wide4); > > | ^~~~~~~~~ > > lmon16m.c:5762:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5762 | mvwprintw(padwide, rows + 4, 0, wide5); > > | ^~~~~~~~~ > > lmon16m.c:5763:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5763 | mvwprintw(padwide, rows + 5, 0, wide6); > > | ^~~~~~~~~ > > lmon16m.c:5764:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5764 | mvwprintw(padwide, rows + 6, 0, wide7); > > | ^~~~~~~~~ > > lmon16m.c:5765:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5765 | mvwprintw(padwide, rows + 7, 0, wide8); > > | ^~~~~~~~~ > > lmon16m.c:5766:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5766 | mvwprintw(padwide, rows + 8, 0, wide9); > > | ^~~~~~~~~ > > lmon16m.c:5767:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5767 | mvwprintw(padwide, rows + 9, 0, wide10); > > | ^~~~~~~~~ > > lmon16m.c:5816:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5816 | mvwprintw(padwide, rows + 0, 0, wide1); > > | ^~~~~~~~~ > > lmon16m.c:5817:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5817 | mvwprintw(padwide, rows + 1, 0, wide2); > > | ^~~~~~~~~ > > lmon16m.c:5818:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5818 | mvwprintw(padwide, rows + 2, 0, wide3); > > | ^~~~~~~~~ > > lmon16m.c:5819:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5819 | mvwprintw(padwide, rows + 3, 0, wide4); > > | ^~~~~~~~~ > > lmon16m.c:5820:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5820 | mvwprintw(padwide, rows + 4, 0, wide5); > > | ^~~~~~~~~ > > lmon16m.c:5821:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5821 | mvwprintw(padwide, rows + 5, 0, wide6); > > | ^~~~~~~~~ > > lmon16m.c:5822:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5822 | mvwprintw(padwide, rows + 6, 0, wide7); > > | ^~~~~~~~~ > > lmon16m.c:5823:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5823 | mvwprintw(padwide, rows + 7, 0, wide8); > > | ^~~~~~~~~ > > lmon16m.c:5824:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5824 | mvwprintw(padwide, rows + 8, 0, wide9); > > | ^~~~~~~~~ > > lmon16m.c:5825:25: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 5825 | mvwprintw(padwide, rows + 9, 0, wide10); > > | ^~~~~~~~~ > > lmon16m.c:6403:52: warning: format ‘%d’ expects argument of type ‘int’, but > > argument 5 has type ‘long unsigned int’ [-Wformat=] > > 6403 | mvwprintw(padmem, 1, 1, "PageSize:%dKB", pagesize / > > 1024); > > | ~^ > > ~~~~~~~~~~~~~~~ > > | | | > > | int > > long unsigned int > > | %ld > > lmon16m.c:6897:59: warning: format ‘%d’ expects argument of type ‘int’, but > > argument 5 has type ‘long long int’ [-Wformat=] > > 6897 | mvwprintw(padker, 9, BOOTCOL, "Boot time %d", > > boottime); > > | ~^ > > ~~~~~~~~ > > | | | > > | int long > > long int > > | %lld > > lmon16m.c:7243:48: warning: format ‘%s’ expects argument of type ‘char *’, > > but argument 5 has type ‘long unsigned int *’ [-Wformat=] > > 7243 | mvwprintw(padnet, 2 + i, 0, "%8s", > > | ~~^ > > | | > > | char * > > | %8ln > > 7244 | &p->ifnets[i].if_name[0]); > > | ~~~~~~~~~~~~~~~~~~~~~~~~ > > | | > > | long unsigned int * > > lmon16m.c:7315:36: warning: format ‘%s’ expects argument of type ‘char *’, > > but argument 5 has type ‘long unsigned int *’ [-Wformat=] > > 7315 | "%8s %7lu %7lu %7lu %7lu %7lu %7lu > > %7lu %7lu %7lu", > > | ~~^ > > | | > > | char * > > | %8ln > > 7316 | &p->ifnets[i].if_name[0], > > | ~~~~~~~~~~~~~~~~~~~~~~~~ > > | | > > | long unsigned int * > > lmon16m.c:7675:62: warning: format ‘%d’ expects argument of type ‘int’, but > > argument 5 has type ‘long unsigned int’ [-Wformat=] > > 7675 | mvwprintw(paddisk, 2 + k, 70, "%3d", > > p->dk[i].dk_inflight); > > | ~~^ > > ~~~~~~~~~~~~~~~~~~~~ > > | | > > | > > | int > > long unsigned int > > | %3ld > > lmon16m.c:8232:67: warning: format ‘%d’ expects argument of type ‘int’, but > > argument 5 has type ‘long int’ [-Wformat=] > > 8232 | mvwprintw(padtop, j + 2 - skipped, 24, "%4d > > %4d", > > | ~~^ > > | | > > | > > int > > | %4ld > > 8233 | p->procs[i].pi_nice, > > | ~~~~~~~~~~~~~~~~~~~ > > | | > > | long int > > lmon16m.c:8232:71: warning: format ‘%d’ expects argument of type ‘int’, but > > argument 6 has type ‘long int’ [-Wformat=] > > 8232 | mvwprintw(padtop, j + 2 - skipped, 24, "%4d > > %4d", > > | > > ~~^ > > | > > | > > | > > int > > | > > %4ld > > 8233 | p->procs[i].pi_nice, > > 8234 | p->procs[i].pi_pri); > > | ~~~~~~~~~~~~~~~~~~ > > > > | | > > | long int > > lmon16m.c:8244:70: warning: format ‘%x’ expects argument of type ‘unsigned > > int’, but argument 5 has type ‘long unsigned int’ [-Wformat=] > > 8244 | mvwprintw(padtop, j + 2 - skipped, 45, > > "0x%08x", > > | > > ~~~^ > > | > > | > > | > > unsigned int > > | > > %08lx > > 8245 | p->procs[i].pi_flags); > > | ~~~~~~~~~~~~~~~~~~~~ > > > > | | > > | long unsigned int > > lmon16m.c:8277:21: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 8277 | CURSE mvwprintw(padtop, 1, y, formatstring); > > | ^~~~~ > > lmon16m.c:8297:21: error: format not a string literal and no format > > arguments [-Werror=format-security] > > 8297 | CURSE mvwprintw(padtop, 2, 1, formatstring); > > | ^~~~~ > > cc1: some warnings being treated as errors > > make[1]: *** [debian/rules:21: override_dh_auto_build] Error 1
I have contacted upstream and is working on an update. I just didn't want to patch it introducing unnecdessary "%s" format strings (in some of the above cases where it's not really an error doing it the way upstream did). His response to the above: [...] > It is however a complier bug (probably in a new version), inefficient > code to add a pointless "%s" argument and a change to these standard C > function calls. > > The code is completely legal C code and has been for 20+ years or > more. > It seems the Debian / GMU C compiler team are adding checks that > wrongly invalidate good C code. > > There are some issues from line 6403 onward that will also need fixing. [...] Regards, Salvatore