Open
Conversation
On 32-bit systems with signed time_t (e.g. x86), the gmtime_max configure test incorrectly reports TIME_T_MAX_BITS=32 instead of 31. Change the loop bound from sizeof(time_t)*8 to sizeof(time_t)*8 - 1, so on 32-bit signed time_t the loop stops at bits < 31, exits with bits = 31, and TIME_T_MAX_BITS is correctly set to 31 instead of the buggy 32.
gentoo-bot
pushed a commit
to gentoo/gentoo
that referenced
this pull request
Mar 31, 2026
Two tests fail in 32 bit systems. First one is just test values overflowing long in 32 bit. Second one seems to be an off-by-one error Also see dovecot/core#275 Closes: https://bugs.gentoo.org/971763 Signed-off-by: Eray Aslan <eras@gentoo.org>
Contributor
|
This is more or less a duplicate of #247 which is also unfortunately a bit stuck, because to me it looks like the time_t bits handling is all messed up and I haven't spent time understanding if the current changes are good or if something more should be done. |
Contributor
|
Possibly Dovecot shouldn't even pretend to support unsigned time_t. I don't think there are any such supported systems, so we could just have configure fail if time_t is unsigned. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two tests fail in 32 bit (x86, ppc32 and arm32) systems:
1/ event filter: sizes with different interval units .................... : FAILED
and
2/ FAIL: test-imap-date
test-imap-date.c:46: Assert(#2) failed: tests[i].timestamp == ts
-23296 == -1 is not true
test-imap-date.c:49: Assert(#0) failed: !imap_parse_date(invalid_tests[i], &ts)
test-imap-date.c:49: Assert(#1) failed: !imap_parse_date(invalid_tests[i], &ts)
test-imap-date.c:49: Assert(#2) failed: !imap_parse_date(invalid_tests[i], &ts)
imap_parse_date() .................................................... : FAILED
test-imap-date.c:93: Assert(#2) failed: tests[i].timestamp == ts
2147483647 == -1 is not true
imap_parse_date() .................................................... : FAILED
2 / 2 tests failed
First one is just test values overflowing long in 32 bit and the second one seems to be an off-by-one error