-
Notifications
You must be signed in to change notification settings - Fork 528
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
Fix GCC v13 LTO build [-Walloc-size-larger-than=] #1929
base: master
Are you sure you want to change the base?
Conversation
Thank you for improving so many declarations! Please add your contact info to CONTRIBUTORS file.
I marked this PR as Draft and adjusted PR title/description (i.e. future master commit message) for consistency with similar fixes. PR description will need to be adjusted further to remove temporary discussion and to explain why we are making so many seemingly unrelated changes. BTW, how did you decide which types/expressions to change? Do all of the proposed changes cascade from fixing the original compiler warning that is now quoted in this PR description? In other words, can any one of the proposed changes be undone without harming the build? After you are done, can we enable
You are right -- we should not change StoreEntry::swap_dirn to size_t. Ideally, swap_filen and swap_dirn should probably be wrapped inside something like std::optional, but that requires a lot of non-trivial out-of-scope work. For now, I would use static_cast if possible or try to use Less() from SquidMath.h otherwise. In that context, we know for sure that dirno is not negative, of course. Disclaimer: I have not reviewed many changes in this PR. |
yes, it's following the rabbit hole of changing #1118 (comment) and after trying to compile in the context of the debian package rebuild and with openssl as used in ansible role https://github.com/juju4/ansible-squid/ On |
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.
I have not reviewed the entire PR, but these requests may help you make progress.
Do you recall how pconn.h changes were dragged into the mix? Perhaps there was another build error?
In C++ code, please use static_cast (and other named casts) if possible. |
... but with |
Current change results in compilation ending successfully. |
Reverted all pconn.* changes. not compiling
|
I think that @yadij work in 2d232fa#diff-44d0ed5297324f87595e0aad7e946626d844235cbb38a0d02efac9bd1741f795 covers this. If yes, can be closed. Please confirm @rousskov |
Thank you. We now know that the problem affects more than just store/Disks.cc code. I was not aware of that fact before. We will need to fix pconn code after all, despite extra problems such a fix will need to address. I was hoping to avoid that extra work, but that is not an option AFAICT.
Sorry, I do not understand what you would like me to confirm. I would rather not review another PR in this PR, but commit 2d232fa in #1118 does not appear to address the problem you faced when modifying pconn code in this PR, does it? FWIW, I do not know why Amos committed to old #1118 when you were making good progress with this PR #1929. Hopefully, he clarifies, and we would not have to work on two very similar PRs! @yadij, do you want to close this recently (partially) reviewed PR and resume pushing forward old #1118 instead? |
If @juju4 is okay with that. Up to you. Notes:
|
If it were up to me, then this recently (partially) reviewed PR backed by an active first-time contributor would continue to be advanced1, but I do not insist on any strategy. @juju4, what is your preference?
If you refer to commit 2d232fa, then I hope that it is not used by anybody until my concern is addressed. Footnotes
|
I'm fine either way, whatever get issue fixed and well. |
any plan on this? |
Since nobody seems to be driving this, I plan to use this PR branch to address pconn.cc breakage without triggering the earlier problem and then ask you to retest. This plan may require a prerequisite PR for pconn improvements, but it is too early for me to say. I hope to start implementing this plan within a week or two. |
In that case, can you finalize the checks on PR #1118 and mark it for merge if it passes. |
What do you mean by "finalize the checks"? Both PRs require significant code changes before either can be merged, as I mentioned earlier. I also mentioned why I prefer to continue to work with this PR. If you would like to change my plan to work with this PR despite saying that it is up to me, please explain why that plan should be changed. |
This reduction is not just a cosmetic improvement. It increases the chance of discovering stale/mismatching printf() formats and similar problems when reviewing the diff of changes (because it places the modified line much closer to actual index use cases inside the loop), improving our overall confidence in these changes. Also upgraded Disks::store() and Disks::Dir() argument to size_t because these methods use SwapDirByIndex() that was upgraded in an earlier branch commit. I checked that the removed variants are no longer used before removing those variants (by making Squid with those methods explicitly deleted).
It is derived from upgraded firstCandidate. It is used as an argument for upgraded SwapDirByIndex().
They were necessary (LTO builds fails without them AFAICT), and they themselves were not wrong (just insufficient).
... because we are not upgrading its source -- Store::Disk::index (yet). This change also fixes "make check".
... because we are not upgrading its sources -- Store::Disk::index and UFSDirToGlobalDirMapping[i] (yet).
Done (as of branch commit b21738e). I also committed a few polishing changes. Unfortunately, my attempts to reproduce the primary problem with GCC v12 on Ubuntu 22.04 (by adding @juju4, please review my changes and, most importantly, retest. Thank you. P.S. I will help fixing PR description later, if needed, once we are happy with code changes. |
@juju4, the above request still stands. Our CI cannot tell which variation of that info should be used, but once you add one of the two variants to CONTRIBUTORS, that check should succeed. If you want to add a completely different name and email pair, consider changing your GitHub account setup -- GitHub gets one of those variants from your account information IIRC. If you would like to add nothing (i.e. keep CONTRIBUTORS intact), we should be able to accommodate that as well (but it will probably require some manual action to work around that CI check limitations, and your GitHub contact info will still be a part of the official commit metadata). |
|
Not much time in the end and got stopped in configure...
what is the matching package? Note: it seems the basic configure without arguments does not need it and can build fine. but as mirroring debian package arguments, much more. |
Since this PR does not change anything related to ./configure, that problem feels out of scope. Did ./configure step work before this PR changes? If yes, what has changed (other than changes introduced by this PR)? Otherwise, perhaps we can go back to your tests that were failing when you posted this PR (those tests failed after ./configure, not during ./configure)?
I do not know enough about your build environment to answer your question. I see much earlier scary warnings, but I do not know whether they are relevant:
Perhaps it is possible to make progress by not mirroring any external/independent package arguments (at least for now)? The build log you referenced also talks about squid-6.12.tar.gz. Is it actually building this PR code?? |
Not for now. I first need an environment that build and that have some testing. My ansible role has that for debian package upstream or the rebuild deb package with openssl for which I started to dig this. I'm extending to source build before adding and validating it works before adding patch either against 6.12 or latest HEAD. the deb package rebuild works. |
Unfortunately, I am not familiar with half of the terms you are using, and I still do not understand why you cannot repeat the tests that initiated this PR (and that failed during FWIW, the current goal is (or should be) to validate whether PR changes are sufficient to fix LTO build. Since I cannot reproduce LTO build failures in my build environment, I cannot perform that validation myself. If you can focus on that goal, please do so. Otherwise, I hope you will figure out how to fix those (seemingly unrelated) problems and then get to testing this PR changes. I am happy to help, but I do not know much about ansible, "ansible role", "debian package upstream", "rebuild deb package", "extending to source build" and related customizations/options/flags... |
After more manual review
Is there anything more that you want me to test? |
It looks like after 2022 commit 5a2409b, that "do not use" advice became misleading in rare cases where shared library support is disabled for reasons other than an explicit
Glad you were able to reproduce the error this PR is targeting.
Great. AFAICT, that result confirms that this PR accomplishes its primary goal. Please correct me if I am wrong. To move this PR forward, I adjusted PR title to use GCC v13 because that is what you are testing with (AFAICT) and removed temporary comments from PR description (i.e. the future official commit message if this PR is merged). I am also marking this PR as ready for review.
This problem is best addressed by another PR. Right now, I do not know how to address that problem. Filing a bug report with Squid Bugzilla may the right next step. If you do that, please mention whether the problem exists only in LTO-enabled builds.
I cannot think of anything but please fix this PR CONTRIBUTORS file as discussed earlier. |
Tested on Ubuntu 24.04 and GCC v13.2.0.