Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 685534 - sys-apps/systemd-242-r1: log.h:220:27: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
Summary: sys-apps/systemd-242-r1: log.h:220:27: error: ‘%s’ directive argument is null...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL: https://github.com/systemd/systemd/is...
Whiteboard:
Keywords:
: 687652 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-05-10 16:01 UTC by Craig Andrews
Modified: 2019-06-08 20:44 UTC (History)
2 users (show)

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


Attachments
build.log.gz (sys-apps:systemd-242-r1:20190510-125238.log.gz,34.83 KB, application/gzip)
2019-05-10 16:03 UTC, Craig Andrews
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Andrews gentoo-dev 2019-05-10 16:01:46 UTC
* Package:    sys-apps/systemd-242-r1
 * Repository: gentoo
 * Maintainer: systemd@gentoo.org
 * USE:        abi_x86_32 abi_x86_64 acl amd64 cryptsetup curl elfutils elibc_glibc gcrypt http idn kernel_linux kmod libidn2 lz4 lzma pam pcre policykit qrcode seccomp split-usr sysv-utils userland_GNU
 * FEATURES:   ccache network-sandbox preserve-libs sandbox splitdebug userpriv usersandbox

---
[449/1217] x86_64-pc-linux-gnu-gcc -m32 -Isrc/shared/5afaae1@@systemd-shared-242@sta -Isrc/shared -I../systemd-242/src/shared -Isrc/basic -I../systemd-242/src/basic -Isrc/systemd -I../systemd-242/src/systemd -Isrc/journal -I../systemd-24>
FAILED: src/shared/5afaae1@@systemd-shared-242@sta/machine-image.c.o
x86_64-pc-linux-gnu-gcc -m32 -Isrc/shared/5afaae1@@systemd-shared-242@sta -Isrc/shared -I../systemd-242/src/shared -Isrc/basic -I../systemd-242/src/basic -Isrc/systemd -I../systemd-242/src/systemd -Isrc/journal -I../systemd-242/src/journ>
In file included from ../systemd-242/src/basic/macro.h:549,
                 from ../systemd-242/src/basic/alloc-util.h:9,
                 from ../systemd-242/src/shared/machine-image.c:15:
In function ‘image_make’,
    inlined from ‘image_from_path’ at ../systemd-242/src/shared/machine-image.c:496:16:
../systemd-242/src/basic/log.h:220:27: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  220 |                         ? log_internal_realm(LOG_REALM_PLUS_LEVEL(_realm, _level), _e, \
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  221 |                                              __FILE__, __LINE__, __func__, __VA_ARGS__) \
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../systemd-242/src/basic/log.h:226:9: note: in expansion of macro ‘log_full_errno_realm’
  226 |         log_full_errno_realm(LOG_REALM, (level), (error), __VA_ARGS__)
      |         ^~~~~~~~~~~~~~~~~~~~
../systemd-242/src/basic/log.h:241:41: note: in expansion of macro ‘log_full_errno’
  241 | #define log_debug_errno(error, ...)     log_full_errno(LOG_DEBUG,   error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../systemd-242/src/shared/machine-image.c:376:41: note: in expansion of macro ‘log_debug_errno’
  376 |                                         log_debug_errno(errno, "Failed to issue BLKROGET on device %s/%s, ignoring: %m", path, filename);
      |                                         ^~~~~~~~~~~~~~~
../systemd-242/src/shared/machine-image.c: In function ‘image_from_path’:
../systemd-242/src/shared/machine-image.c:376:100: note: format string is defined here
  376 |                                         log_debug_errno(errno, "Failed to issue BLKROGET on device %s/%s, ignoring: %m", path, filename);
      |                                                                                                    ^~
In file included from ../systemd-242/src/basic/macro.h:549,
                 from ../systemd-242/src/basic/alloc-util.h:9,
                 from ../systemd-242/src/shared/machine-image.c:15:
In function ‘image_make’,
    inlined from ‘image_from_path’ at ../systemd-242/src/shared/machine-image.c:496:16:
../systemd-242/src/basic/log.h:220:27: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  220 |                         ? log_internal_realm(LOG_REALM_PLUS_LEVEL(_realm, _level), _e, \
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  221 |                                              __FILE__, __LINE__, __func__, __VA_ARGS__) \
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---


# emerge --info
Portage 2.3.66 (python 3.7.3-final-0, default/linux/amd64/17.1/systemd, gcc-9.1.0, glibc-2.29-r2, 5.1.0-rc7 x86_64)
=================================================================
System uname: Linux-5.1.0-rc7-x86_64-Intel-R-_Core-TM-_i5-6500_CPU_@_3.20GHz-with-gentoo-2.6
KiB Mem:    16018800 total,    756816 free
KiB Swap:   12337144 total,  12016888 free
Timestamp of repository gentoo: Fri, 10 May 2019 12:30:01 +0000
Head commit of repository gentoo: b7f412f6d0ce9573327e8360e6baa5c3406812e1
sh bash 5.0_p7
ld GNU ld (Gentoo 2.32 p2) 2.32.0
ccache version 3.7.1 [enabled]
app-shells/bash:          5.0_p7::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.28.2-r1::gentoo
dev-lang/python:          2.7.16::gentoo, 3.6.8::gentoo, 3.7.3::gentoo
dev-util/ccache:          3.7.1::gentoo
dev-util/cmake:           3.14.3::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.17::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.32-r1::gentoo
sys-devel/gcc:            9.1.0::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.0-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r2::gentoo
Repositories:

gentoo
    location: /var/cache/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA Intel-SDP Oracle-BCLA-JavaSE Oracle-EADLA AMD-GPU-PRO-EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -march=native -pipe -fuse-linker-plugin -flto -ftree-vectorize -ftree-slp-vectorize -falign-functions=32 -fgraphite-identity -floop-nest-optimize"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.6/conf"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.3/ext-active/ /etc/php/cgi-php7.3/ext-active/ /etc/php/cli-php7.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O3 -march=native -pipe -fuse-linker-plugin -flto -ftree-vectorize -ftree-slp-vectorize -falign-functions=32 -fgraphite-identity -floop-nest-optimize"
DISTDIR="/var/cache/portage/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=4 --load-average=4.5"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs candy ccache cgroup clean-logs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync mount-sandbox multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned sandbox sfperms splitdebug strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -flto -Wl,--hash-style=gnu"
LINGUAS="en"
MAKEOPTS="-j5"
PKGDIR="/var/cache/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac aacs acl acpi aiglx alac alsa amd64 amr amrnb amrwb animation apache2 apng argon2 artworkextra asf aspnet2 asyncns authdaemond avahi avi bash-completion bcmath berkdb bitmap-fonts bluetooth bluray bmp bonjour brotli btrfs bzip2 cairo caps cdda cddb cdparanoia cdr celt chm clang cli crypt cryptsetup css cups curl cxx daap dbus device-mapper dga dhclient dirac divx4linux dlloader dns dnssec dovecot-sasl dpms dri dri3 dts dv dvb dvd dvdr dvdread egl enca encode exif ext4 faac fam fame fat fbcondecor fbsplash ffmpeg fftw firefox flac fontconfig foomaticdb fortran freetype ftp fuse gaim gd gdbm geoip gif gimpprint glamor gles gles1 gles2 glib glibc-omitfp glitz glut gost gphoto2 graphite gsm gstreamer gstreamer10 gtk gtk2 gudev hardenedphp hbci howl howl-compat http2 https hwdb iconv icu idn imagemagick imap imlib innodb ipv6 java java5 javafx jbig jce joystick jpeg jpeg2k junit kdbus kdehiddenvisibility kvm lapack lcms libfame libkms libnotify librtmp libtirpc libusb live llvm lm_sensors lvm lz4 lzma lzo mad maildir mdadm mdnsresponder-compat metalink mjpeg mmap mms mng motif mozilla mozsvg mp3 mpeg mpeg2 mplayer mpx multilib musepack mysql mythtv natspec ncurses nemesi network networkmanager nls nptl nptlonly ntfs ocl-icd offensive ofx ogg oggvorbis openal opencl openexr opengl openmp openvg opus pam pango pcre pcre16 pcre32 pcsc-lite pdf pdflib perl pgo phonon pic pie png pnp policykit ppd ppds pulseaudio python quicktime quvi rar readline rtc rtmp schroedinger screensaver sctp sdl seccomp session sftp sharedmem shout smp sna sni sox speex spell sqlite srt ssh ssl steamruntime suspend2 svg systemd theora threads tiff tls transcode truetype truetype-fonts type-fonts udev udisks unicode unzip upnp ups usb user-session uxa v4l2 vaapi vcd videos virgl vorbis vpx vulkan wayland webdav webp webservices wifi win32codecs wmf wv x264 x265 xanim xattr xcb xcomposite xdg xinerama xml xml2 xpm xprint xrandr xv xvfb xvid xvmc zeroconf zip zlib zstd" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="actions alias auth_basic authn_core authz_core cache_disk authn_alias authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex brotli cache dav dav_fs dav_lock dconf deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias auth_digest proxy proxy_ajp proxy_connect proxy_http proxy_fcgi reqtimeout cgi cgid unixd socache_shmcb proxy_html xml2enc" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="openssl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="evdev joystick keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LIRC_DEVICES="userspace" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6 python3_7" QEMU_SOFTMMU_TARGETS="arm i386 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby25" USERLAND="GNU" VIDEO_CARDS="intel i965 amdgpu radeon radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Craig Andrews gentoo-dev 2019-05-10 16:03:24 UTC
Created attachment 575660 [details]
build.log.gz
Comment 2 Mike Gilbert gentoo-dev 2019-05-10 17:59:45 UTC
Please report this upstream.
Comment 3 Craig Andrews gentoo-dev 2019-05-10 18:20:38 UTC
Reported upstream at https://github.com/systemd/systemd/issues/12534
Comment 4 Mike Gilbert gentoo-dev 2019-05-10 18:32:16 UTC
I'm unable to reproduce this; my first guess is that your CFLAGS are triggering different behavior than my much more conservative setting.

CFLAGS="-O2 -pipe -march=amdfam10"
Comment 5 Craig Andrews gentoo-dev 2019-05-10 18:47:16 UTC
(In reply to Mike Gilbert from comment #4)
> I'm unable to reproduce this; my first guess is that your CFLAGS are
> triggering different behavior than my much more conservative setting.
> 
> CFLAGS="-O2 -pipe -march=amdfam10"

I believe this is caused by -O3... changing -O3 to -O2 resulted in it successfully building.

Can you try -O3 and see if you get the same failure as I reported?
Comment 6 Mike Gilbert gentoo-dev 2019-05-10 19:01:36 UTC
Yes, I can reproduce the issue with CFLAGS="-O3 -pipe -march=amdfam10".
Comment 7 Denis Dupeyron (RETIRED) gentoo-dev 2019-05-21 06:33:36 UTC
Obviously filtering -O3 and replacing it with -O2 like it's done all over the tree would be the wrong thing to do. Because the real culprit here is -finline-functions, not -O3, and it could be set directly or even indirectly by other options than -O3.

So just unconditionally add -fno-inline-functions and you're good to go.
Comment 8 Mike Gilbert gentoo-dev 2019-05-21 17:25:19 UTC
(In reply to Denis Dupeyron from comment #7)

I will backport patches from upstream if someone can point them out. I'm not planning to add any workarounds to the ebuild at this time.
Comment 9 Craig Andrews gentoo-dev 2019-05-21 17:30:17 UTC
(In reply to Mike Gilbert from comment #8)
> (In reply to Denis Dupeyron from comment #7)
> 
> I will backport patches from upstream if someone can point them out. I'm not
> planning to add any workarounds to the ebuild at this time.

The solution is to backport all 5 of these commits: https://github.com/systemd/systemd/pull/12501/commits
We have one of the 5 already.
Comment 10 Mike Gilbert gentoo-dev 2019-05-21 17:39:27 UTC
(In reply to Craig Andrews from comment #5)

Are you sure about that? None of those patches touch src/shared/machine-image.c.
Comment 11 Mike Gilbert gentoo-dev 2019-05-21 17:41:30 UTC
Also, the chucks that touch scsi_serial.c fail to apply on top of v242.

If you have a working patch series, please provide it.
Comment 12 Denis Dupeyron (RETIRED) gentoo-dev 2019-05-21 21:03:37 UTC
(In reply to Mike Gilbert from comment #10)
> Are you sure about that? None of those patches touch
> src/shared/machine-image.c.

The issue occurs when inlining from src/shared/machine-image.c so it's not too surprising that the fix could be somewhere else.
Comment 13 Mike Gilbert gentoo-dev 2019-05-21 21:16:50 UTC
(In reply to Denis Dupeyron from comment #12)

It is inlining a function defined in the same source file.
Comment 14 Mike Gilbert gentoo-dev 2019-05-21 21:34:57 UTC
Another interesting data point: I can only reproduce this when building for the x86 (32-bit) ABI. When compiling for amd64, it works fine, regardless of CFLAGS.
Comment 15 Mike Gilbert gentoo-dev 2019-05-21 21:36:19 UTC
To do a 32-bit build outside of portage:

PKG_CONFIG=i686-pc-linux-gnu-pkg-config CC="gcc -m32" CFLAGS="-O3 -pipe -march=amdfam10" meson -Dman=false build

ninja -C build
Comment 16 Mike Gilbert gentoo-dev 2019-05-21 21:50:45 UTC
I am able to reproduce the issue on the current master branch using the above command, so I'm pretty sure this has not been fixed upstream as of yet.
Comment 17 Mike Gilbert gentoo-dev 2019-06-08 20:22:34 UTC
*** Bug 687652 has been marked as a duplicate of this bug. ***
Comment 18 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2019-06-08 20:25:00 UTC
it's fixed in https://patch-diff.githubusercontent.com/raw/systemd/systemd/pull/12641.patch
Comment 19 Larry the Git Cow gentoo-dev 2019-06-08 20:44:16 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=284c3c0b7d130ca73ed214365c8ecc2cba30ac6e

commit 284c3c0b7d130ca73ed214365c8ecc2cba30ac6e
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2019-06-08 20:41:42 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2019-06-08 20:41:42 +0000

    sys-apps/systemd: more fixes for gcc 9
    
    Closes: https://bugs.gentoo.org/685534
    Package-Manager: Portage-2.3.67_p4, Repoman-2.3.13_p3
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-apps/systemd/files/242-gcc-9.patch | 128 +++++++++++++++++++++++++++++++++
 1 file changed, 128 insertions(+)