View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001412 | bareos-core | General | public | 2021-12-23 09:57 | 2022-11-09 14:03 |
Reporter | tuxmaster | Assigned To | arogge | ||
Priority | normal | Severity | block | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | x86_64 | OS | Fedora | OS Version | 35 |
Product Version | 21.0.0 | ||||
Summary | 0001412: Unable to build it, because of the default compiler flags on Fedora and unclean code | ||||
Description | Fedora will set this flags by default: -Werror=maybe-uninitialized -Werror=format-truncation But then it fails at: /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmjob_job.c: In function 'jndex_tattle': /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmjob_job.c:436:5: error: 'i' may be used uninitialized [-Werror=maybe-uninitialized] 436 | ndmjob_log(3, "ji me[%d] %s", i, buf); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors gmake[2]: *** [core/src/ndmp/CMakeFiles/ndmjob.dir/build.make:107: core/src/ndmp/CMakeFiles/ndmjob.dir/ndmjob_job.c.o] Error 1 gmake[2]: *** Waiting for unfinished jobs.... /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmjob_simulator.c: In function 'robot_state_init': /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmjob_simulator.c:933:49: error: '__snprintf_chk' output truncated before the last format character [-Werror=format-truncation=] 933 | "PTAG%02XXX ", i); | ^ In file included from /usr/include/stdio.h:888, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmos_linux.h:57, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmos.h:174, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmlib.h:41, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmagents.h:100, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmjob.h:38, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmjob_simulator.c:41: /usr/include/bits/stdio2.h:71:10: note: '__snprintf_chk' output 33 bytes into a destination of size 32 71 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 72 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmjob_simulator.c:935:49: error: '__snprintf_chk' output truncated before the last format character [-Werror=format-truncation=] 935 | "ATAG%02XXX ", i); | ^ In file included from /usr/include/stdio.h:888, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmos_linux.h:57, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmos.h:174, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmlib.h:41, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmagents.h:100, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmjob.h:38, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmjob_simulator.c:41: /usr/include/bits/stdio2.h:71:10: note: '__snprintf_chk' output 33 bytes into a destination of size 32 71 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 72 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmjob_simulator.c: In function 'execute_cdb_move_medium': /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmjob_simulator.c:1075:33: error: '.pos' directive output may be truncated writing 4 bytes into a region of size between 1 and 1024 [-Werror=format-truncation=] 1075 | snprintf(pos, sizeof(pos), "%s.pos", src_filename); | ^~~~ In file included from /usr/include/stdio.h:888, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmos_linux.h:57, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmos.h:174, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmlib.h:41, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmagents.h:100, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmjob.h:38, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmjob_simulator.c:41: /usr/include/bits/stdio2.h:71:10: note: '__snprintf_chk' output between 5 and 1028 bytes into a destination of size 1024 71 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 72 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmjob_simulator.c:1077:33: error: '.pos' directive output may be truncated writing 4 bytes into a region of size between 1 and 1024 [-Werror=format-truncation=] 1077 | snprintf(pos, sizeof(pos), "%s.pos", dest_filename); | ^~~~ In file included from /usr/include/stdio.h:888, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmos_linux.h:57, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmos.h:174, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmlib.h:41, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmagents.h:100, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmjob.h:38, from /builddir/build/BUILD/bareos-Release-21.0.0/core/src/ndmp/ndmjob_simulator.c:41: /usr/include/bits/stdio2.h:71:10: note: '__snprintf_chk' output between 5 and 1028 bytes into a destination of size 1024 71 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 72 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors gmake[2]: Leaving directory '/builddir/build/BUILD/bareos-Release-21.0.0/redhat-linux-build' The default flags on Fedora 35 are: + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules' + export FCFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 ' + export LDFLAGS | ||||
Steps To Reproduce | See the complete build log | ||||
Additional Information | See the complete build log | ||||
Tags | No tags attached. | ||||
The same will happens using the Fedora 34 compiler default settings, | |
Also for build on RHEL-8 and RHEL-7(using Red Hat Developer Toolset 11.0 , because the default compiler don't support cx17). | |
Yeah, but just if you build the ndmpjob binary, which we usually don't. Nevertheless, I fixed it, but the PR ist not yet merged. |
|
btw... the fix is going onto master only. If you need to build the ndmpjob binary (and I really doubt that you do), you can add the patch during packaging - should be straightforward. | |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-12-23 09:57 | tuxmaster | New Issue | |
2021-12-23 09:57 | tuxmaster | File Added: build.log | |
2021-12-23 22:25 | tuxmaster | Note Added: 0004411 | |
2021-12-23 23:21 | tuxmaster | Note Added: 0004412 | |
2022-02-23 20:20 | arogge | Note Added: 0004524 | |
2022-02-23 20:23 | arogge | Assigned To | => arogge |
2022-02-23 20:23 | arogge | Status | new => assigned |
2022-02-23 20:24 | arogge | Note Added: 0004525 | |
2022-11-09 14:03 | arogge | Status | assigned => resolved |
2022-11-09 14:03 | arogge | Resolution | open => fixed |
2022-11-09 14:03 | arogge | Status | resolved => closed |