<html><head></head><body><div dir="auto">Sergey,<br><br>thanks for the patch, LGTM.<br><br>Sergey</div><br><br><div class="gmail_quote"><div dir="auto">2 июля 2026 г. 22:21:03 GMT+03:00, Sergey Kaplun <skaplun@tarantool.org> пишет:</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="com-fsck-k9__plain-text-message-pre"><div dir="auto">`os.time()` uses `mktime()` to specify time by the given table.<br>`mktime()` produces the call to `tzset()` to determine the system's<br>timezone. If the TZ variable does not appear in the environment, the<br>system timezone is used. The system timezone is configured by copying,<br>or linking, a file in the tzfile(5) format to /etc/localtime. So, if<br>this file is omitted (like in RED OS), the errno is set to a non-zero<br>value. This leads to the nil returned by the `os.time()` for -1 time<br>value.<br><br>This patch skips the test if this file is missed to be sure that we<br>don't obtain any false positive failures due to system<br>misconfigurations.<hr>Branch: <a href="https://github.com/tarantool/luajit/tree/skaplun/fix-os-time-test-redos">https://github.com/tarantool/luajit/tree/skaplun/fix-os-time-test-redos</a><br>Failed workflow: <a href="https://github.com/tarantool/tarantool/actions/runs/28585213455/job/84775371860?pr=12886#step:5:20692">https://github.com/tarantool/tarantool/actions/runs/28585213455/job/84775371860?pr=12886#step:5:20692</a><br><br>Tested inside the following Docker:<hr>FROM registry.red-soft.ru/ubi8/ubi-minimal:latest<br><br>RUN dnf update -y && \<br>    dnf install -y cmake vim make git curl gcc g++ gdb man && \<br>    dnf clean all<hr>| docker build . --tag redos<br>| docker run --network=host -ti redos bash<br><br>Then clone LuaJIT and proceed as usual.<br><br>With the patch the test skipped:<br>| 1..0 # SKIP Unconfigured timezone rules<br><br>Changes in v2:<br><br>* Skip patch not for RED OS but for all distributions with unconfigured<br>  timezones (i.e. missing '/etc/localtime').<br><br> .../lj-1470-os-time-epoch-minus-1s.test.lua   | 20 ++++++++++++++++++-<br> 1 file changed, 19 insertions(+), 1 deletion(-)<br><br>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<br>index dfe1ee11..48c6c3a3 100644<br>--- a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua<br>+++ b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua<br>@@ -1,9 +1,27 @@<br> local tap = require('tap')<br> <br>+local function unconfigured_timezone()<br>+  -- `os.time()` uses `mktime()` to specify time by the given<br>+  -- table. `mktime()` produces the call to `tzset()` to determine<br>+  -- the system's timezone.<br>+  -- If the TZ variable does not appear in the environment, the<br>+  -- system timezone is used. The system timezone is configured by<br>+  -- copying, or linking, a file in the tzfile(5) format to<br>+  -- /etc/localtime. So, if this file is omitted, the errno is<br>+  -- set to a non-zero value. This leads to the nil returned by<br>+  -- the `os.time()` for -1 time value. Let's skip the test if<br>+  -- this file is missed to be sure that we don't obtain any false<br>+  -- positive failures due to system misconfigurations.<br>+  local f = io.open('/etc/localtime', 'r')<br>+  return not f<br>+end<br>+<br> -- The test file demonstrates os.time() fail to return -1 time<br> -- value.<br> -- See also: <a href="https://github.com/LuaJIT/LuaJIT/issues/1470">https://github.com/LuaJIT/LuaJIT/issues/1470</a>.<br>-local test = tap.test('lj-1470-os-time-epoch-minus-1s')<br>+local test = tap.test('lj-1470-os-time-epoch-minus-1s'):skipcond({<br>+  ['Unconfigured timezone rules'] = unconfigured_timezone(),<br>+})<br> <br> test:plan(1)<br> <br></div></pre></blockquote></div></body></html>