regression on zOS between 5.4.8 to 5.5.0 on zOS

82 views
Skip to first unread message

Eric Covener

unread,
Jan 16, 2026, 10:23:06 AM (5 days ago) Jan 16
to lu...@googlegroups.com
Hi, apologies in advance as I am only a casual lua user and only
moonlight on zOS (IBM's big-endian, ebcdic, mainframe OS) where this
is a problem.

I maintain a distribution of Apache HTTP Server on this platform,
which has lua extensions. It seems something between 5.4.8 and 5.5.0
has regressed the basics of the integration between the two.

We don't customize luaconf.h at all and this also works on 5.2.4.

When Apache invokes a very simple lua script, after just a very few
calls through our metatable, calling a C function will error out on:
> attempt to index a number value (local 'r')

Unfortunately I have not been able to reproduce it in a standalone
testcase. Additionally, seemingly innocuous things added to the lua
script make it work again -- these were originally side effects of
longer debug snippets. The smallest Apache-based testcase has some
embedded comments that illustrate this aspect:

function handle(r)
r.content_type = "text/plain"
-- fixes "attempt to index a number value..."
-- local d = debug.getregistry()
-- also works
-- local c= collectgarbage()
-- but not just:
-- collectgarbage()

if r.method == 'GET' then
r:puts("Hello Lua World!\n")
-- this small example fails on the second call
r:puts("Hello Lua World!\n")
end
end


The essence of what we do is here:

https://github.com/apache/httpd/blob/5bf7c9c34e5091894993b43a42639a3fd10d1418/modules/lua/lua_request.c#L2683
https://github.com/apache/httpd/blob/5bf7c9c34e5091894993b43a42639a3fd10d1418/modules/lua/lua_request.c#L2987
https://github.com/apache/httpd/blob/5bf7c9c34e5091894993b43a42639a3fd10d1418/modules/lua/lua_request.c#L1895

I also maintain this stack on AIX, another big endian platform, and
see no problem with 5.5.0.

During some AI driven debugging, whose fixes to
packing/padding/masking never panned out, the theory was that the
macros that isolate parts of each Instruction were suffering from some
s390x-specific problem resulting in very large values being seen for
"ARG A" such as 0x088DD000 instead of very small values.

Please let me know if there is any useful thing to try. Thanks!

--
Eric Covener
cov...@gmail.com

Denis Dos Santos Silva

unread,
Jan 17, 2026, 12:02:46 AM (4 days ago) Jan 17
to lua-l
Hi.

It appears that you are using Apache2 with mod_lua. mod_lua supports Lua 5.1, 5.2, 5.3, or LuaJIT 2.x. In any case, I believe the issue is most likely in the script itself, since it is returning an error message but does not provide any line information. If possible, could you please share a complete example?

Eric Covener

unread,
Jan 17, 2026, 8:43:29 AM (4 days ago) Jan 17
to lu...@googlegroups.com
On Sat, Jan 17, 2026 at 12:02 AM Denis Dos Santos Silva
<de...@roo.com.br> wrote:
>
> Hi.
>
> It appears that you are using Apache2 with mod_lua. mod_lua supports Lua 5.1, 5.2, 5.3, or LuaJIT 2.x.

Yes. I have some local trivial changes to support later lua releases,
and they are working on 5.4.8 (including zOS)

> In any case, I believe the issue is most likely in the script itself, since it is returning an error message but does not provide any line information. If possible, could you please share a complete example?

Coming back to my 5.5-based sandbox, it seems the error from the
interpreter is a little different (maybe different noise within the
stack)

https://gist.github.com/covener/75f3b68af2cc7fe8c684792d354e49c9 is
the complete simplified lua script from a regression test (with the
comment about how some weird debugging steps seem to avoid the error)

The full Apache error.log entry:

[Sat Jan 17 08:34:00.627574 2026] [lua:warn] [pid 67174462:tid
1550839160745492483] AH01471: Lua error:
/u/WASTST1/SRC/IHSJTest/data/lua/example.lua:18: attempt to index a
function value (local 'r')

Where everything after "Lua Error" is coming from the interpreter:
https://github.com/apache/httpd/blob/954d76b9029e06296ec425c4d2e0c6a14600becd/modules/lua/mod_lua.c#L100
Reply all
Reply to author
Forward
0 new messages