Skip to content
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

[BUG] Failing Parse date test on 32bit x86 system #4754

Open
1 task done
arkamar opened this issue Dec 21, 2023 · 3 comments
Open
1 task done

[BUG] Failing Parse date test on 32bit x86 system #4754

arkamar opened this issue Dec 21, 2023 · 3 comments
Labels

Comments

@arkamar
Copy link
Contributor

arkamar commented Dec 21, 2023

Prerequisites

Describe the bug
I tried to run tests in Gentoo i686 container and one of the Parse date tests fail with following output:

...
Parse date: Tue, 19 Jan 2038 03:14:09 GMT                            [F]
...
------------------------------------------------------------------------
608 tests 604 passed 1191 assertions 1 failed 0 errors 3 unassertive 0 pending

Parse date: Tue, 19 Jan 2038 03:14:09 GMT:
Failed asserting that
  (actual)   : -2147483647
 equals to
  (expected) : 2147483649
stack traceback:
        ...amd-3.7.5/work/rspamd-3.7.5_build/test/lua/telescope.lua:199: in function 'assert_rspamd_eq'
        ....7.5/work/rspamd-3.7.5_build/test/lua/unit/smtp_date.lua:51: in function <....7.5/work/rspamd-3.7.5_build/test/lua/unit/smtp_date.lua:49>
        [C]: in function 'xpcall'
        ...amd-3.7.5/work/rspamd-3.7.5_build/test/lua/telescope.lua:441: in function 'invoke_test'
        ...amd-3.7.5/work/rspamd-3.7.5_build/test/lua/telescope.lua:481: in function 'run'
        .../rspamd-3.7.5/work/rspamd-3.7.5_build/test/lua/tests.lua:28: in main chunk
ninja: build stopped: subcommand failed.

It clearly looks like some 32 bit vs 64 bit signed int issue, probably related to time_t.

Steps to Reproduce

  1. run tests in 32 bit x86 system
  2. observe the error :)

Expected behavior
Test pass

Versions

The same happens in rspamd versions 3.6, 3.7.4 and 3.7.5.

OS: Gentoo i686
System uname: Linux-6.5.9-x86_64-AMD_Ryzen_5_2400G_with_Radeon_Vega_Graphics-with-glibc2.38
(It is 32 bit environment in 64 bit machine)

@arkamar arkamar added the bug label Dec 21, 2023
@arkamar
Copy link
Contributor Author

arkamar commented Jan 17, 2024

see also this: https://bugs.gentoo.org/922250

@vstakhov
Copy link
Member

To be honest, I don't know what to do with this issue. Remove this test?

@thesamesam
Copy link

thesamesam commented Jan 20, 2024

If you can't portably check for the size of time_t in Lua, I'd just skip it for now. Maybe we could have the build system check and set a macro for it then copy from test.lua.in -> test.lua if we really care.

Migrating to 64-bit time_t system-wide is something we're planning but it will take time.

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

No branches or pull requests

3 participants