Bug#985948: libubootenv-tool: Debug lines from fw_printenv break RAUC
Hi all, 2021年4月7日(水) 18:39 Andreas Henriksson : > > Control: severity -1 grave > > On Wed, Apr 07, 2021 at 11:20:18AM +0200, Bastian Germann wrote: > > Control: severity -1 important > > > > Am 07.04.21 um 11:10 schrieb Andreas Henriksson: > > > Could we please just add a patch that either just rips out the NDEBUG > > > lines (or inverts the login to #ifdef DEBUG ) ?! Such a patch could/should > > > be forwarded upstream as well A library should not print to stdout > > > like this! > > I am not the maintainer. > > I agree that the maintainer should have done a better job at reviewing > rather than blindly applying your patch and also verifying that the new > version actually fixes the bugs that is claimed to be closed in the > changelog. > > People must have been sleeping while writing this debian/rules > file. Most content is entirely unused because cmake build type > is *not* release! > > > You can hand in such a patch to speed up that process. > > I've submitted a merge-request that fixes the imminent problems for > review at: > https://salsa.debian.org/debian/libubootenv/-/merge_requests/3 > > Please not that I'm nowhere near a cmake expert. I've only fixed > the imminent bug and some glaring problems in debian/rules. > I've left comments in commit messages about further improvements, > but there are likely entirely different and better ways of > doing things. Thank you for the patch. I will review this carefully. > > > I am reducing the severity as pointed out before. > > And I'm raising it back up again, because this is definitely an RC bug. > Breaking the output of fw_printenv breaks multiple programs (including > but not limited to mender-client) which parses that output. > I agree about this. Best regards, Nobuhiro -- Nobuhiro Iwamatsu
Bug#985948: libubootenv-tool: Debug lines from fw_printenv break RAUC, mender-client, etc.
Hello again, On Wed, Apr 07, 2021 at 11:36:30AM +0200, Andreas Henriksson wrote: [...] > I've submitted a merge-request that fixes the imminent problems for > review at: > https://salsa.debian.org/debian/libubootenv/-/merge_requests/3 [...] I've studied things a bit more and updated the merge-request with more of a cleanup approach that simply drops unused settings and then just adds defining NDEBUG via debhelper variables. (More detailed info in each commit message.) Please speak up ASAP if you're interested in reviewing this and doing a maintainer upload, otherwise I might not wait very long before I make use the 0-day NMU policy. I'd really like to see this be fixed in bullseye very soon. Please also speak up if you don't have time and want me to proceed with the NMU and dealing with the unblock request so I know! Regards, Andreas Henriksson
Bug#985948: libubootenv-tool: Debug lines from fw_printenv break RAUC
Control: severity -1 important Am 07.04.21 um 11:10 schrieb Andreas Henriksson: Could we please just add a patch that either just rips out the NDEBUG lines (or inverts the login to #ifdef DEBUG ) ?! Such a patch could/should be forwarded upstream as well A library should not print to stdout like this! I am not the maintainer. You can hand in such a patch to speed up that process. I am reducing the severity as pointed out before.
Bug#985948: libubootenv-tool: Debug lines from fw_printenv break RAUC
Control: affects -1 mender-client Hi, On Sat, Apr 03, 2021 at 02:52:34PM +0200, Bastian Germann wrote: > Control: tags -1 patch > > A patch is enclosed. [...] > CMAKE_FLAGS = \ > -DCMAKE_VERBOSE_MAKEFILE=ON \ > - -DCMAKE_C_FLAGS_RELEASE="$(CFLAGS)" \ > + -DCMAKE_C_FLAGS_RELEASE="$(CFLAGS) NDEBUG=" \ > -DCMAKE_EXE_LINKER_FLAGS_RELEASE="$(LDFLAGS)" \ > -DBUILD_DOCS=ON \ > -DCMAKE_INSTALL_INCLUDEDIR="include/$(DEB_HOST_MULTIARCH)" Your patch seems to have been applied in the last upload and this bug report was closed. I've reopened the bug report, as the bug seems to still exist: $ dpkg -l libubootenv0.1 | grep ^ii libubootenv0.1:armhf 0.3-2armhfLibrary to access U-Boot environment - runtime $ strings /usr/lib/arm-linux-gnueabihf/libubootenv.so.0.3 | grep Environment Environment %s, copy %d Environment FLAGS %s $ sudo fw_printenv | head -n1i Environment OK, copy 1 FYI This extra debug output also breaks mender-client. Could we please just add a patch that either just rips out the NDEBUG lines (or inverts the login to #ifdef DEBUG ) ?! Such a patch could/should be forwarded upstream as well A library should not print to stdout like this! Regards, Andreas Henriksson
Bug#985948: libubootenv-tool: Debug lines from fw_printenv break RAUC
Control: tags -1 patch A patch is enclosed. From: Bastian Germann Date: Sat, 3 Apr 2021 14:36:37 +0200 Subject: Compile with NDEBUG set This makes the tools' output more compatible with the original fw_*env tools. Signed-off-by: Bastian Germann --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 3b4cf35..e668526 100755 --- a/debian/rules +++ b/debian/rules @@ -4,7 +4,7 @@ CMAKE_FLAGS = \ -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DCMAKE_C_FLAGS_RELEASE="$(CFLAGS)" \ + -DCMAKE_C_FLAGS_RELEASE="$(CFLAGS) NDEBUG=" \ -DCMAKE_EXE_LINKER_FLAGS_RELEASE="$(LDFLAGS)" \ -DBUILD_DOCS=ON \ -DCMAKE_INSTALL_INCLUDEDIR="include/$(DEB_HOST_MULTIARCH)"
Bug#985948: libubootenv-tool: Debug lines from fw_printenv break RAUC
On Fri, 26 Mar 2021 16:53:31 +0100 Paul Jena wrote: Package: libubootenv-tool Version: 0.3-1 Severity: grave Hello, there are compatibility problems with RAUC and the libubootenv-tool package. RAUC requires the fw_setenv and fw_printenv utilites to interact with the u-boot-environment. After Installing the libubootenv-tool package to get fw_printenv and fw_setenv, RAUC didnt work properly. i.e.: How is this a grave bug? RAUC explicitly says in its Kconfig: "To interact with U-Boot, fw_printenv and fw_setenv from u-boot-tools are used." So using it with libubootenv's tools is not expected. After building a fw_printenv that doesnt print the Debug Mesaage the Rauc worked properly again. (I looked into the source code of libubootenv and saw that passing the NDEBUG compiler flag supresses the Debugging Messages: https://salsa.debian.org/debian/libubootenv/-/blob/master/src/uboot_env.c#L946) i.e: $ fw_printenv BOOT_ORDER BOOT_ORDER=B A $ rauc status ... === Bootloader === Activated: rootfs.1 (B) ... Perhaps it is desirable that libubootenv-tool provides output similiar to the native u-boot envtools to support compability, by building it in downstream with the NDEBUG compiler flag. Setting NDEBUG is a good solution to the problem.
Bug#985948: libubootenv-tool: Debug lines from fw_printenv break RAUC
Package: libubootenv-tool Version: 0.3-1 Severity: grave Hello, there are compatibility problems with RAUC and the libubootenv-tool package. RAUC requires the fw_setenv and fw_printenv utilites to interact with the u-boot-environment. After Installing the libubootenv-tool package to get fw_printenv and fw_setenv, RAUC didnt work properly. i.e.: $ rauc status ... === Bootloader === Activated: (null) ((null)) <-- should look like "Activated: rootfs.0 (A) ... The reason for this is that RAUC is not able to parse the output of fw_printenv with the added debug message "Environment OK, copy 0": $ fw_printenv BOOT_ORDER Environment OK, copy 0 BOOT_ORDER=B A After building a fw_printenv that doesnt print the Debug Mesaage the Rauc worked properly again. (I looked into the source code of libubootenv and saw that passing the NDEBUG compiler flag supresses the Debugging Messages: https://salsa.debian.org/debian/libubootenv/-/blob/master/src/uboot_env.c#L946) i.e: $ fw_printenv BOOT_ORDER BOOT_ORDER=B A $ rauc status ... === Bootloader === Activated: rootfs.1 (B) ... Perhaps it is desirable that libubootenv-tool provides output similiar to the native u-boot envtools to support compability, by building it in downstream with the NDEBUG compiler flag. Paul Jena -- System Information: Debian Release: bullseye/sid APT prefers testing APT policy: (500, 'testing') Architecture: armhf (armv7l) Kernel: Linux 4.14.184-rt84-stable-16216-gdf370847d809 (SMP w/4 CPU threads; PR> Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) Versions of packages libubootenv-tool depends on: ii libc6 2.31-9 ii libubootenv0.1 0.3-1 ii zlib1g 1:1.2.11.dfsg-2 libubootenv-tool recommends no packages. libubootenv-tool suggests no packages. -- no debconf information