Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 906161 - sys-apps/systemd-253.4 fails to emerge with gcc version 13.1.0 (shared/install.c:434:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=])
Summary: sys-apps/systemd-253.4 fails to emerge with gcc version 13.1.0 (shared/instal...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: riscv Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-13
  Show dependency tree
 
Reported: 2023-05-11 18:29 UTC by Andrew Cameron
Modified: 2023-11-19 22:20 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log (build.log,723.63 KB, text/x-log)
2023-05-11 18:29 UTC, Andrew Cameron
Details
Environment (environment,176.28 KB, text/plain)
2023-05-11 18:30 UTC, Andrew Cameron
Details
Info log (info.log,8.66 KB, text/x-log)
2023-05-11 18:30 UTC, Andrew Cameron
Details
pqv log (pqv.log,348 bytes, text/x-log)
2023-05-11 18:30 UTC, Andrew Cameron
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cameron 2023-05-11 18:29:07 UTC
sys-apps/systemd-253.4 fails to emerge with gcc version 13.1.0

As a work-around I have to use clang

Reproducible: Always

Steps to Reproduce:
1.install gcc 13
2.emerge sys-apps/systemd
3.
Actual Results:  
INFO: calculating backend command to run: /usr/bin/ninja -j 4 -v
 * ERROR: sys-apps/systemd-253.4::gentoo failed (compile phase):
 *   compile failed
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 4185:  Called meson-multilib_src_compile
 *   environment, line 2614:  Called multilib-minimal_src_compile
 *   environment, line 2861:  Called multilib_foreach_abi 'multilib-minimal_abi_src_compile'
 *   environment, line 3128:  Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
 *   environment, line 2821:  Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile'
 *   environment, line 2819:  Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_compile'
 *   environment, line  646:  Called multilib-minimal_abi_src_compile
 *   environment, line 2855:  Called multilib_src_compile
 *   environment, line 3348:  Called meson_src_compile
 *   environment, line 2673:  Called die
 * The specific snippet of code:
 *       "$@" || die "compile failed"
 * 
 * If you need support, post the output of `emerge --info '=sys-apps/systemd-253.4::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-apps/systemd-253.4::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-apps/systemd-253.4/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-apps/systemd-253.4/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-apps/systemd-253.4/work/systemd-stable-253.4-.lp64d'
 * S: '/var/tmp/portage/sys-apps/systemd-253.4/work/systemd-stable-253.4'


Expected Results:  
emerge completes successfuly

See Attached logs
Comment 1 Andrew Cameron 2023-05-11 18:29:42 UTC
Created attachment 861531 [details]
Build log
Comment 2 Andrew Cameron 2023-05-11 18:30:03 UTC
Created attachment 861532 [details]
Environment
Comment 3 Andrew Cameron 2023-05-11 18:30:26 UTC
Created attachment 861533 [details]
Info log
Comment 4 Andrew Cameron 2023-05-11 18:30:52 UTC
Created attachment 861534 [details]
pqv log
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-11 21:12:35 UTC
FAILED: src/shared/libsystemd-shared-253.a.p/install.c.o 
riscv64-unknown-linux-gnu-gcc -Isrc/shared/libsystemd-shared-253.a.p -Isrc/shared -I../systemd-stable-253.4/src/shared -Isrc/basic -I../systemd-stable-253.4/src/basic -Isrc/fundamental -I../systemd-stable-253.4/src/fundamental -Isrc/systemd -I../systemd-stable-253.4/src/systemd -I. -I../systemd-stable-253.4 -I../systemd-stable-253.4/src/libsystemd/sd-bus -I../systemd-stable-253.4/src/libsystemd/sd-device -I../systemd-stable-253.4/src/libsystemd/sd-event -I../systemd-stable-253.4/src/libsystemd/sd-hwdb -I../systemd-stable-253.4/src/libsystemd/sd-id128 -I../systemd-stable-253.4/src/libsystemd/sd-journal -I../systemd-stable-253.4/src/libsystemd/sd-netlink -I../systemd-stable-253.4/src/libsystemd/sd-network -I../systemd-stable-253.4/src/libsystemd/sd-resolve -I/usr/include/blkid -I/usr/include/libmount -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -Wno-missing-field-initializers -Wno-unused-parameter -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fstrict-flex-arrays -Wno-maybe-uninitialized -Wno-unused-result -Werror=missing-declarations -Werror=missing-prototypes -fdiagnostics-show-option -fno-common -fno-strict-aliasing -fstack-protector -fstack-protector-strong -fstrict-flex-arrays=1 -fvisibility=hidden --param=ssp-buffer-size=4 -ffunction-sections -fdata-sections -fno-omit-frame-pointer -Werror=shadow -include config.h -mabi=lp64d -march=rv64imafdc_zba_zbb -mcpu=sifive-u74 -mtune=sifive-7-series -O3 -pipe -fomit-frame-pointer -fPIC -pthread -fvisibility=default -MD -MQ src/shared/libsystemd-shared-253.a.p/install.c.o -MF src/shared/libsystemd-shared-253.a.p/install.c.o.d -o src/shared/libsystemd-shared-253.a.p/install.c.o -c ../systemd-stable-253.4/src/shared/install.c
In file included from ../systemd-stable-253.4/src/basic/macro.h:427,
                 from ../systemd-stable-253.4/src/basic/alloc-util.h:10,
                 from ../systemd-stable-253.4/src/shared/install.c:12:
../systemd-stable-253.4/src/shared/install.c: In function ‘install_changes_dump’:
../systemd-stable-253.4/src/shared/install.c:434:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  434 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s does not exist.",
      |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-stable-253.4/src/basic/log.h:213:86: note: in definition of macro ‘log_full_errno_zerook’
  213 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../systemd-stable-253.4/src/basic/log.h:253:41: note: in expansion of macro ‘log_full_errno’
  253 | #define log_error_errno(error, ...)     log_full_errno(LOG_ERR,     error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../systemd-stable-253.4/src/shared/install.c:434:31: note: in expansion of macro ‘log_error_errno’
  434 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s does not exist.",
      |                               ^~~~~~~~~~~~~~~
../systemd-stable-253.4/src/shared/install.c:434:75: note: format string is defined here
  434 |                         err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s does not exist.",
      |                                                                           ^~
../systemd-stable-253.4/src/shared/install.c:393:55: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  393 |                                                       "Failed to %s unit, file \"%s\" already exists.",
      |                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-stable-253.4/src/basic/log.h:213:86: note: in definition of macro ‘log_full_errno_zerook’
  213 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../systemd-stable-253.4/src/basic/log.h:253:41: note: in expansion of macro ‘log_full_errno’
  253 | #define log_error_errno(error, ...)     log_full_errno(LOG_ERR,     error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
[...]
Comment 6 jinqiang zhang 2023-05-12 01:57:55 UTC
Interesting, this problem does not occur in my qemu-user

emerge -pqv sys-apps/systemd gcc
[ebuild   R   ] sys-devel/gcc-13.1.0-r1  USE="(cxx) fortran nls nptl openmp (pie) sanitize ssp (-ada) (-cet) (-custom-cflags) -d -debug -default-stack-clash-protection -default-znow -doc (-fixed-point) -go -graphite -hardened (-ieee-long-double) -jit (-libssp) -lto -modula2 (-multilib) -objc -objc++ -objc-gc (-pch) -pgo -systemtap -test (-valgrind) -vanilla (-vtv) -zstd"
[ebuild   R   ] sys-apps/systemd-253.4  USE="acl dns-over-tls gcrypt kmod lz4 openssl pam pcre policykit resolvconf seccomp (split-usr) sysv-utils zstd (-apparmor) -audit -cgroup-hybrid -cryptsetup -curl -elfutils -fido2 (-gnuefi) -gnutls -homed -http -idn -importd -iptables -lzma -pkcs11 -pwquality -qrcode (-selinux) -test -tpm -vanilla -xkb"


But I found some issues related to this problem, https://github.com/systemd/systemd/issues/26118, https://github.com/systemd/systemd/issues/26263, maybe you try compiling systemd with -O2?
Comment 7 Andrew Cameron 2023-05-12 11:45:56 UTC
I just tried compiling it with -O2 as suggested and that works.
It emerges ins installs cleanly.