Skip to content

Test main for failure seen in #7378 for Y2038 bug #7399

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Carreau
Copy link
Contributor

@Carreau Carreau commented Mar 4, 2025

It's unclear to me how the failure seen in #7378
is related to the change in the PR, it just happen that the test need to try touching in 2068.
The 2^32 error in the test makes me strongly think of the year 2038 bug, so I added a test for that.

@Carreau Carreau force-pushed the touch-y2038 branch 3 times, most recently from 71e2c73 to 8efc9ab Compare March 4, 2025 14:39
Copy link

github-actions bot commented Mar 4, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/misc/tee is no longer failing!

Copy link

github-actions bot commented Mar 4, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@Carreau Carreau marked this pull request as ready for review March 4, 2025 19:47
@Carreau
Copy link
Contributor Author

Carreau commented Mar 4, 2025

Those three failures seem like actual failures / y2038 bugs ?

Which I'm going to guess ends up in the filetime's unix/linux.rs set_times, or utimes.rs, which both call into libc and go beyond my understanding.

@RenjiSann
Copy link
Collaborator

I don't understand why this change is in a separated PR from #7378

@Carreau
Copy link
Contributor Author

Carreau commented Mar 6, 2025

#7378 test (and fix) compatibility with gnu touch, i.e. that

  • -t 68 (or anything lower) is interpreted as years 2000s
  • -t 69 (or anything greater)is interpreted as years 1900s

So really #7378, test the mapping from 2 character years to 4 character years, and could just test parse_timestamp. this mapping is an implementation choice to match gnu touch.

This PR tests that dates just before, at, or just after y2038 bug (even when already a 4 character years) get actually written on filesystem with the correct timestamp (they are not on 32 bits systems). So it tests for a potential bug, independently of whether the year is 2 or 4 characters.

@RenjiSann
Copy link
Collaborator

Ok, that makes sense, thanks !

Copy link

github-actions bot commented Mar 7, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

@Carreau
Copy link
Contributor Author

Carreau commented Mar 7, 2025

I guess one question I don't know how to answer is what should touch do on 32 bit systems, and is it a bug in filetime or something else that should tell you (or prevent you) from setting a wrong timestamp.

@RenjiSann
Copy link
Collaborator

I guess one question I don't know how to answer is what should touch do on 32 bit systems, and is it a bug in filetime or something else that should tell you (or prevent you) from setting a wrong timestamp.

Well, that may be an unpopular opinion, but I'd say that's where our dedication to sticking to GNU's behavior should end.
We're a new implementation, I propose we do not bother with legacy hardware that was never meant to last until 2038.

@Carreau
Copy link
Contributor Author

Carreau commented Mar 10, 2025

I tend to agree, but maybe an error (instead of a silent failure) as long as this project is tested on 32 bits is still worth it ?

seconds + deltas
);
let file = format!("Y2038_{}_{}", date, deltas);
ucmd.args(&["-t", &date, &file]).succeeds().no_output();
Copy link
Collaborator

@jfinkels jfinkels Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be simpler/more concise to just specify the time argument directly? So the three test cases would be

ucmd.args(&["-t", "203801190314.06", "f1"])
ucmd.args(&["-t", "203801190314.07", "f2"])
ucmd.args(&["-t", "203801190314.08", "f3"])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expanded to 3 tests one just before, one at and one just after.

@RenjiSann
Copy link
Collaborator

@Carreau Can you solve the conflict ?

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

Copy link

github-actions bot commented Apr 8, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

@Carreau
Copy link
Contributor Author

Carreau commented Apr 27, 2025

gentle nudge

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)

@sylvestre
Copy link
Contributor

some jobs are failing

It's unclear to me how the failure seen in uutils#7378
is related to the change in the PR, it just happen
that the test need to try touching in 2068.
The 2^32 error in the test makes me strongly think
of  the year 2038 bug, so I added a test for that.
@Carreau
Copy link
Contributor Author

Carreau commented Apr 28, 2025

some jobs are failing

Yes, because the goal of the PR here is to add tests for a behavior that is already failing and was not tested.

I don't think I know how you want to fix it (if you want to fix it, or even if fixable), or if you want me to ignore on some platforms/aarch.

(rebased)

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants