-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
redis-cli build broken on Debian/Bookworm (librdb use-after-free) #20757
Comments
Is adding just |
The original Makefile is below. I guess
The below will replace the original WARNS. So "-Wall -Wextra -pedantic" is also needed.
I have also created a new PR below to fix it. Please help to review and approve it. Thanks. |
Correct. They're technically not needed, but it makes for the smallest change with upstream. As mentioned in the upstream bug report: removing |
An alternative fix might be to prefer gcc-11 on Bookworm. There are various reports that gcc-12 is not that good. diff --git a/sonic-slave-bookworm/Dockerfile.j2 b/sonic-slave-bookworm/Dockerfile.j2
index 145ba7d0a..58d00cfcd 100644
--- a/sonic-slave-bookworm/Dockerfile.j2
+++ b/sonic-slave-bookworm/Dockerfile.j2
@@ -25,6 +25,18 @@ COPY ["no-check-valid-until", "/etc/apt/apt.conf.d/"]
{%- if CROSS_BUILD_ENVIRON != "y" %}
COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"]
+# gcc-12 in bookworm has trouble with certain false positives. Prefer gcc-11
+# instead.
+# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1006803
+# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008630
+# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1032130
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106776
+# https://github.com/redis/librdb/issues/55
+RUN apt-get install -y gcc-11 g++-11 && \
+ update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-11 20 && \
+ update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-11 20 && \
+ update-alternatives --set cc /usr/bin/gcc-11 && \
+ update-alternatives --set c++ /usr/bin/g++-11
{%- else %}
COPY ["sources.list.amd64", "/etc/apt/sources.list"]
{%- if CONFIGURED_ARCH == "armhf" %} This works too. If we only observe trouble with librdb, we can probably go with the former patch. But if more compile warnings turn up as false positive errors, then this could be an alternative fix. |
…ree) (sonic-net#20759) Fix sonic-net#20757 Why I did it To Fix the issue: redis-cli build broken on Debian/Bookworm (librdb use-after-free) sonic-net#20757 How I did it This issue is a known open issue below: redis/librdb#55 According to Walter Doekes's solution, currently to work around it by adding -floto=auto compiler option. make -j$(SONIC_CONFIG_MAKE_JOBS) WARNS='-Wall -Wextra -pedantic -flto=auto'
…ree) (#20759) Fix #20757 Why I did it To Fix the issue: redis-cli build broken on Debian/Bookworm (librdb use-after-free) #20757 How I did it This issue is a known open issue below: redis/librdb#55 According to Walter Doekes's solution, currently to work around it by adding -floto=auto compiler option. make -j$(SONIC_CONFIG_MAKE_JOBS) WARNS='-Wall -Wextra -pedantic -flto=auto'
…ree) (sonic-net#20759) Fix sonic-net#20757 Why I did it To Fix the issue: redis-cli build broken on Debian/Bookworm (librdb use-after-free) sonic-net#20757 How I did it This issue is a known open issue below: redis/librdb#55 According to Walter Doekes's solution, currently to work around it by adding -floto=auto compiler option. make -j$(SONIC_CONFIG_MAKE_JOBS) WARNS='-Wall -Wextra -pedantic -flto=auto'
Description
In 9685498 redis-rdb-tool is replaced by rdb-cli.
The new build of redis-cli fails on Debian/Bookworm because of this (seemingly) false positive compiler error:
redis/librdb#55
Looks like this:
Steps to reproduce the issue:
make target/files/bookworm/rdb-cli
Workaround
Disable
-Werror
and maybe add-flto=auto
per the rdb issue 55 mentioned above:Proper fix
Not sure.
Cheers,
Walter Doekes
OSSO B.V.
The text was updated successfully, but these errors were encountered: