systemd-systemctl-native broken after update to walnascar #poky #yocto
Hi,
when we upgrade poky to walnascar, our builds fail due to systemd-systemctl-native (please find the log attached).
As a workaround we disabled Werror-nonnull with a simple .bbappend:BUILD_CFLAGS += "-Wno-error=nonnull"
We managed to narrow down the issue to our use of DEBUG_BUILD=1 in local.conf. Images can be built again when we remove it. However, we struggle to solve this issue on our own. Is it possible for anyone to reproduce this issue? Adding DEBUG_BUILD=1 to local.conf should be enough, then bitbake systemd-systemctl-native should fail.
Greetings,
Jan
Quoted 6 lines · Jan Kircher via lists.yoctoproject.org
when we upgrade poky to walnascar, our builds fail due to systemd-systemctl-native (please find the log attached).
As a workaround we disabled Werror-nonnull with a simple .bbappend:
BUILD_CFLAGS+= "-Wno-error=nonnull"We managed to narrow down the issue to our use of DEBUG_BUILD=1 in local.conf. Images can be built again when we remove it. However, we struggle to solve this issue on our own. Is it possible for anyone to reproduce this issue? Adding DEBUG_BUILD=1 to local.conf should be enough, then bitbake systemd-systemctl-native should fail.
Works for me :-/ What host compiler and distro are you using?
$ gcc --version gcc (Debian 12.2.0-14) 12.2.0 Copyright (C) 2022 Free Software Foundation, Inc. $ cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
The actual issue is:
In file included from /usr/include/string.h:548,
from ../git/src/systemd/sd-id128.h:22,
from ../git/src/shared/creds-util.c:9:In function ‘memcpy’,
inlined from ‘encrypt_credential_and_warn’ at../git/src/shared/creds-util.c:1090:17:/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10: error:
argument 2 null where non-null expected [-Werror=nonnull]
29 | return __builtin___memcpy_chk (__dest, __src, __len,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30 | __glibc_objsize0 (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10: note: in a call to built-in function ‘__builtin___memcpy_chk’
In function ‘memcpy’,
inlined from ‘encrypt_credential_and_warn’ at../git/src/shared/creds-util.c:1091:17:/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10: error:
argument 2 null where non-null expected [-Werror=nonnull]
29 | return __builtin___memcpy_chk (__dest, __src, __len,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30 | __glibc_objsize0 (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10: note: in a call to built-in function ‘__builtin___memcpy_chk’
You can probably see how that argument ends up being null, and submit a patch to systemd upstream?
Alex
Quoted 9 lines · Jan Kircher via lists.yoctoproject.org
Hi,
when we upgrade poky to walnascar, our builds fail due to systemd-systemctl-native (please find the log attached).
As a workaround we disabled Werror-nonnull with a simple .bbappend:
BUILD_CFLAGS+= "-Wno-error=nonnull"We managed to narrow down the issue to our use of DEBUG_BUILD=1 in local.conf. Images can be built again when we remove it. However, we struggle to solve this issue on our own. Is it possible for anyone to reproduce this issue? Adding DEBUG_BUILD=1 to local.conf should be enough, then bitbake systemd-systemctl-native should fail.
I think you have uncovered a systemd bug, I have sent a possible fix upstream, please test it in your scenario and see if it work.
https://github.com/systemd/systemd/pull/37017
I observed few things while looking at your build logs. The failing file is compiled with -O0 by default but when we do a DEBUG_BUILD = "1" it appends -Og -g to compiler flags, -Og != O0 so we are kind of overriding upstream's behavior and thusly it may find problems like this, bigger issue is it is untested path.
Secondly, you observed this problem when compiling a native package, I wonder if there is value in extending DEBUG_BUILD to non-target packages at all unless we want to debug native/nativesdk/cross packages which often is not the case. So maybe we should limit the scope of DEBUG_BUILD to just target packages.
Quoted 15 lines
Greetings,
Jan-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#13587): https://lists.yoctoproject.org/g/poky/message/13587
Mute This Topic: https://lists.yoctoproject.org/mt/112083239/1997914
Mute #poky:https://lists.yoctoproject.org/g/poky/mutehashtag/poky Mute #yocto:https://lists.yoctoproject.org/g/poky/mutehashtag/yocto Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/poky/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 1 line
-Khem