Re: regression on zOS between 5.4.8 to 5.5.0 on zOS

Eric Covener <[email protected]>
Newsgroups gmane.comp.lang.lua.general
Message-ID <CALK=YjNAfPGXYdBK-Qh9qDCUzfM=SVtuDKUFZGRpSFhT8+VVfg@mail.gmail.com>
On Mon, Feb 2, 2026 at 2:19 PM Roberto Ierusalimschy
<[email protected]> wrote:
>
> > The same SW stack and automated test works for me on AIX (which is
> > also Big Endian), Windows, Linux/x86_64, Linux/s390x, and
> > Linux/ppc64le
> > The previous stack, with 5.4.8 or even 5.2.2. worked OK on the above + zOS
> >
> > My suspicion is that something about the structs, unions, and
> > shifting/masking around the representation of the stack is not as
> > portable as 5.4.8.
> > But I didn't get very far trying various de-optimizations in lobject.h
> > and lopcodes.h
>
> That is possible. Does zOS has something unusual related to alignment,
> words, sizes for basic objects, or other memory issues?

Big endian is the obvious one but it shares that with AIX which is unaffected.
I have also seen warnings that "strict aliasing" is rather
strict/aggressive on zOS / xlc.


> In particular, can you try the following?
>
> -------------------------------------------------------------------------
> --- a/lstate.c
> +++ b/lstate.c
> @@ -345,2 +345,3 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud, unsigned seed) {
>                         (*f)(ud, NULL, LUA_TTHREAD, sizeof(global_State)));
> +printf("%ld %ld\n", sizeof(StackValue), sizeof(TValue));
>    if (g == NULL) return NULL;
> -------------------------------------------------------------------------
>
> StackValue is a union than contains a TValue, and there is a lot of
> casts from one to the other. If we want to get the next element, we
> must add 1 to a pointer to the first type, before the cast.
>
> In most machines, these two objects have the same size, so a bug of
> adding 1 after the cast won't be detected.

Both 16 bytes.  I have gone a few rounds of unsuccessful AI-assisted
debugging but I do have some more verbose debug related to the various
offsets and macros, in lvm.c and lstate.c

I have collected it here:

https://gist.github.com/covener/4412c8be7762916335bb05e1d8171511

-- 
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/CALK%3DYjNAfPGXYdBK-Qh9qDCUzfM%3DSVtuDKUFZGRpSFhT8%2BVVfg%40mail.gmail.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.