Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

../src/basic/log.h:107:9: error: ‘%s’ directive argument is null [-Werror=format-overflow=] #14782

Closed
mbiebl opened this issue Feb 5, 2020 · 1 comment · Fixed by #14794
Labels
bug 🐛 Programming errors, that need preferential fixing network
Milestone

Comments

@mbiebl
Copy link
Contributor

mbiebl commented Feb 5, 2020

I'm getting build failures with systemd master (641aa41)

So far I can only reproduce it when building with -Db_lto=false

$ gcc --version
gcc (Debian 9.2.1-28) 9.2.1 20200203
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ ld --version
GNU ld (GNU Binutils for Debian) 2.34
Copyright (C) 2020 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
[536/1910] cc -Isrc/network/70b1c79@@networkd-core@sta -Isrc/network -I../src/network -Isrc/basic -I../src/basic -Isrc/boot -I../src/boot -Isrc/shared -I../src/shared -Isrc/systemd -I../src/systemd -Isrc/journal -I../src/journal -Isrc/journal-remote -I../src/journal-remote -Isrc/nspawn -I../src/nspawn -Isrc/resolve -I../src/resolve -Isrc/timesync -I../src/timesync -I../src/time-wait-sync -Isrc/login -I../src/login -Isrc/udev -I../src/udev -Isrc/libudev -I../src/libudev -Isrc/core -I../src/core -Isrc/shutdown -I../src/shutdown -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/libsystemd-network -I../src/libsystemd-network -I. -I../ -I../src/network/netdev -I../src/network/tc -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 -g -O2 -fdebug-prefix-map=/home/michael/git/systemd=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -MD -MQ 'src/network/70b1c79@@networkd-core@sta/networkd-dhcp-server.c.o' -MF 'src/network/70b1c79@@networkd-core@sta/networkd-dhcp-server.c.o.d' -o 'src/network/70b1c79@@networkd-core@sta/networkd-dhcp-server.c.o' -c ../src/network/networkd-dhcp-server.c
FAILED: src/network/70b1c79@@networkd-core@sta/networkd-dhcp-server.c.o 
cc -Isrc/network/70b1c79@@networkd-core@sta -Isrc/network -I../src/network -Isrc/basic -I../src/basic -Isrc/boot -I../src/boot -Isrc/shared -I../src/shared -Isrc/systemd -I../src/systemd -Isrc/journal -I../src/journal -Isrc/journal-remote -I../src/journal-remote -Isrc/nspawn -I../src/nspawn -Isrc/resolve -I../src/resolve -Isrc/timesync -I../src/timesync -I../src/time-wait-sync -Isrc/login -I../src/login -Isrc/udev -I../src/udev -Isrc/libudev -I../src/libudev -Isrc/core -I../src/core -Isrc/shutdown -I../src/shutdown -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/libsystemd-network -I../src/libsystemd-network -I. -I../ -I../src/network/netdev -I../src/network/tc -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 -g -O2 -fdebug-prefix-map=/home/michael/git/systemd=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -MD -MQ 'src/network/70b1c79@@networkd-core@sta/networkd-dhcp-server.c.o' -MF 'src/network/70b1c79@@networkd-core@sta/networkd-dhcp-server.c.o.d' -o 'src/network/70b1c79@@networkd-core@sta/networkd-dhcp-server.c.o' -c ../src/network/networkd-dhcp-server.c
In file included from ../src/basic/macro.h:586,
                 from ../src/basic/alloc-util.h:9,
                 from ../src/shared/conf-parser.h:10,
                 from ../src/network/networkd-dhcp-server.h:4,
                 from ../src/network/networkd-dhcp-server.c:5:
In function ‘link_push_uplink_dns_to_dhcp_server’,
    inlined from ‘dhcp4_server_configure’ at ../src/network/networkd-dhcp-server.c:242:37:
../src/basic/log.h:107:9: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  107 |         log_internal_realm(LOG_REALM_PLUS_LEVEL(LOG_REALM, (level)), __VA_ARGS__)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/shared/log-link.h:21:25: note: in expansion of macro ‘log_internal’
   21 |                         log_internal(level, error, PROJECT_FILE, __LINE__, __func__, ##__VA_ARGS__); \
      |                         ^~~~~~~~~~~~
../src/shared/log-link.h:24:37: note: in expansion of macro ‘log_link_full’
   24 | #define log_link_debug(link, ...)   log_link_full(link, LOG_DEBUG, 0, ##__VA_ARGS__)
      |                                     ^~~~~~~~~~~~~
../src/network/networkd-dhcp-server.c:48:9: note: in expansion of macro ‘log_link_debug’
   48 |         log_link_debug(link, "Copying DNS server information from %s", link->ifname);
      |         ^~~~~~~~~~~~~~
../src/network/networkd-dhcp-server.c: In function ‘dhcp4_server_configure’:
../src/network/networkd-dhcp-server.c:48:67: note: format string is defined here
   48 |         log_link_debug(link, "Copying DNS server information from %s", link->ifname);
      |                                                                   ^~
In file included from ../src/basic/macro.h:586,
                 from ../src/basic/alloc-util.h:9,
                 from ../src/shared/conf-parser.h:10,
                 from ../src/network/networkd-dhcp-server.h:4,
                 from ../src/network/networkd-dhcp-server.c:5:
In function ‘link_push_uplink_ntp_to_dhcp_server’,
    inlined from ‘dhcp4_server_configure’ at ../src/network/networkd-dhcp-server.c:259:37:
../src/basic/log.h:107:9: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  107 |         log_internal_realm(LOG_REALM_PLUS_LEVEL(LOG_REALM, (level)), __VA_ARGS__)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/shared/log-link.h:21:25: note: in expansion of macro ‘log_internal’
   21 |                         log_internal(level, error, PROJECT_FILE, __LINE__, __func__, ##__VA_ARGS__); \
      |                         ^~~~~~~~~~~~
../src/shared/log-link.h:24:37: note: in expansion of macro ‘log_link_full’
   24 | #define log_link_debug(link, ...)   log_link_full(link, LOG_DEBUG, 0, ##__VA_ARGS__)
      |                                     ^~~~~~~~~~~~~
../src/network/networkd-dhcp-server.c:102:9: note: in expansion of macro ‘log_link_debug’
  102 |         log_link_debug(link, "Copying NTP server information from %s", link->ifname);
      |         ^~~~~~~~~~~~~~
../src/network/networkd-dhcp-server.c: In function ‘dhcp4_server_configure’:
../src/network/networkd-dhcp-server.c:102:67: note: format string is defined here
  102 |         log_link_debug(link, "Copying NTP server information from %s", link->ifname);
      |                                                                   ^~
In file included from ../src/basic/macro.h:586,
                 from ../src/basic/alloc-util.h:9,
                 from ../src/shared/conf-parser.h:10,
                 from ../src/network/networkd-dhcp-server.h:4,
                 from ../src/network/networkd-dhcp-server.c:5:
In function ‘link_push_uplink_sip_to_dhcp_server’,
    inlined from ‘dhcp4_server_configure’ at ../src/network/networkd-dhcp-server.c:277:37:
../src/basic/log.h:107:9: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  107 |         log_internal_realm(LOG_REALM_PLUS_LEVEL(LOG_REALM, (level)), __VA_ARGS__)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/shared/log-link.h:21:25: note: in expansion of macro ‘log_internal’
   21 |                         log_internal(level, error, PROJECT_FILE, __LINE__, __func__, ##__VA_ARGS__); \
      |                         ^~~~~~~~~~~~
../src/shared/log-link.h:24:37: note: in expansion of macro ‘log_link_full’
   24 | #define log_link_debug(link, ...)   log_link_full(link, LOG_DEBUG, 0, ##__VA_ARGS__)
      |                                     ^~~~~~~~~~~~~
../src/network/networkd-dhcp-server.c:151:9: note: in expansion of macro ‘log_link_debug’
  151 |         log_link_debug(link, "Copying SIP server information from %s", link->ifname);
      |         ^~~~~~~~~~~~~~
../src/network/networkd-dhcp-server.c: In function ‘dhcp4_server_configure’:
../src/network/networkd-dhcp-server.c:151:67: note: format string is defined here
  151 |         log_link_debug(link, "Copying SIP server information from %s", link->ifname);
      |                                                                   ^~
cc1: some warnings being treated as errors

Full build log is attached, where you can see all configure switches.

@mbiebl mbiebl added the bug 🐛 Programming errors, that need preferential fixing label Feb 5, 2020
@mbiebl
Copy link
Contributor Author

mbiebl commented Feb 5, 2020

build.txt

@yuwata yuwata added the network label Feb 5, 2020
@keszybz keszybz added this to the v245 milestone Feb 5, 2020
floppym added a commit to floppym/systemd that referenced this issue Feb 5, 2020
floppym added a commit to floppym/systemd that referenced this issue Feb 5, 2020
Since 98b0299, we log the interface
name automatically via log_link_debug().

Fixes: systemd#14782
floppym added a commit to floppym/systemd that referenced this issue Feb 5, 2020
Since 98b0299, we log the interface
name automatically via log_link_debug().

Fixes: systemd#14782
cdown pushed a commit that referenced this issue Feb 6, 2020
Since 98b0299, we log the interface
name automatically via log_link_debug().

Fixes: #14782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Programming errors, that need preferential fixing network
Development

Successfully merging a pull request may close this issue.

3 participants