-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[breakpad] Fix compilation with gcc-13 #26479
Conversation
9649377
to
4bb258e
Compare
@artem-ogre Hello and thank you for providing this suggested patch. Still, the current master branch of Breakpad has no hotfix integrated: https://chromium.googlesource.com/breakpad/breakpad/+/refs/heads/main/src/client/linux/handler/minidump_descriptor.h I also did not find any occurrence of this patch or bug mentioned in upstream's bug list: https://issues.chromium.org/issues?q=componentid:1629899%2B%20cstdint Could you please confirm the upstream is aware of this bug somehow? I can mention Gentoo has a similar patch, but they didn't change the -Wnonnull: https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-util/breakpad/files/breakpad-2022.07.12-gcc13.patch |
@uilianries The master (https://chromium.googlesource.com/breakpad/breakpad/+/refs/heads/main/src/processor/exploitability_linux.cc) does not call |
The function where |
As a side note: You have a lot of experience supporting packaging libraries. You probably have the same opinion that treating warnings as errors is not a great idea when providing a library source to the users (perfectly fine for the development workflow). It is rather unconventional that breakpad does this. |
@uilianries Here, I found |
@artem-ogre Thank you for pointing out those sources. I can reproduce your reported error by using GCC13 on Linux: breakpad-20210521-linux-gcc13.log When applying a patch ONLY to include cstdint is passes for me, no further errors: breakpad-20210521-linux-gcc13-patched.log I would request to simplify your patch to only include cstdint. I understand your concern about, but we have several projects using Werror that don't cause problems for us. |
@artem-ogre out of curiosity, the Breakpad project offers the newer tag 2023.06.01. Meanwhile, the version maintained in CCI is based on 20210521. Do you need a newer package version? |
@uilianries I would appreciate if you could indicate a way forward so that it also builds for my configuration :) |
Right now my main concern is to make the existing configuration work with Ubuntu 24.04 🙂 |
Maybe if I share my profile and compiler info this will help you reproduce the problem? I'm on Ubuntu 24.04 Noble Numbat. └─$ g++ --version g++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 Copyright (C) 2023 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. My conan profile looks something like this:
Conan version is 2.11.0 |
Would it be fine applying a patch similar to this one: https://chromium.googlesource.com/breakpad/breakpad/+/30c7f3cfc11cdbf93a12efbe9d46c66d9785879e%5E%21/ |
Indeed there is something more peculiar. I started a new Docker container with Ubuntu 24.04 and GCC13 installed. Now I can reproduce your case regarding the fclose: |
Yes, please. I just tested using that patch it really works: Please, simplify your current patch to include cstdint. Then add a second patch, only addressed to this official one. Thank you for keeping pushing this PR. |
Done, please check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Both patches are okay, they are integrated in the upstream or by other package managers.
- Patch for fclose prevents -Wnonnull: https://chromium.googlesource.com/breakpad/breakpad/+/30c7f3cfc11cdbf93a12efbe9d46c66d9785879e%5E%21/
- Patch for cstdint is integrated in Gentoo: https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-util/breakpad/files/breakpad-2022.07.12-gcc13.patch
Thank you for your PR!
Just wanted to express my opinion on this: treating warnings as errors for a library provided as source is like having a ticking code-rot bomb. It limits the users in how they can build the library. Just one new warning introduced in a more recent version of the compiler and the bomb goes off :) I'm rather confident that this breakpad version will break with more recent gcc versions. It happened in the past and will happen in the future. |
@artem-ogre Thank you for expressing your concern, indeed it may break in the future. As you commented about using a newer version of Breakpad, it could be included in a patch for -Werror a next PR, to avoid more delays in this one. In case it's a blocker for you right now, please, feel free to share your build log again. |
Can this be merged? Anything else I can do? |
Looks like the pre-checks are stuck? |
Apologies - it failed but did not publish the result. There is an issue with an upstream recipe - will sort this out |
Summary
Changes to recipe: breakpad/cci.20210521
Motivation
Breakpad would not compile with gcc-13 on Ubuntu 24.02 Noble Numbat
Details
1. Fix missing include
See for reference: https://gcc.gnu.org/gcc-13/porting_to.html
In particular header
<cstdint>
now needs to be included directly to compile with gcc-132. Fix
-Wnonnull
errorfclose
is called on a null file (see the if-check above it). The patch removes the call tofclose