From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 99B0E6E442; Thu, 2 Jul 2026 19:30:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 99B0E6E442 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1783009824; bh=1yFO0Nxli0fjN6A1NyjSez70DMAYMaKrVVJTGWVwfzc=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=kxoKDueBl7xRiWiNnsb27HLZwsPDq/RhPJcqAiHS+HMX1dyfeTLkLSBS/ZVebksFe Fm8qJBzYRuPT6AiPe3XNCAF6clwNSZn7mDteamI9WAb9Mpg/9tNg8HDPfkDhyo/ngm T2KTk7nDjsDHxX1i9TnQ8JzwpNy5Ex5qRIr24wak= Received: from send194.i.mail.ru (send194.i.mail.ru [95.163.59.33]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 52EB96E442 for ; Thu, 2 Jul 2026 19:30:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 52EB96E442 Received: by exim-smtp-9d444bb98-cbllp with esmtpa (envelope-from ) id 1wfKIx-000000006Sk-0JAQ; Thu, 02 Jul 2026 19:30:23 +0300 Content-Type: multipart/alternative; boundary="------------lpYTMXuS4K0DqDacCihoSB1M" Message-ID: <1031cf25-dc8c-44ee-be9c-afa6578e0c54@tarantool.org> Date: Thu, 2 Jul 2026 19:30:21 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun , Evgeniy Temirgaleev Cc: tarantool-patches@dev.tarantool.org References: <20260702142817.2292243-1-skaplun@tarantool.org> In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9F229F520D5C1886877FE240A29BAEBC393BA2CD7807430DD182A05F538085040ED799625948DA0853DE06ABAFEAF6705AF0214338CAB382DD459D7A512403F77656845135F6258BD X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7CC84CC3AD347B910EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB553375665EC6F5188975CE83196313286573874E271623C35BBDE8577E22E3E451338DBC389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0A3E989B1926288338941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B65FF0BFC5AEE34BE6CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE765B758295022C166731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A55CE23B845EC842455002B1117B3ED69679EEB2FC69F9DD38B74D9144D44E4FCF823CB91A9FED034534781492E4B8EEADA3A806F356AF31D6 X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D65908F2EC936A79513C0B3BE0BF8FE295207965F2BE00CEA73F149FB4CAD668F2CABEE0D1F4901ED2B9B8341EE9D5BE9A0A1C721AB944E5F73C69F4D326F83377B72C4E57993169BA536536EB022892E5344C41F94D744909CE2512F26BEC029E55448553D2254B8D95CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVQ2xbpK5Vic+lZkcWbekrQk= X-DA7885C5: 8981AAC1699E572DF255D290C0D534F9BAA800A4E604E862D1239C67C61F208EDCD814D0E5B441995B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393520AF17B8A65FDE2E3A5A260090CC6687E72C9C874DCD9F39A66C60851DFCA46EF86D5F70DA33880E41E8EF7A07863ECB274557F927329BE2DDF8182D28ACDB545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] test: skip lj-1470 test on RED OS X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------lpYTMXuS4K0DqDacCihoSB1M Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sergey, seems it is not an OS-specific issue. strace reports that glibc is looking for /etc/localtime, but the file does not exist: strace ./src/luajit -e "print(os.time(os.date('*t', -1)))" futex(0x70d8ab961070, FUTEX_WAKE_PRIVATE, 2147483647) = 0 rt_sigaction(SIGINT, {sa_handler=0x4057e5, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x70d8ab79bfd0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) newfstatat(1, "", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}, AT_EMPTY_PATH) = 0 write(1, "nil\n", 4nil )                    = 4 rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x70d8ab79bfd0}, {sa_handler=0x4057e5, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x70d8ab79bfd0}, 8) = 0 munmap(0x414e2000, 131072)              = 0 exit_group(0)                           = ? +++ exited with 0 +++ The same issue can be reproduced on other Linux distros after removing /etc/localtime. On redOS the issue can be fixed by creating a symlink: ln -sf /usr/share/zoneinfo/Europe/Moscow /etc/localtime ctest -V -R lj-1470-os-time-epoch-minus-1s.test.lua The following tests passed: test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua 100% tests passed, 0 tests failed out of 1 Label Time Summary: tarantool-tests    =   0.00 sec*proc (1 test) Total Test time (real) =   0.01 sec I propose checking a file /etc/localtime instead checking an OS name, this will be a more correct fix. However, LGTM, I will not insist. Sergey On 7/2/26 19:02, Sergey Bronnikov wrote: > > Sergey, > > thanks for the patch! See my comments. > > Sergey > > On 7/2/26 17:28, Sergey Kaplun wrote: >> RED OS for some reason sets `errno` to 2 ENOENT ("No such file or >> directory") after the call to `mktime()`. So just skip the test for it. >> --- >> >> Branch:https://github.com/tarantool/luajit/tree/skaplun/fix-os-time-test-redos >> Failed workflow:https://github.com/tarantool/tarantool/actions/runs/28585213455/job/84775371860?pr=12886#step:5:20692 >> >> Side note: The errno is set for __any__ call to the `mktime()`. >> >> Tested inside the following Docker: >> >> =================================================================== >> FROM registry.red-soft.ru/ubi8/ubi-minimal:latest >> >> RUN dnf update -y && \ >> dnf install -y cmake vim make git curl gcc g++ gdb man && \ >> dnf clean all >> =================================================================== >> >> | docker build . --tag redos >> | docker run --network=host -ti redos bash >> >> Then clone LuaJIT and proceed as usual. >> >> With the patch the test skipped: >> | 1..0 # SKIP RedOS incrorrect behaviour for mktime >> >> .../lj-1470-os-time-epoch-minus-1s.test.lua | 18 +++++++++++++++++- >> 1 file changed, 17 insertions(+), 1 deletion(-) >> >> diff --git a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua >> index dfe1ee11..ebfe6f22 100644 >> --- a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua >> +++ b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua >> @@ -1,9 +1,25 @@ >> local tap = require('tap') >> >> +local function detect_redos() >> + local read_file = require('utils').tools.read_file >> + local hasfile, data = pcall(read_file, '/etc/os-release') >> + if not hasfile then >> + -- Not Linux probably, so not the Red OS. >> + return false >> + else >> + returndata:match('RED OS') >> + end >> +end > > Why do you think the problem is in RedOS, not in Glibc? > > I propose skipping test for some Glibc version using CMake macro > > introduced in the following commit: > > commit af0f59da76292f30ff75be1ab01458d47b226995 > Author: Sergey Kaplun > Date:   Wed Dec 4 15:03:56 2024 +0300 > >     test: fix LuaJIT-tests for old libc version > > Otherwise, we will skip this test for always for RedOS. > > in RedOS 8 glibc version is 2.36-14: > > [root@pony /]# rpm -qa | grep glibc > glibc-common-2.36-14.red80.x86_64 > glibc-gconv-extra-2.36-14.red80.x86_64 > glibc-langpack-en-2.36-14.red80.x86_64 > glibc-langpack-ru-2.36-14.red80.x86_64 > glibc-2.36-14.red80.x86_64 > glibc-devel-2.36-14.red80.x86_64 > > > > Also, why detect_redos() is not in utils.lua? > >> + >> -- The test file demonstrates os.time() fail to return -1 time >> -- value. >> -- See also:https://github.com/LuaJIT/LuaJIT/issues/1470. >> -local test = tap.test('lj-1470-os-time-epoch-minus-1s') >> +local test = tap.test('lj-1470-os-time-epoch-minus-1s'):skipcond({ >> + -- XXX: RED OS for some reason sets `errno` to 2 ENOENT ("No >> + -- such file or directory") after the call to `mktime()`. So >> + -- just skip the test for it. >> + ['RED OS incrorrect behaviour for mktime'] = detect_redos(), >> +}) >> >> test:plan(1) >> --------------lpYTMXuS4K0DqDacCihoSB1M Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Sergey,

seems it is not an OS-specific issue.

strace reports that glibc is looking for /etc/localtime, but the file does not exist:

strace ./src/luajit -e "print(os.time(os.date('*t', -1)))"

<snipped>

futex(0x70d8ab961070, FUTEX_WAKE_PRIVATE, 2147483647) = 0
rt_sigaction(SIGINT, {sa_handler=0x4057e5, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x70d8ab79bfd0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(1, "", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}, AT_EMPTY_PATH) = 0
write(1, "nil\n", 4nil
)                    = 4
rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x70d8ab79bfd0}, {sa_handler=0x4057e5, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x70d8ab79bfd0}, 8) = 0
munmap(0x414e2000, 131072)              = 0
exit_group(0)                           = ?
+++ exited with 0 +++


The same issue can be reproduced on other Linux distros after removing /etc/localtime.

On redOS the issue can be fixed by creating a symlink:

ln -sf /usr/share/zoneinfo/Europe/Moscow /etc/localtime

<snipped>

ctest -V -R lj-1470-os-time-epoch-minus-1s.test.lua

<snipped>

The following tests passed:
        test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua

100% tests passed, 0 tests failed out of 1

Label Time Summary:
tarantool-tests    =   0.00 sec*proc (1 test)

Total Test time (real) =   0.01 sec


I propose checking a file /etc/localtime instead checking an OS name, this will be a more correct fix.

However, LGTM, I will not insist.

Sergey

On 7/2/26 19:02, Sergey Bronnikov wrote:

Sergey,

thanks for the patch! See my comments.

Sergey

On 7/2/26 17:28, Sergey Kaplun wrote:
RED OS for some reason sets `errno` to 2 ENOENT ("No such file or
directory") after the call to `mktime()`. So just skip the test for it.
---

Branch: https://github.com/tarantool/luajit/tree/skaplun/fix-os-time-test-redos
Failed workflow: https://github.com/tarantool/tarantool/actions/runs/28585213455/job/84775371860?pr=12886#step:5:20692

Side note: The errno is set for __any__ call to the `mktime()`.

Tested inside the following Docker:

===================================================================
FROM registry.red-soft.ru/ubi8/ubi-minimal:latest

RUN dnf update -y && \
    dnf install -y cmake vim make git curl gcc g++ gdb man && \
    dnf clean all
===================================================================

| docker build . --tag redos
| docker run --network=host -ti redos bash

Then clone LuaJIT and proceed as usual.

With the patch the test skipped:
| 1..0 # SKIP RedOS incrorrect behaviour for mktime

 .../lj-1470-os-time-epoch-minus-1s.test.lua    | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
index dfe1ee11..ebfe6f22 100644
--- a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
+++ b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
@@ -1,9 +1,25 @@
 local tap = require('tap')
 
+local function detect_redos()
+  local read_file = require('utils').tools.read_file
+  local hasfile, data = pcall(read_file, '/etc/os-release')
+  if not hasfile then
+    -- Not Linux probably, so not the Red OS.
+    return false
+  else
+    return data:match('RED OS')
+  end
+end

Why do you think the problem is in RedOS, not in Glibc?

I propose skipping test for some Glibc version using CMake macro 

introduced in the following commit:

commit af0f59da76292f30ff75be1ab01458d47b226995
Author: Sergey Kaplun <skaplun@tarantool.org>
Date:   Wed Dec 4 15:03:56 2024 +0300

    test: fix LuaJIT-tests for old libc version

Otherwise, we will skip this test for always for RedOS.

in RedOS 8 glibc version is 2.36-14:

[root@pony /]# rpm -qa | grep glibc
glibc-common-2.36-14.red80.x86_64
glibc-gconv-extra-2.36-14.red80.x86_64
glibc-langpack-en-2.36-14.red80.x86_64
glibc-langpack-ru-2.36-14.red80.x86_64
glibc-2.36-14.red80.x86_64
glibc-devel-2.36-14.red80.x86_64



Also, why detect_redos() is not in utils.lua?

+
 -- The test file demonstrates os.time() fail to return -1 time
 -- value.
 -- See also: https://github.com/LuaJIT/LuaJIT/issues/1470.
-local test = tap.test('lj-1470-os-time-epoch-minus-1s')
+local test = tap.test('lj-1470-os-time-epoch-minus-1s'):skipcond({
+  -- XXX: RED OS for some reason sets `errno` to 2 ENOENT ("No
+  -- such file or directory") after the call to `mktime()`. So
+  -- just skip the test for it.
+  ['RED OS incrorrect behaviour for mktime'] = detect_redos(),
+})
 
 test:plan(1)
 
--------------lpYTMXuS4K0DqDacCihoSB1M--