-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
tests: update cookie expiry dates to far in the future #11610
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
Conversation
I wonder if we ever build or test on any platforms with 32 bit |
We do: mingw: |
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.
This breaks testing, needs update.
But how? I am not exactly sure what to do here. Dropping legacy platforms from testing isn't going to be accepted. Another option is to not run the tests that use post-2038 dates where they're never going to pass, but I'm not sure how to technically implement that. Is there a selective test exclusion facility in curl or its pipelines? |
By adapting the tests for platforms where Perhaps this could be done by making a variable for the test cases so that we can do |
@kanavin do you plan on addressing these problems? |
Yes, I do, although I'd rather convince you to drop 32 bit time_t systems from testing, and relegate them to retro computing museum where they belong. So we can focus time and effort on, oh, power grid and water supply and traffic control systems not collapsing in 2038. For background, fixing curl is a part of a broader effort to fix all known Y2038 issues in Yocto based linux stacks, so I'm juggling multiple tickets, upstream submissions and digging into large codebases I've never seen before: I'll get to it. |
If it would be very hard to get them working and this work solved a lot of problems, then we could have discussed that. But as we know, this PR mostly brings a visual change that isn't strictly necessary and I consider that a weak reason to break testing for a few legacy platforms. In the mean time, I have created a |
This work does solve problems, so let's discuss. Ensuring things are not going break down in 2038 is not just about extending time_t to 64 bits and recompiling. Components also can, and do place time into 32 bit variables internally, usually by oversight. Examples: Sometimes there is a configuration switch (off by default) which needs to be switched on to prevent copying time into 32 bits from happening: How can these problems be found in the first place? The only way to do it is to set system time to post-2038 and run components' test suites one by one. Which, in turn, requires that the test suites don't throw errors because they do not like the date. So no, this PR is not about ' visual change that isn't strictly necessary'. I did run curl's test suite with it, and I can confirm to you that no issues were found. Which you should be happy with, rather than be annoyed about. There's a lot of invisible 32 bit embedded infrastructure out there, it will still be 32 bit in 2038, and I'd say having electricity and water in your house is somewhat important.
Thanks, I'll use it, but small time_ts are only relevant to retro computing hobbyists at this point, usually because they have abandonware blobs that can't be recompiled, i.e. vintage games or old proprietary OSs. I still don't understand why you care for them this much. |
How to deprecated curl support for "small" time_t (or anything else really):
This is then not a promise that it actually will happen. It then also depends a lot on the reactions and feedback from the community. |
The community is going to reject the proposal. The major argument is going to be that 32 bit Debian - a popular, current distro - is still on 32 bit time_t (and not just on historical hardware - 32 bit arm is entirely current), they're still making plans, and the plans don't look particularly reassuring regarding timelines or specific steps to make it happen: Other Linux vendors seem to have abandoned 32 bit computing altogether. Yocto has the benefit of being a from-source distro generator, so we just flipped the switch and no one complained (so far): I apologize for being annoying, my goal is to run as many tests as I can think of in a complete system, ensure all issues are documented and all upstreams are notified. There's still a long list of things to look into, so there's only so much time I can allocate to any specific item. Each particular issue, such as this one, gets looked at in a round-robin schedule, rather than being exclusively driven to completion. Embedded distro engineering is critically under-resourced (yes, I know, every open source project is, but distro engineering in particular so :). I hope this isn't seen as another unwanted lecture. |
I was not aware of 32 bit debian still using 32 bit time_t. But I think you're right that could very well be a reason why people would not like to deprecate this in curl yet. And when not deprecated, we don't willingly break it. |
I have set up a i386 debian docker and ran the tests in there, without the patch, and then with it. Without the patch everything passes, with the patch the failures are the same set as mingw: 31 46 61 1415 1915 I suppose the simplest is to skip them if time_t is too small, for using dates that need more than 32 bits to be correctly represented. |
In order to keep cookie-testing working even for small-time_t systems, the nicest approach is to insert conditionals into the test cases like this: diff --git a/tests/data/test31 b/tests/data/test31
index 821fed9fb..1b9324021 100644
--- a/tests/data/test31
+++ b/tests/data/test31
@@ -52,11 +52,15 @@ Set-Cookie: httpandsec7=myvalue8 ; domain=test31.curl; path=/p4/; secure; httpo
Set-Cookie: httpandsec8=myvalue9; domain=test31.curl; path=/p4/; secure=; httponly
Set-Cookie: partmatch=present; domain=test31.curl ; path=/;
Set-Cookie:eat=this; domain=moo.foo.moo;
Set-Cookie: eat=this-too; domain=.foo.moo;
Set-Cookie: nodomainnovalue
+%if large-time
+Set-Cookie: nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2537
+%else
Set-Cookie: nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2037
+%endif
Set-Cookie: novalue; domain=reallysilly
Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2030
Set-Cookie: magic=yessir; path=/silly/; HttpOnly
Set-Cookie: blexp=yesyes; domain=test31.curl; domain=test31.curl; expiry=totally bad;
@@ -155,11 +159,15 @@ Accept: */*
test31.curl FALSE /we/want/ FALSE 0 prespace yes before
test31.curl FALSE /we/want/ FALSE 0 withspaces2 before equals
test31.curl FALSE /we/want/ FALSE 0 withspaces yes within and around
.test31.curl TRUE /we/want/ FALSE 0 blexp yesyes
#HttpOnly_test31.curl FALSE /silly/ FALSE 0 magic yessir
+%if large-time
+test31.curl FALSE /we/want/ FALSE 17896593387 nodomain value
+%else
test31.curl FALSE /we/want/ FALSE 2118138987 nodomain value
+%endif
.test31.curl TRUE / FALSE 0 partmatch present
#HttpOnly_.test31.curl TRUE /p4/ FALSE 0 httponly myvalue1
#HttpOnly_.test31.curl TRUE /p4/ FALSE 0 httpo4 value4
#HttpOnly_.test31.curl TRUE /p3/ FALSE 0 httpo3 value3
#HttpOnly_.test31.curl TRUE /p2/ FALSE 0 httpo2 value2 |
Let's see what github CI says now. |
In order to keep cookie-testing working even for small-time_t systems, the
nicest approach is to insert conditionals into the test cases like this:
An alternate approach would be to create a new test that just tests the >2038
dates and restrict the entire test to systems with >32 bit time_t. That can be
done with <precheck> and doesn't need any additional test harness support.
|
The additional support you mention has already been added. The feature |
Grrr. The hyper job failure in test 31 is annoying.
A problem that leads to this is that the Hyper is then "cleaning" headers that it delivers to us so even if it reads multiple leading whitespaces it delivers them to us with just one, and the test script uses the same block for what to send and then to check that the exact same contents was received. |
If hyper is enabled, it's safe to assume 64-bit time_t. Also, one of <strip>,
<strippart> or <postcmd> might be usable to fix this if it can't be done
another way.
|
Provides more flexiblity to test cases. Also warn and bail out if there is an '%else' or %endif' without a preceeding '%if'. Ref: #11610
Supporting nested condition was not very hard either, so I made #11728 |
I don't think that's true? I bet you can build hyper on 32 bit debian, can't you? |
@kanavin if you rebase this branch onto master and force-push, it will use my %if improvements supporting nested use, which then should fix the hyper test failures... I hope. |
@bagder seems like it didn't help? |
I don't think that's true? I bet you can build hyper on 32 bit debian, can't
you?
Looks like you're right. I had thought that all relevant Rust time types were
u64 on all architectures, but some important ones mirror the underlying
architecture's time types and will also be 32 bits in that case. I don't know
if Hyper is actually affected by that, though, but chances are good that it
would be.
|
Even when curl is built to use hyper, the date parsing - including the one done for cookies - is all done by our native code so when we build curl+hyper on 32 bit time_t systems, we are affected. In theory, we could fix our own date parser to not rely that much on the native time_t size and possibly that way avoid some 2038 problems, but I am not signing up for that job willingly... |
No, my bad. The %if thing was not good enough. Hang on! |
With #11731 I made the hyper tests work fine in my local tests. My initial nested-if PR was a bit too simple. |
@kanavin okay, sorry for that intermission, can you rebase it again and I think it should be good? |
This allows testing Y2038 with system time set to after that, so that actual Y2038 issues can be exposed, and not masked by expiry errors. Closes curl#11576
Lovely, thanks for your patience! |
Provides more flexiblity to test cases. Also warn and bail out if there is an '%else' or %endif' without a preceeding '%if'. Ref: curl#11610 Closes curl#11728
This allows testing Y2038 with system time set to after that, so that actual Y2038 issues can be exposed, and not masked by expiry errors. Fixes curl#11576 Closes curl#11610
A number of items are removed because the issues have already been resolved with recipe patches (in separate commits). Some issues were also resolved via upstream version updates: glib-2.0 update to 2.78.0 that includes: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3547 https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3550 curl update to 8.3.0 that includes curl/curl#11610 util-linux update to 2.39 that includes util-linux/util-linux#2430 util-linux/util-linux@3ab9e69 util-linux/util-linux#2435 glib-networking update to 2.78.0 that includes https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/241 python3-cryptography update to 42.0.0 which resolves pyca/cryptography#9370 via pyca/cryptography#9964 perl update to 5.40.0 which resolves Perl/perl5#21379 Signed-off-by: Alexander Kanavin <[email protected]>
A number of items are removed because the issues have already been resolved with recipe patches (in separate commits). Some issues were also resolved via upstream version updates: glib-2.0 update to 2.78.0 that includes: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3547 https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3550 curl update to 8.3.0 that includes curl/curl#11610 util-linux update to 2.39 that includes util-linux/util-linux#2430 util-linux/util-linux@3ab9e69 util-linux/util-linux#2435 glib-networking update to 2.78.0 that includes https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/241 python3-cryptography update to 42.0.0 which resolves pyca/cryptography#9370 via pyca/cryptography#9964 perl update to 5.40.0 which resolves Perl/perl5#21379 Signed-off-by: Alexander Kanavin <[email protected]>
A number of items are removed because the issues have been resolved with recipe patches (in separate commits). Some issues were also resolved via upstream version updates: glib-2.0 update to 2.78.0 that includes: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3547 https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3550 curl update to 8.3.0 that includes curl/curl#11610 util-linux update to 2.39 that includes util-linux/util-linux#2430 util-linux/util-linux@3ab9e69 util-linux/util-linux#2435 glib-networking update to 2.78.0 that includes https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/241 python3-cryptography update to 42.0.0 which resolves pyca/cryptography#9370 via pyca/cryptography#9964 perl update to 5.40.0 which includes Perl/perl5#21379 python3 update to 3.13.0 which includes python/cpython#118425 tcl update to 9.0.0 which includes tcltk/tcl@4ca6172 (tcl8 recipe has a simple backport of this) Signed-off-by: Alexander Kanavin <[email protected]>
A number of items are removed because the issues have been resolved with recipe patches (in separate commits). Some issues were also resolved via upstream version updates: glib-2.0 update to 2.78.0 that includes: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3547 https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3550 curl update to 8.3.0 that includes curl/curl#11610 util-linux update to 2.39 that includes util-linux/util-linux#2430 util-linux/util-linux@3ab9e69 util-linux/util-linux#2435 glib-networking update to 2.78.0 that includes https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/241 python3-cryptography update to 42.0.0 which resolves pyca/cryptography#9370 via pyca/cryptography#9964 perl update to 5.40.0 which includes Perl/perl5#21379 python3 update to 3.13.0 which includes python/cpython#118425 python3 update to 3.13.1 which includes python/cpython#124972 tcl update to 9.0.0 which includes tcltk/tcl@4ca6172 (tcl8 recipe has a simple backport of this) dbus update to 1.16.0 which includes https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/444 https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/289 Signed-off-by: Alexander Kanavin <[email protected]>
A number of items are removed because the issues have been resolved with recipe patches (in separate commits). Some issues were also resolved via upstream version updates: glib-2.0 update to 2.78.0 that includes: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3547 https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3550 curl update to 8.3.0 that includes curl/curl#11610 util-linux update to 2.39 that includes util-linux/util-linux#2430 util-linux/util-linux@3ab9e69 util-linux/util-linux#2435 glib-networking update to 2.78.0 that includes https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/241 python3-cryptography update to 42.0.0 which resolves pyca/cryptography#9370 via pyca/cryptography#9964 perl update to 5.40.0 which includes Perl/perl5#21379 python3 update to 3.13.0 which includes python/cpython#118425 python3 update to 3.13.1 which includes python/cpython#124972 tcl update to 9.0.0 which includes tcltk/tcl@4ca6172 (tcl8 recipe has a simple backport of this) dbus update to 1.16.0 which includes https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/444 https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/289 Signed-off-by: Alexander Kanavin <[email protected]>
A number of items are removed because the issues have been resolved with recipe patches (in separate commits). Some issues were resolved via upstream version updates that bring in needed fixes: glib-2.0 update to 2.78.0 that includes: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3547 https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3550 curl update to 8.3.0 that includes curl/curl#11610 util-linux update to 2.39 that includes util-linux/util-linux#2430 util-linux/util-linux@3ab9e69 util-linux/util-linux#2435 glib-networking update to 2.78.0 that includes https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/241 python3-cryptography update to 42.0.0 which resolves pyca/cryptography#9370 via pyca/cryptography#9964 perl update to 5.40.0 which includes Perl/perl5#21379 python3 update to 3.13.0 which includes python/cpython#118425 python3 update to 3.13.1 which includes python/cpython#124972 tcl update to 9.0.0 which includes tcltk/tcl@4ca6172 (tcl8 recipe has a simple backport of this) dbus update to 1.16.0 which includes https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/444 https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/289 openssh update to 10.0p1 which includes openssh/openssh-portable#425 https://bugzilla.mindrot.org/show_bug.cgi?id=3684 https://marc.info/?l=openbsd-bugs&m=172561736524815&w=2 https://lists.mindrot.org/pipermail/openssh-unix-dev/2024-October/041621.html (all reporting the same issue) gcc update to 15.1 which includes llvm/llvm-project#99699 via gcc-mirror/gcc@fa32100 and allows dropping special flags and exceptions for gcc-sanitizers. Signed-off-by: Alexander Kanavin <[email protected]>
This allows testing Y2038 with system time set to after that, so that actual Y2038 issues can be exposed, and not masked by expiry errors.
Closes #11576