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
tool: use our own stderr variable #11958
Conversation
82a29a6
to
174cdcd
Compare
We've recently change our own stderr variable to use the standard name `stderr` (presumably to avoid bugs where someone is using `stderr` instead of the curl-tool specific variable). This solution needed to override the standard `stderr` symbol via the preprocessor. This in turn didn't play well with unity builds and caused curl tool to crash or stay silent due to an uninitialized stderr. This hard to find issue was fixed by manually breaking out one file from the unity sources. To avoid two these two tricks, this patch implements a different solution: Restore using our own local variable for our stderr output and leave `stderr` as-is. To avoid using `stderr` by mistake, add a `checksrc` rule (based on logic we already used in lib for `strerror`) that detects any `stderr` use in `src` and points to using our own variable instead: `tool_stderr`. Follow-up to 06133d3 Follow-up to 2f17a9b Closes curl#11958
174cdcd
to
21fa8b8
Compare
Earlier this year we changed our own stderr variable to use the standard name `stderr` (to avoid bugs where someone is using `stderr` instead of the curl-tool specific variable). This solution needed to override the standard `stderr` symbol via the preprocessor. This in turn didn't play well with unity builds and caused curl tool to crash or stay silent due to an uninitialized stderr. This was a hard to find issue, fixed by manually breaking out one file from the unity sources. To avoid two these two tricks, this patch implements a different solution: Restore using our own local variable for our stderr output and leave `stderr` as-is. To avoid using `stderr` by mistake, add a `checksrc` rule (based on logic we already used in lib for `strerror`) that detects any `stderr` use in `src` and points to using our own variable instead: `tool_stderr`. Follow-up to 06133d3 Follow-up to 2f17a9b Closes curl#11958
Hi, FYI, we are trying to build curl 8.4.0 (following the CVE announcement), and somehow the changes here makes the build (we use autotools by default, not cmake) error by default. It errors actually with what checksrc considers only as warnings (so maybe we should use some option to not stop the build ?):
and I tried to apply the following patch:
which "unblocked" the build, however it really doesn't sound expected at all considering what checksrc is meant to check ! ;) So I am not sure if we are the only ones or if everyone has this problem. |
Ah actually it's the file
I will open an issue for that, so a new release tarball is created (as everyone will try to rebuild curl following the CVE announcement). |
Regression from e5bb88b curl#11958 Bug: curl#11958 (comment) Reported-by: Romain Geissler Closes #xxxxx
Yes, thanks for reporting this. I've linked #12084 after noticing it. |
I wonder why this slipped through the distcheck CI run. Maybe |
Regression from e5bb88b #11958 Bug: #11958 (comment) Reported-by: Romain Geissler Fixes #12084 Closes #12085
Earlier this year we changed our own stderr variable to use the standard name `stderr` (to avoid bugs where someone is using `stderr` instead of the curl-tool specific variable). This solution needed to override the standard `stderr` symbol via the preprocessor. This in turn didn't play well with unity builds and caused curl tool to crash or stay silent due to an uninitialized stderr. This was a hard to find issue, fixed by manually breaking out one file from the unity sources. To avoid two these two tricks, this patch implements a different solution: Restore using our own local variable for our stderr output and leave `stderr` as-is. To avoid using `stderr` by mistake, add a `checksrc` rule (based on logic we already used in lib for `strerror`) that detects any `stderr` use in `src` and points to using our own variable instead: `tool_stderr`. Follow-up to 06133d3 Follow-up to 2f17a9b Closes curl#11958
Regression from e5bb88b curl#11958 Bug: curl#11958 (comment) Reported-by: Romain Geissler Fixes curl#12084 Closes curl#12085
Earlier this year we changed our own stderr variable to use the standard
name
stderr
(to avoid bugs where someone is usingstderr
instead ofthe curl-tool specific variable). This solution needed to override the
standard
stderr
symbol via the preprocessor. This in turn didn't playwell with unity builds and caused curl tool to crash or stay silent due
to an uninitialized stderr. This was a hard to find issue, fixed by
manually breaking out one file from the unity sources.
To avoid two these two tricks, this patch implements a different
solution: Restore using our own local variable for our stderr output and
leave
stderr
as-is. To avoid usingstderr
by mistake, add achecksrc
rule (based on logic we already used in lib forstrerror
)that detects any
stderr
use insrc
and points to using our ownvariable instead:
tool_stderr
.Follow-up to 06133d3
Follow-up to 2f17a9b
Closes #11958
TOTEST: See how this work when running tests. There is no
UNITTEST
mode now,tool_stderr
needs to be initialized tostderr
for unittests. [PASSED]