Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 720778 - sys-apps/systemd-245-r5 with sys-devel/gcc-10 and CFLAGS="-O3" - error: %s directive argument is null
Summary: sys-apps/systemd-245-r5 with sys-devel/gcc-10 and CFLAGS="-O3" - error: %s di...
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:
Whiteboard:
Keywords:
: 733236 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-05-03 11:35 UTC by Helmut Jarausch
Modified: 2020-08-08 18:01 UTC (History)
10 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Jarausch 2020-05-03 11:35:57 UTC
This is a bug (or sloppy programming) in systemd or the default compiler options
are too strict for systemd

[188/1291] x86_64-pc-linux-gnu-gcc -m32 -Isrc/core/2ac6ece@@core@sta -Isrc/core -I../systemd-245/src/core -Isrc/basic -I../systemd-245/src/basic -Isrc/boot -I../systemd-245/src/boot -Isrc/shared -I../systemd-245/src/shared -Isrc/systemd -I../systemd-245/src/systemd -Isrc/journal -I../systemd-245/src/journal -Isrc/journal-remote -I../systemd-245/src/journal-remote -Isrc/nspawn -I../systemd-245/src/nspawn -Isrc/resolve -I../systemd-245/src/resolve -Isrc/timesync -I../systemd-245/src/timesync -I../systemd-245/src/time-wait-sync -Isrc/login -I../systemd-245/src/login -Isrc/udev -I../systemd-245/src/udev -Isrc/libudev -I../systemd-245/src/libudev -Isrc/shutdown -I../systemd-245/src/shutdown -I../systemd-245/src/libsystemd/sd-bus -I../systemd-245/src/libsystemd/sd-device -I../systemd-245/src/libsystemd/sd-event -I../systemd-245/src/libsystemd/sd-hwdb -I../systemd-245/src/libsystemd/sd-id128 -I../systemd-245/src/libsystemd/sd-netlink -I../systemd-245/src/libsystemd/sd-network -I../systemd-245/src/libsystemd/sd-resolve -Isrc/libsystemd-network -I../systemd-245/src/libsystemd-network -I. -I../systemd-245/ -I/usr/include/libmount -I/usr/include/blkid -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=gnu99 -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Werror=shift-count-overflow -Werror=shift-overflow=2 -Wdate-time -Wnested-externs -Wno-error=nonnull -Wno-maybe-uninitialized -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -ffunction-sections -fdata-sections -Werror=shadow -include config.h -march=native -O3 -maes -mavx -mavx2 -mf16c -mfma -mmmx -mpclmul -mpopcnt -msse -msse2 -msse3 -msse4.1 -msse4.2 -msse4a -mssse3 -fPIC -pthread -MD -MQ 'src/core/2ac6ece@@core@sta/path.c.o' -MF 'src/core/2ac6ece@@core@sta/path.c.o.d' -o 'src/core/2ac6ece@@core@sta/path.c.o' -c ../systemd-245/src/core/path.c
FAILED: src/core/2ac6ece@@core@sta/path.c.o 
x86_64-pc-linux-gnu-gcc -m32 -Isrc/core/2ac6ece@@core@sta -Isrc/core -I../systemd-245/src/core -Isrc/basic -I../systemd-245/src/basic -Isrc/boot -I../systemd-245/src/boot -Isrc/shared -I../systemd-245/src/shared -Isrc/systemd -I../systemd-245/src/systemd -Isrc/journal -I../systemd-245/src/journal -Isrc/journal-remote -I../systemd-245/src/journal-remote -Isrc/nspawn -I../systemd-245/src/nspawn -Isrc/resolve -I../systemd-245/src/resolve -Isrc/timesync -I../systemd-245/src/timesync -I../systemd-245/src/time-wait-sync -Isrc/login -I../systemd-245/src/login -Isrc/udev -I../systemd-245/src/udev -Isrc/libudev -I../systemd-245/src/libudev -Isrc/shutdown -I../systemd-245/src/shutdown -I../systemd-245/src/libsystemd/sd-bus -I../systemd-245/src/libsystemd/sd-device -I../systemd-245/src/libsystemd/sd-event -I../systemd-245/src/libsystemd/sd-hwdb -I../systemd-245/src/libsystemd/sd-id128 -I../systemd-245/src/libsystemd/sd-netlink -I../systemd-245/src/libsystemd/sd-network -I../systemd-245/src/libsystemd/sd-resolve -Isrc/libsystemd-network -I../systemd-245/src/libsystemd-network -I. -I../systemd-245/ -I/usr/include/libmount -I/usr/include/blkid -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=gnu99 -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Werror=shift-count-overflow -Werror=shift-overflow=2 -Wdate-time -Wnested-externs -Wno-error=nonnull -Wno-maybe-uninitialized -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -ffunction-sections -fdata-sections -Werror=shadow -include config.h -march=native -O3 -maes -mavx -mavx2 -mf16c -mfma -mmmx -mpclmul -mpopcnt -msse -msse2 -msse3 -msse4.1 -msse4.2 -msse4a -mssse3 -fPIC -pthread -MD -MQ 'src/core/2ac6ece@@core@sta/path.c.o' -MF 'src/core/2ac6ece@@core@sta/path.c.o.d' -o 'src/core/2ac6ece@@core@sta/path.c.o' -c ../systemd-245/src/core/path.c
../systemd-245/src/core/path.c: In function ‘path_serialize’:
../systemd-245/src/core/path.c:616:24: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  616 |                 (void) serialize_item_format(f, "path-spec", "%s %i %s",
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  617 |                                              path_type_to_string(s->type),
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  618 |                                              s->previous_exists,
      |                                              ~~~~~~~~~~~~~~~~~~~
  619 |                                              s->path);
      |                                              ~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../systemd-245/src/systemd/sd-bus.h:22,
                 from ../systemd-245/src/libsystemd/sd-bus/bus-error.h:6,
                 from ../systemd-245/src/core/path.c:8:
In function ‘fprintf’,
    inlined from ‘path_dump’ at ../systemd-245/src/core/path.c:226:9:
/usr/include/bits/stdio2.h:100:10: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  100 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  101 |    __va_arg_pack ());
      |    ~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Comment 1 Mike Gilbert gentoo-dev 2020-05-08 21:25:23 UTC
I'm unable to reproduce this with gcc-10.1.0.
Comment 2 Philipp 2020-05-09 09:21:26 UTC
(In reply to Mike Gilbert from comment #1)
> I'm unable to reproduce this with gcc-10.1.0.

This happens to me on all of my machines as well.
As far as I can tell, you need -O3 to trigger the problem.
Can you test that, please?
Comment 3 Mike Gilbert gentoo-dev 2020-05-09 14:47:37 UTC
Confirmed with -O3 locally.
Comment 4 Vasco Gervasi 2020-05-21 06:39:38 UTC
Same error with 245.5.
Comment 5 Vasco Gervasi 2020-05-23 17:06:45 UTC
Seems that a fix is available upstream:
https://github.com/systemd/systemd/pull/15762

Not sure if it part of 245.5.
Comment 6 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2020-07-20 20:25:08 UTC
(In reply to Vasco Gervasi from comment #5)
> Seems that a fix is available upstream:
> https://github.com/systemd/systemd/pull/15762
> 
> Not sure if it part of 245.5.

Appears to only be in 246-rc1:

systemd $ git tag --contains 9b10700
v246-rc1
Comment 7 Mike Gilbert gentoo-dev 2020-07-26 17:06:37 UTC
*** Bug 733236 has been marked as a duplicate of this bug. ***
Comment 8 André Terpstra 2020-08-08 17:20:52 UTC
Same problem here
Comment 9 André Terpstra 2020-08-08 17:29:18 UTC
Let me add that 3 other ebuilds failed to compile with -O3 (gcc-10.2.0):

- sys-process/audit
- sys-apps/iproute2
- app-admin/logrotate

I discovered this when recompiling my entire system (amd64 stable) after upgrading just gcc to the unstable 10.2.0 version (and recompiling libtool according to the wiki). The remaining almost 1,000 ebuilds compiled just fine.

Not sure whether this belongs here but I hesitate to open multiple bugs for what may be one problem.
Comment 10 Mike Gilbert gentoo-dev 2020-08-08 18:01:57 UTC
Separate bugs for separate packages please.

Closing this since it has been fixed in systemd-246.